Why is there a difference between FreeBSD and PC-BSD's results partitioning the same drive? reddit / BSD ---------------------------------------------------------------------- z27 · 2015-03-16 16:51 Could somebody please help me understand why there is a difference between FreeBSD and PC-BSD, while partioning same drive? If I partition a drive using PC-BSD "Disk Manager" graphic tool, I get: # gpart show ada0 => 34 11721045101 ada1 GPT (5.5T) 34 11721045096 1 freebsd-zfs (5.5T) 11721045130 5 - free - (2.5K) But, if I format the same drive with FreeBSD, with the following: # gpart create -s GPT ada0 # gpart add -t freebsd-zfs -a 4k I get: # gpart show ada0 => 34 11721045101 ada0 GPT (5.5T) 34 6 - free - (3.0K) 40 11721045088 1 freebsd-zfs (5.5T) 11721045128 7 - free - (3.5K) Why is there a difference? Which method would be best, in order to prepare a drive for an additional ZFS pool? --- Update: Thanks to /r/Malkocoglu's comment, I followed the PCBSD way, and I got: # gpart add -b 34 -s 5723166M -t freebsd-zfs ada0 ada0p1 added, but partition is not aligned on 4096 bytes In my humble opinion, PCBSD's way seems a little sloppier. By skipping the first empty space, the alignment is lost, even if not needed in that case. That is not needed by zfs, since both systems have `sysctl vfs.zfs.min_auto_ashift=12`, to enforce an ashift of at least 12. Still, it seems not as elegant as FreeBSD to me. ---------------------------------------------------------------------- Malkocoglu · 2015-03-16 19:51 It seems that you tell FreeBSD to align the partition to 4K, is not this behaviour normal ? ---------------------------------------------------------------------- z27 · 2015-03-17 07:37 Even if the `-a` parameter is not used, I get the same results: # gpart destroy -F ada0 ada0 destroyed # gpart create -s GPT ada0 ada0 created # gpart add -t freebsd-zfs ada0 ada0p1 added # gpart show ada0 => 34 11721045101 ada0 GPT (5.5T) 34 6 - free - (3.0K) 40 11721045088 1 freebsd-zfs (5.5T) 11721045128 7 - free - (3.5K) I wonder why `gpart` allocates 6 sectors before the `free-bsd` slice? ---------------------------------------------------------------------- Malkocoglu · 2015-03-17 07:54 I think FreeBSD does it right. By leaving necessary amount of space before the partition, the partition is aligned for better performance. 34 * 512 = 17k is not a multiple of 4k. But 40 * 512 = 20k is a multiple of 4k, just above 17k. This is good for ZFS (and maybe other FS as well) but AFAIK the ZFS parameter you mention should not have any effect at this stage. ---------------------------------------------------------------------- z27 · 2015-03-17 07:58 Thank you so much, that is very clear now. Thanks