Hi
I'd like to figure out how to do an upgrade with the ability to rollback fully if anything goes wrong.
Taking into account the info from the following topics:
I do the following:
Here I have my system upgraded and what to rollback to the initial state (including kernel and versions of all installed ports).
So I'm going to do the following:
Now it seems the system is the same as I had before the upgrade.
Is that correct?
Or I should adjust them somehow?
If some user files were updated in a new system - they can be copied from the
And what about this part of the upgrade/rollback?
Is that correct to update/rollback UEFI loader that way?
Thanks
I'd like to figure out how to do an upgrade with the ability to rollback fully if anything goes wrong.
Taking into account the info from the following topics:
- https://forums.freebsd.org/threads/...ke-snapshots-and-do-rollbacks-of-zroot.61297/
- https://forums.freebsd.org/threads/upgrade-freebsd-with-zfs-boot-environments.79025/
- https://forums.freebsd.org/threads/adventures-in-upgrading-boot-environments.77032/
Code:
> uname -a
FreeBSD test 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC amd64
> freebsd-version -kru
12.1-RELEASE
12.1-RELEASE
12.1-RELEASE
> pkg info
dialog4ports-0.1.6 Console Interface to configure ports
diffutils-3.7 GNU differential compare utilities
gettext-runtime-0.20.1 GNU gettext runtime libraries and programs
gettext-tools-0.20.1_1 GNU gettext development and translation tools
glib-2.56.3_6,1 Some useful routines of C programming (current stable version)
gmake-4.2.1_3 GNU version of 'make' utility
indexinfo-0.3.1 Utility to regenerate the GNU info page index
libffi-3.2.1_3 Foreign Function Interface
libiconv-1.14_11 Character set conversion library
libsigsegv-2.12 Handling page faults in user mode
libtextstyle-0.20.1 Text styling library
mc-4.8.22_1 Midnight Commander, a free Norton Commander Clone
pcre-8.43_2 Perl Compatible Regular Expressions library
perl5-5.30.0 Practical Extraction and Report Language
pkg-1.12.0 Package manager
pkgconf-1.6.3,1 Utility to help to configure compiler and linker flags
python27-2.7.16_1 Interpreted object-oriented programming language
readline-8.0.0 Library for editing command lines as they are typed
I do the following:
zfs snap -r zroot@original
bectl create -r new
bectl mount new
chroot {path to mounted "new" snapshot}
mount -t devfs devfs /dev
rm -rf /var/db/freebsd-update
mkdir /var/db/freebsd-update
freebsd-update upgrade -r {NEW_VERSION}
freebsd-update install
bectl activate new
reboot
- What I have at this point
Code:> uname -a FreeBSD test 13.0-RC3 FreeBSD 13.0-RC3 #0 releng/13.0-n244696-8f731a397ad: Fri Mar 19 04:00:20 UTC 2021 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 > freebsd-version -kru 13.0-RC3 13.0-RC3 12.1-RELEASE > pkg info dialog4ports-0.1.6 Console Interface to configure ports diffutils-3.7 GNU differential compare utilities gettext-runtime-0.20.1 GNU gettext runtime libraries and programs gettext-tools-0.20.1_1 GNU gettext development and translation tools glib-2.56.3_6,1 Some useful routines of C programming (current stable version) gmake-4.2.1_3 GNU version of 'make' utility indexinfo-0.3.1 Utility to regenerate the GNU info page index libffi-3.2.1_3 Foreign Function Interface libiconv-1.14_11 Character set conversion library libsigsegv-2.12 Handling page faults in user mode libtextstyle-0.20.1 Text styling library mc-4.8.22_1 Midnight Commander, a free Norton Commander Clone pcre-8.43_2 Perl Compatible Regular Expressions library perl5-5.30.0 Practical Extraction and Report Language pkg-1.12.0 Package manager pkgconf-1.6.3,1 Utility to help to configure compiler and linker flags python27-2.7.16_1 Interpreted object-oriented programming language readline-8.0.0 Library for editing command lines as they are typed
freebsd-update install
- rebuild/update all ports/packages installed
freebsd-update install
gpart bootcode -p /boot/boot1.efifat -i 1 nvd0
reboot
Code:
> uname -a
FreeBSD test 13.0-RC3 FreeBSD 13.0-RC3 #0 releng/13.0-n244696-8f731a397ad: Fri Mar 19 04:00:20 UTC 2021 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
> freebsd-version -kru
13.0-RC3
13.0-RC3
13.0-RC3
> pkg info
dialog4ports-0.1.6 Console Interface to configure ports
diffutils-3.7 GNU differential compare utilities
gettext-runtime-0.21 GNU gettext runtime libraries and programs
gettext-tools-0.21 GNU gettext development and translation tools
glib-2.66.7_1,1 Some useful routines of C programming (current stable version)
gmake-4.3_2 GNU version of 'make' utility
indexinfo-0.3.1 Utility to regenerate the GNU info page index
libffi-3.3_1 Foreign Function Interface
libiconv-1.16 Character set conversion library
libsigsegv-2.12 Handling page faults in user mode
libtextstyle-0.21 Text styling library
mc-nox11-4.8.26 Midnight Commander, a free Norton Commander Clone
meson-0.57.1 High performance build system
ninja-1.10.2,2 Small build system closest in spirit to Make
pcre-8.44 Perl Compatible Regular Expressions library
perl5-5.32.1_1 Practical Extraction and Report Language
pkg-1.16.3 Package manager
pkgconf-1.7.4,1 Utility to help to configure compiler and linker flags
py37-setuptools-44.0.0 Python packages installer
python37-3.7.10 Interpreted object-oriented programming language
readline-8.1.0 Library for editing command lines as they are typed
Here I have my system upgraded and what to rollback to the initial state (including kernel and versions of all installed ports).
So I'm going to do the following:
zfs snap -r zroot@new
bectl activate default
reboot
# here I'm booting from LiveCD- import and mount my zpool
cd {mount dir}
mkdir backup
mv bin boot etc lib libexec rescue sbin usr var backup/
cp -pR {mount dir}/.zfs/snapshot/original/. {mount dir}
gpart bootcode -p {mount dir}/boot/boot1.efifat -i 1 nvd0
Code:
> uname -a
FreeBSD test 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC amd64
> freebsd-version -kru
12.1-RELEASE
12.1-RELEASE
12.1-RELEASE
> pkg info
dialog4ports-0.1.6 Console Interface to configure ports
diffutils-3.7 GNU differential compare utilities
gettext-runtime-0.20.1 GNU gettext runtime libraries and programs
gettext-tools-0.20.1_1 GNU gettext development and translation tools
glib-2.56.3_6,1 Some useful routines of C programming (current stable version)
gmake-4.2.1_3 GNU version of 'make' utility
indexinfo-0.3.1 Utility to regenerate the GNU info page index
libffi-3.2.1_3 Foreign Function Interface
libiconv-1.14_11 Character set conversion library
libsigsegv-2.12 Handling page faults in user mode
libtextstyle-0.20.1 Text styling library
mc-4.8.22_1 Midnight Commander, a free Norton Commander Clone
pcre-8.43_2 Perl Compatible Regular Expressions library
perl5-5.30.0 Practical Extraction and Report Language
pkg-1.12.0 Package manager
pkgconf-1.6.3,1 Utility to help to configure compiler and linker flags
python27-2.7.16_1 Interpreted object-oriented programming language
readline-8.0.0 Library for editing command lines as they are typed
Now it seems the system is the same as I had before the upgrade.
Is that correct?
Or I should adjust them somehow?
If some user files were updated in a new system - they can be copied from the
/.zfs/snapshot/new/usr/home/{user}
And what about this part of the upgrade/rollback?
gpart bootcode -p /boot/boot1.efifat -i 1 nvd0
Is that correct to update/rollback UEFI loader that way?
Thanks