Creating a bootable ZFS disk?

Warren Block wblock at wonkity.com
Sat Dec 27 15:27:49 UTC 2014


On Sat, 27 Dec 2014, Dr Josef Karthauser wrote:

> I?m trying to create a new ZFS pool from an existing one (the new one is 4k aligned and the old one is legacy 512b).
>
> But, I can?t get it to boot! Not sure what I?m doing wrong.
>
> I thought I could create the new pool, and use ?zfs send/recv? to copy the existing pool and then boot onto the new disk, but the kernel doesn?t load? :(.
>
> Does anyone know what I?m doing wrong?
>
> Here?s my recipe:
>
> 	# gpart create -s gpt diskid/DISK-NEW-DISK
> 	# gpart add -s 64K -t freebsd-boot diskid/DISK-NEW-DISK
> 	# gpart add -t 8G freebsd-swap diskid/DISK-NEW-DISK
> 	# gpart add -t freebsd-zfs diskid/DISK-NEW-DISK
> 	# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 diskid/DISK-NEW-DISK

Those partitions are probably not aligned to 4K.  Add "-a4k" to the 
gpart add commands.  (Remember that ashift is filesystem block size, not 
alignment.)


More information about the freebsd-stable mailing list