Why “partition X does not end on cylinder boundary” warnings don’t matter

While reviewing the partion layout on one of my hard drives, I noticed a number of “Partition X does not end on cylinder boundary” messages in the fdisk output:

$ fdisk /dev/sda

The number of cylinders for this disk is set to 9726.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xac42ac42

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26         287     2097152   83  Linux
Partition 2 does not end on cylinder boundary.
/dev/sda3             287        9726    75822111+  8e  Linux LVM

This was a bit disconcerting at first, but after a few minutes of thinking it dawned on me that modern systems use LBA (Logical Block Addressing) instead of CHS (Cylinder/Head/Sector) to address disk drives. If we view the partition table using sectors instead of cylinders:

$ sfdisk -uS -l /dev/sda

Disk /dev/sda: 9726 cylinders, 255 heads, 63 sectors/track
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/sda1   *        63    409662     409600  83  Linux
/dev/sda2        409663   4603966    4194304  83  Linux
/dev/sda3       4603967 156248189  151644223  8e  Linux LVM
/dev/sda4             0         -          0   0  Empty

We can see that we end at a specific sector number, and start the next partition at that number plus one. I must say that I have grown quite fond of sfdisk and parted, and they sure make digging through DOS and GPT labels super easy.

6 Comments

heywhat  on March 4th, 2010

FYI to visitors: On Gentoo Linux, using sfdisk as the article demonstrates does not suppress CHS messages, but it’s still possible to verify proper positioning:

#sfdisk -uS -l /dev/sda

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x1549f232

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 206847 102400 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 206848 953903103 476848128 7 HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3 953903104 976771071 11433984 7 HPFS/NTFS
Partition 3 does not end on cylinder boundary.

…with the note that it’s also possible to do this with fdisk, e.g.:

#fdisk -lu /dev/sda

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 206847 102400 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 206848 953903103 476848128 7 HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3 953903104 976771071 11433984 7 HPFS/NTFS
Partition 3 does not end on cylinder boundary.

Samples are from a Windows 7 Professional install.

joei  on July 23rd, 2010

thx for this useful information man!

rocknroll!

Siddharta  on March 11th, 2011

Thank you for this entry. It was useful and it came as one of the first results provided by Google.

Siddharta.

lefty.crupps  on October 14th, 2011

I only get this error on a single drive of many that I work with, and this drive won’t accept /dev/sde1 as a valid partition; I can only format and mount the whole of /dev/sde. Any thoughts? I’ve run a full filesystem check against the drive (fsck -c /dev/sde) and it said it made modifications but this isn’t working any better.

Brian  on January 15th, 2012

If I understand the above, I actually DO have a problem here (see below). So now what do I do?!?

brian@brian-ThinkPad-T60:~$ sudo sfdisk -uS -l /dev/sda

Disk /dev/sda: 60801 cylinders, 255 heads, 63 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Units = sectors of 512 bytes, counting from 0

Device Boot Start End #sectors Id System
/dev/sda1 * 2048 206847 204800 7 HPFS/NTFS
end: (c,h,s) expected (12,223,19) found (13,163,19)
/dev/sda2 206848 97677311 97470464 7 HPFS/NTFS
start: (c,h,s) expected (12,223,20) found (13,163,20)
end: (c,h,s) expected (1023,254,63) found (1023,239,63)
/dev/sda3 97679358 195354623 97675266 5 Extended
start: (c,h,s) expected (1023,254,63) found (1023,239,63)
end: (c,h,s) expected (1023,254,63) found (1023,239,63)
/dev/sda4 195354624 976773119 781418496 7 HPFS/NTFS
start: (c,h,s) expected (1023,254,63) found (1023,239,63)
end: (c,h,s) expected (1023,254,63) found (1023,239,63)
/dev/sda5 97679360 193275903 95596544 83 Linux
start: (c,h,s) expected (1023,254,63) found (1023,239,63)
end: (c,h,s) expected (1023,254,63) found (1023,239,63)
/dev/sda6 193277952 195354623 2076672 82 Linux swap / Solaris
start: (c,h,s) expected (1023,254,63) found (1023,239,63)
end: (c,h,s) expected (1023,254,63) found (1023,239,63)

matty  on January 15th, 2012

Brian,

What does the parted print option show?

- Ryan

Leave a Comment