fdisk(8) vs gpart(8), and gnop

Michael W. Lucas mwlucas at michaelwlucas.com
Sun Jun 1 00:42:53 UTC 2014


$SUBJECT have been two contentious points of discussion in private
mail, Twitter, the BSDCan bar track, and random people passing on the
street. I was very surprised at the number of knowledgeable people who
have different ideas on this and argue about it at length.

I'm hoping to verify what seems to be correct.

First, is fdisk EVER necessary? I *believe* that gpart's '-a 4k'
handles all alignment issues for the 512B/4KB sector issues. If you
sometimes need to use fdisk, when exactly is that?

Similarly, I *believe* that you need to "gnop -S 4096 $device" any
time you want to use ZFS, so that 1) zfs sets ashift=12 and 2) you can
later replace a 512B-sector drive with a 4096KB-sector drive without
ZFS having a hissy fit about mismatched sector sizes.

Finally, while UFS isn't picky about changing the underlying sector
size on a dump/restore, I believe it's a good idea to always gnop the
underlying disk. Disks lie about sector size, and while it's OK to
assume a 4k-sector disk, assuming a 512b-sector disk on a 4k-sector
disk causes write multiplication.

Are my beliefs correct?

I need to get this part of the book correct, or the rest of it will go
wildly astray...


Michael W. Lucas  -  mwlucas at michaelwlucas.com, Twitter @mwlauthor 
http://www.MichaelWLucas.com/, http://blather.MichaelWLucas.com/

More information about the freebsd-hackers mailing list