1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Discuss in my forum

Linux Partition How-To

By Anthony Lissot

5.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
 

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. (See 4 for discussion on problems with this calculation.) The start and end values are cylinders.

* License

* Linux Partition How-To Index

  1. About.com
  2. Technology
  3. Linux

©2014 About.com. All rights reserved.