eyt*
December 3, 2004

fdisk's SGI partition table fix for variable sector sizes...

I have recently discussed a bug with Linux's dvhtool when dealing with devices whose block size is greater than 512 bytes. A similar issue also exists in fdisk when creating SGI partition tables, as filed in RedHat's Bugzilla Bug 140437.

The issue is that the sector size in the volume header was hard coded to 512, and therefore, SGI IRIX's fx tool would report errors on such devices and would attempt to create filesystems that exceeded the drive's capacity. The patch resolves this issue by using the sector_size variable. I have also updated the partition table display to correctly denote what is happening.

With this patch, you must partition the drive via the base device (/dev/sda, for example), and not via SGI's volume partition (such as /dev/sda3). In the former case, the number of calculated sectors (represented by llsectors) is in blocks of 512, whereas in the latter case, it is in blocks of 4096, and therefore, the division by sector size constantly makes the device smaller.

The bug was tested between an IRIX and Linux workstation, where the device would be initialized and moved to the other operating system for validation.

This patch has been submitted directly to the maintainers of util-linux, and is based on Debian's util-linux 2.12i. If you see any issues with the patch, please let me know.


Posted 17 years, 3 months ago on December 3, 2004
The trackback url for this post is http://www.eyt.ca/blog/bblog/trackback.php/101/

Comments have now been turned off for this post. If you want to share something, please e-mail me.

Navigation

Recent Posts

eyt*