Linux Fdisk Partitioning

June 11, 2010 at 5:37 am Leave a comment

1.How to partition a disk using fdisk?

    Partitioning with fdisk

This section shows you how to actually partition your hard drive with the fdisk utility. Linux allows only 4 primary partitions. You can have a much larger number of logical partitions by sub-dividing one of the primary partitions. Only one of the primary partitions can be sub-divided.

    1. fdisk usage

fdisk is started by typing (as root) fdisk device at the command prompt. device might be something like /dev/hda or /dev/sda (see Section 2.1.1). The basic fdisk commands you need are:

p print the partition table

n create a new partition

d delete a partition

q quit without saving changes

w write the new partition table and exit

Changes you make to the partition table do not take effect until you issue the write (w) command. Here is a sample partition table:

    Disk /dev/hdb: 64 heads, 63 sectors, 621 cylinders
    Units = cylinders of 4032 * 512 bytes
     
       Device Boot    Start       End    Blocks   Id  System
    /dev/hdb1   *         1       184    370912+  83  Linux
    /dev/hdb2           185       368    370944   83  Linux
    /dev/hdb3           369       552    370944   83  Linux
    /dev/hdb4           553       621    139104   82  Linux swap
  1. The first line shows the geometry of your hard drive. It may not be physically accurate, but you can accept it as though it were. The hard drive in this example is made of 32 double-sided platters with one head on each side (probably not true). Each platter has 621 concentric tracks. A 3-dimensional track (the same track on all disks) is called a cylinder. Each track is divided into 63 sectors. Each sector contains 512 bytes of data. Therefore the block size in the partition table is 64 heads * 63 sectors * 512 bytes er…divided by 1024.The start and end values are cylinders.

2.Command for view in a save files?

Vi filename.txt or cat filename.txt

Entry filed under: Linux. Tags: , , , .

Basic PHP How to install and start xampp in Linux(ubuntu/Fedora)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Blog Stats

  • 4,483 hits

RSS Enabled.in

  • An error has occurred; the feed is probably down. Try again later.

Follow

Get every new post delivered to your Inbox.