Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Mar 2014 15:27:13 +0100
From:      Andreas Nilsson <andrnils@gmail.com>
To:        Freddie Cash <fjwcash@gmail.com>
Cc:        FreeBSD Stable <freebsd-stable@freebsd.org>
Subject:   Re: Re: Can ZFS boot from other than the root of a pool?
Message-ID:  <CAPS9%2BSti9F0waFjgCfXtkxz5zW8sDp8=rv=HZujovpp_wg4cmQ@mail.gmail.com>
In-Reply-To: <CAOjFWZ7=ZczHsjrLo2cLjQYAdwhD7wc3kz37GXarbMLeciMySA@mail.gmail.com>
References:  <532AF77A.9010204@denninger.net> <CAOjFWZ7xy01UXkPrB2wfN3=YMn9ToHL81a4SHzToa5sDV0YUqA@mail.gmail.com> <CAOjFWZ7=ZczHsjrLo2cLjQYAdwhD7wc3kz37GXarbMLeciMySA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Mar 20, 2014 at 3:19 PM, Freddie Cash <fjwcash@gmail.com> wrote:

> Forgot to include the list in the original reply.
>
> Typos and terseness brought to you by the LG G2 running SlimKat.
> ---------- Forwarded message ----------
> From: "Freddie Cash" <fjwcash@gmail.com>
> Date: Mar 20, 2014 7:17 AM
> Subject: Re: Can ZFS boot from other than the root of a pool?
> To: "Karl Denninger" <karl@denninger.net>
> Cc:
>
>
> On Mar 20, 2014 7:13 AM, "Karl Denninger" <karl@denninger.net> wrote:
> >
> > For a number of reasons having to do with backup strategy I want to mount
> a ZFS root from "poolname/root" instead just "poolname."
> >
> > That works ok; I can set in /boot/loader.conf:
> > vfs.root.mountfrom="zfs:zroot/root"
> >
> > But -- I cannot actually boot from there.  Unless the /boot directory is
> in zfs:/zroot the system cannot find it, and I see no obvious way to
> "teach" the loader that I want it to look in the filesystem under the top
> level.
> >
> > This isn't a terrible pain as I can simply mount zroot on /mnt and then
> copy zroot/root/boot over to zroot/boot whenever I make changes to the
> kernel or boot environment (which is infrequent) but I'm wondering if I'm
> missing something that would make booting directly from the filesystem
> where root is specified to be possible.
> >
> > (Obviously until the loader.conf file is found the system doesn't know
> where root is either, so this does look at first blush to be a "chicken and
> egg" problem.)
>
> Read up on Boot Environments, install the beadm port, set the bootfs
> property on the pool itself, and you'll be off to the races.
>

Yes. For quite some time. It is a bit easier on 9.2 and 10.0 and newer
where there is no strict need for /boot/zfs/zpool.cache for the mount of /
to succeed.

I'm booting from tank/ROOT/10-STABLE-140310 om my workstation for example.
To set it up (given the pool tank exists)
zfs create -o mountpoint=none tank/ROOT
zfs create tank/ROOT/yourpreferedname
zpool set bootfs tank/ROOT/yourpreferedname tank
make sure tank/ROOT/yourpreferedname has a "complete" install.

Best regards
Andreas



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPS9%2BSti9F0waFjgCfXtkxz5zW8sDp8=rv=HZujovpp_wg4cmQ>