Date: Sat, 01 Nov 2014 10:25:04 +0000 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: freebsd-questions@freebsd.org Subject: Re: Root-on-ZFS upgrade question Message-ID: <5454B500.5030501@infracaninophile.co.uk> In-Reply-To: <545409E0.9030809@bluerosetech.com> References: <545409E0.9030809@bluerosetech.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RRWa3jtE7M5iLblKRaSC2JB7MwM7BO8LR Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 31/10/2014 22:14, Darren Pilgrim wrote: > If I have a running FreeBSD 9.x system, can I use 10.0 install media an= d > the by-hand approach outlined in the RootOnZFS wiki page to install 10.= 0 > in parallel to the running 9.x then boot into the new OS? I'm asking i= f > I can do it this way because the current OS is 9-stable and I want to > switch over to 10.0-RELEASE stock so I can make use of freebsd-update > from official repos going forward. The basic process would be: >=20 > 1. download and vnode mount 10.0 install media > 2. set up the new tank/osroot10 tree > 3. chroot and install OS and bootblocks as usual > 4. exit chroot, migrate etc things > 5. reboot into rescue media and change mountpoints > 6. reboot into new OS > 7. curse at myself because I forgot that one setting in that one file I= > touched once years ago and didn't note in the logbook > 7a. repeat last step as necessary > 7b. promise to self to be more diligent with the admin logbook THIS TIM= E > I SWEAR FUH REALS >=20 > I don't see anything in the wiki page that would pose a problem. > Amazingly, I was smart enough way back when that I installed the curren= t > OS into a data subset, not the ZFS root, so I think the only extra step= > I need is the extra reboot to move the / mount. >=20 > Am I overlooking anything? You've a 9.x system already running on ZFS? Than, yes, you're overlooking a very big thing. Boot environments. If your 9.x setup is not already setup for boot environments, then it's not too had to convert it. Essentially it is a matter of creating a zpool/ROOT zfs heirarchy and moving the zfses that contain your system to something like zpool/ROOT/9.2-RELEASE -- you need to be careful of the mountpoint and canmount properties while doing that, but by liberal application of commands like 'zfs rename -u zroot/foo zroot/ROOT/9.2-RELEASE/foo' (note the -u flag) it should even be possible to do with the system still running. Once you've got everything laid out in a BE friendly way, install sysutils/beadm. 'beadm list' should show your existing system. But now you can do something like this: # beadm create 10.1-RELEASE # beadm mount 10.1-RELEASE /mnt # mount -t devfs devfs /mnt/dev # chroot /mnt So now you're in a copy of you existing system -- it's a ZFS clone so avoids unnecessary duplication of disk blocks and is generally space efficient. If your original system had been maintained via freebsd-update(8) you could just use that to upgrade to 10.1-RELEASE in place -- when it tells you to reboot, just run freebsd-update again. Given you haven't been using freebsd-update(8), you can use the bit of the RootOnZFS instructions about extracting the contents of the OS from the install media to overwrite what's in your new boot environment. However, this will scribble all over your local settings in /etc -- but never fear, you still have a copy in your original system that you can recover everything from. You can also upgrade all your installed packages etc. Once everything is prepared, type 'exit' to get back to your main system, and: # umount /mnt/dev # beadm umount 10.1-RELEASE # beadm activate 10.1-RELEASE and reboot. Et voil=C3=A0 one system running 10.1. If there's any probl= em, you can revert to your 9.x system just by 'beadm activate 9.2-RELEASE' and rebooting. It's possible to switch to a different boot environment from the loader prompt, or by booting from the install media should you need to -- this is something that they want to add support for to the boot menu screens but that hasn't happened yet, so the process is a bit user unfriendly right now. For more detail, see this thread on the forums: https://forums.freebsd.org/threads/howto-freebsd-zfs-madness.31662/ It's quite a long thread, but it bears reading through it, as there's lots of good stuff there. Note: when using this scheme it is important *not* to apply any zpool or zfs updates until you are sure that you will never need to boot into one of your older boot environments again. You only ever need to update boot blocks when you upgrade zfs or zpool versions, so avoid that too until you're ready to commit to the latest versions. (I can't remember if there are any updates like that for the 9.x -> 10.1 upgrade though. Maybe. Maybe not.) Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey JID: matthew@infracaninophile.co.uk --RRWa3jtE7M5iLblKRaSC2JB7MwM7BO8LR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.20 (Darwin) iQJ8BAEBCgBmBQJUVLUHXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATKX4P/0uZG91sZ5zJ+kGFKBadepni QXG1/XlLQHEAnoBsYkrvyOUeCf8vox0xUxFGpAshpcsQax31hsyWjY0oTcRS+eHr 20xK4Rp3Ctuk4OVR1eautcL3LfFiYpBaY76nutlNgbgtgC5vn4gFiCv1Izz6Z6bi Jgi+hlmZWiYyYS2GroR9sFo3F77dxYj6hIR1/y6HJtDxotG6YwS2KqgbUlZoW/g3 CWhqZgvD20be81/uO3/eY0ULjhfEiro3GHRUM+9rN8aTTvVAUOJfpFPHH8/Sresr N87iR3OBC69Vh6JEBy3P8XtftffzZR1A1EANeha5Ux+yvwtcF736k31mJu+wcSWR YEZTPHDQR2c92DftRQN0mTPpzDux+U60Yaa3JjKfwUSvfvlePsAuMYD1IwM5etcC u1JFCeTx3XeBBGyARMy8KNpPGJwvx92MKQ0CC8AAJtMei6lOXPTeY2l11z0cNsxQ d/1scT1C0y4A6uorqlExYUNdMm8xFbQ/Vfra3YwsVQ5nqynjWUYjdQSAFSRVhCLE fzaMPmWD2hYtD1l/UoJ8UOvDM6Y66oDB6gNas3URzgPzGDcYQdqSoyOETtydnb/L 0SbDwqzyPXWgM/F2rkenC9BrqdBUXojsCWChZ3jdqm1I58JlMIc8tssPRSbXh+md /PJCjQVt+8R4q6m/Ml/+ =bt4E -----END PGP SIGNATURE----- --RRWa3jtE7M5iLblKRaSC2JB7MwM7BO8LR--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5454B500.5030501>