Help with sfdisk

Daniel Carrera daniel.carrera at zmsl.com
Fri Apr 14 15:37:43 UTC 2006


Hello,

I'm trying to write a script using sfdisk but it looks like sfdisk is 
reporting wrong information.

---//--- OUTPUT START ---//---
$ sudo sfdisk -l /dev/hda 2> /dev/null
Disk /dev/hda: 79656 cylinders, 16 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

    Device Boot Start     End   #cyls    #blocks   Id  System
/dev/hda1   *      0+   4790    4791-  38483676   83  Linux
/dev/hda2       4791    4997     207    1662727+   5  Extended
/dev/hda3          0       -       0          0    0  Empty
/dev/hda4          0       -       0          0    0  Empty
/dev/hda5       4791+   4997     207-   1662696   82  Linux swap / Solaris
---//--- OUTPUT END ---//---

It reports 79656 cylinders of 8225280 bytes each. But that would mean 
that I have a 610 GB hard drive, which I don't. My hard drive is 38 GB. 
If you add the cylinders reported for all partitions they give you 4998 
which, at 8225280 bytes each corresponds to 38 GB.

I need a way to get the number of cylinders for the script, but it looks 
like the output from sfdisk is not reliable!!!!!!  Any ideas?


FYI: The ultimate goal is to partition the disk with two partitions, a 
large ext3 partition and a 1GB swap partition at the end. I plan to use 
the number of cylinders and the size of each cylinder to calculate how 
many cylinders to alocate to each and then use fdisk to partition the disk.

Any help would be most appreciated.

Best,
Daniel.
-- 
      /\/`) http://opendocumentfellowship.org
     /\/_/
    /\/_/   A life? Sounds great!
    \/_/    Do you know where I could download one?
    /




More information about the ubuntu-users mailing list