Re: Problem with ZFS userboot changes r262331 and VM with mixed partitions
On Wed, Mar 5, 2014 at 7:22 AM, Kurt Lidl wrote: > > > I ran into this same problem a couple of weeks ago when I first played > with the ZFS boot support in userboot.so. > > The following set of operations on the hypervisor can be used to add > bootable support to your zfs installation. > > (I don't know what the name of your zpool is on the emulated host. > If the name of that zpool is the same as the zpool on your hypervisor > host, you might have to go at this a different way.) I have taken > to naming the zpool for the any clients to be the same as the name > of the virtual machine, so I can easily mount it on the host running > the hypervisor and fiddle with it. > > For the purposes of this example, my virtual machine is called "vm0". > The zpool for that host lives in a zpool called "zdata" on my > hypervisor machine. In my case, my /boot was a symlink that > pointed to /bootdir/boot, so you might need to adjust the > following slightly. > > zfs import -f -R /mnt vm0 > > fsck_ufs /dev/zvol/zdata/vm0p2 > mount /dev/zvol/zdata/vm0p2 /mnt/bootdir > cd /mnt > chflags -h nosunlink boot > rm boot > cp -R bootdir/* . > umount /mnt/bootdir > cd / > zpool export vm0 > > Good luck. Hi, Thanks for breaking down the steps so nicely! I followed similar steps and got my VM to boot with the latest userboot. -- Craig ___ freebsd-virtualization@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization To unsubscribe, send any mail to "freebsd-virtualization-unsubscr...@freebsd.org"
Re: Problem with ZFS userboot changes r262331 and VM with mixed partitions
Hi, I encountered problems with the new changes to userboot to boot ZFS. About a month ago, I created a FreeBSD 10 VM with the following layout: => 34 419430333 md0 GPT (200G) 341281 freebsd-boot (64K) 16220971522 freebsd-ufs (1.0G) 209731483886083 freebsd-swap (4.0G) 10485922 408944 freebsd-zfs (195G) 419430366 1 - free - (512B) The FreeBSD root file system is on p4, which is ZFS. On the root file system, I have a symlink: /boot -> /bootdir /bootdir mounts p2 which is UFS. So in this scenario, the kernel lives on UFS. When I did this about a month ago, during the BHyve boot process, (1) userboot loaded the kernel from p2 (UFS) (2) The kernel booted, loaded zfs.ko, and then proceeded to mount p4 where the root file system lived (ZFS) After r262331, when I try to boot the BHyve VM (1) I can see p4 from the loader prompt (2) The kernel doesn't load (3) If I try to load /boot/kernel/kernel from the loader prompt, I get: ZFS: i/o error - all block copies unavailable I don't fully understand all this logic. Is there a bug that can be fixed here? I ran into this same problem a couple of weeks ago when I first played with the ZFS boot support in userboot.so. The following set of operations on the hypervisor can be used to add bootable support to your zfs installation. (I don't know what the name of your zpool is on the emulated host. If the name of that zpool is the same as the zpool on your hypervisor host, you might have to go at this a different way.) I have taken to naming the zpool for the any clients to be the same as the name of the virtual machine, so I can easily mount it on the host running the hypervisor and fiddle with it. For the purposes of this example, my virtual machine is called "vm0". The zpool for that host lives in a zpool called "zdata" on my hypervisor machine. In my case, my /boot was a symlink that pointed to /bootdir/boot, so you might need to adjust the following slightly. zfs import -f -R /mnt vm0 fsck_ufs /dev/zvol/zdata/vm0p2 mount /dev/zvol/zdata/vm0p2 /mnt/bootdir cd /mnt chflags -h nosunlink boot rm boot cp -R bootdir/* . umount /mnt/bootdir cd / zpool export vm0 Good luck. -Kurt ___ freebsd-virtualization@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization To unsubscribe, send any mail to "freebsd-virtualization-unsubscr...@freebsd.org"
Re: Problem with ZFS userboot changes r262331 and VM with mixed partitions
Hi Craig, Can this flag be passed via bhyveload, and if so, how? It can't yet: the API to userboot has to be changed to allow this to be passed through. later, Peter. ___ freebsd-virtualization@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization To unsubscribe, send any mail to "freebsd-virtualization-unsubscr...@freebsd.org"
Re: Problem with ZFS userboot changes r262331 and VM with mixed partitions
On Tue, Mar 4, 2014 at 2:24 PM, Peter Grehan wrote: > Hi Craig, > > >> ZFS: i/o error - all block copies unavailable >> >> I don't fully understand all this logic. Is there a bug that can be fixed >> here? > > > Yes - a flag needs to be passed to userboot to tell it to ignore ZFS > filesystems. This is analogous to the decision to use boot2 (implicit UFS) > vs zfsboot (explicit ZFS) as the 2nd-stage loader on a real disk. > > It didn't look possible to do this without changing the userboot ABI, but, > it's probably time to bump that. Thanks for the explanation. Can this flag be passed via bhyveload, and if so, how? Right now the workaround was to recompile userboot with: cd /usr/src/sys/boot/userboot make clean make WITHOUT_ZFS=yes make WITHOUT_ZFS=yes install -- Craig ___ freebsd-virtualization@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization To unsubscribe, send any mail to "freebsd-virtualization-unsubscr...@freebsd.org"
Re: Problem with ZFS userboot changes r262331 and VM with mixed partitions
Hi Craig, ZFS: i/o error - all block copies unavailable I don't fully understand all this logic. Is there a bug that can be fixed here? Yes - a flag needs to be passed to userboot to tell it to ignore ZFS filesystems. This is analogous to the decision to use boot2 (implicit UFS) vs zfsboot (explicit ZFS) as the 2nd-stage loader on a real disk. It didn't look possible to do this without changing the userboot ABI, but, it's probably time to bump that. later, Peter. ___ freebsd-virtualization@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization To unsubscribe, send any mail to "freebsd-virtualization-unsubscr...@freebsd.org"