Dualboot and ZFS

Victor Sudakov vas at mpeks.tomsk.su
Thu Jan 18 05:14:33 UTC 2018

Trond Endrest?l wrote:
> [script]# sysctl vfs.zfs.min_auto_ashift=12
> vfs.zfs.min_auto_ashift: 9 -> 12

Why do you change this?

"Min ashift used when creating new top-level vdevs", hmm. You probably
know something I don't. 

> !!! Write the boot manager to the boot block in the MBR !!!
> [script]# gpart bootcode -b /boot/boot0 /dev/ada0
> bootcode written to ada0

Fine, here you install the bootmanager into the MBR. However I have a
couple of questions below regarding the VBR.

> !!! Write /boot/zfsboot as two separate pieces to /dev/ada0s3{,a} !!!
> [script]# dd if=/boot/zfsboot of=/tmp/zfsboot1 count=1
> 1+0 records in
> 1+0 records out
> 512 bytes transferred in 0.000383 secs (1337758 bytes/sec)
> [script]# gpart bootcode -b /tmp/zfsboot1 /dev/ada0s3
> bootcode written to ada0s3

Why do you need this trick with /tmp/zfsboot1 ? Why not

sysctl kern.geom.debugflags=0x10
dd if=/boot/zfsboot of=/dev/ada0s3 count=1 

The example in zfsboot(8) is even weirder. They create a BSD label
within an MBR slice, but never any partitions within. Why do they do
it like that? Quoting the manual page:

         gpart create -s BSD ada0s1
         gpart bootcode -b /boot/boot0 ada0
         gpart set -a active -i 1 ada0
         dd if=/boot/zfsboot of=/dev/ada0s1 count=1
         dd if=/boot/zfsboot of=/dev/ada0s1 iseek=1 oseek=1024

> [script]# dd if=/boot/zfsboot of=/dev/ada0s3a skip=1 seek=1024
> 128+0 records in
> 128+0 records out
> 65536 bytes transferred in 0.043591 secs (1503439 bytes/sec)

Should the "of=" target here be ada0s3a or just ada0s3 ?

Victor Sudakov,  VAS4-RIPE, VAS47-RIPN

More information about the freebsd-questions mailing list