02-21-2014 08:08 PM
Hi Linux guru,
in redhat 6.4 with the command #fdisk /dev/sda i'm geeting the message "partition 1 does not end on cylinder boundary " for few partition. but with the #fdisk -cul /dev/sda not gettng the message. how can we remove the message with the command #fdisk /dev/sda.
02-22-2014 02:19 AM
Without the -c option, the RHEL 6.4 fdisk will run in a mode that attempts to make your partition table compatible with obsolete Microsoft DOS operating system. For MS-DOS, partitions had to end on cylinder boundary. Modern operating systems won't care about that, since the old C/H/S style disk block addressing that was used by MS-DOS is very obsolete now.
So, unless you are working with very old legacy systems, the "partition does not end on cylinder boundary" message is useless and can be safely ignored.
(The C/H/S style disk block addressing cannot handle disks larger than 8.4 GB. With disks larger than that, LBA addressing is always used, and the cylinder boundaries are irrelevant. With modern disks, the C/H/S disk geometry presented to the computer is fictional anyway: the true disk geometry on modern disks is more complex than can be presented with the C/H/S numbers. On a modern hard disk, the outer cylinders can even have more sectors on them than the inner cylinders.)
One workaround would be to add this into your /etc/bashrc:
alias fdisk='fdisk -c'
Unfortunately, the only way to truly remove the message would be to download the util-linux-ng source RPM from RedHat, edit the source code to have the -c option enabled by default in fdisk, and then replace the standard fdisk command with your recompiled version.
The fdisk man page says:
BUGS There are several *fdisk programs around. Each has its problems and strengths. Try them in the order cfdisk, fdisk, sfdisk. (Indeed, cfdisk is a beautiful program that has strict requirements on the par‐ tition tables it accepts, and produces high quality partition tables. Use it if you can. fdisk is a buggy program that does fuzzy things - usually it happens to produce reasonable results. Its single advantage is that it has some support for BSD disk labels and other non-DOS par‐ tition tables. Avoid it if you can. sfdisk is for hackers only -- the user interface is terrible, but it is more correct than fdisk and more powerful than both fdisk and cfdisk. Moreover, it can be used nonin‐ teractively.) These days there also is parted. The cfdisk interface is nicer, but parted does much more: it not only resizes partitions, but also the filesystems that live in them.
So, if you want to use fdisk as a part of a script or some other automated solution, you should consider using sfdisk instead.