PC-BSD® supports a feature of ZFS known as multiple boot environments (BEs). With multiple boot environments, the process of updating software becomes a low-risk operation as you can backup your current boot environment before upgrading or making software updates to your system. If needed, you also have the option of booting into a backup boot environment. For example:

PC-BSD® supports a feature of ZFS known as multiple boot environments (BEs). With multiple boot environments, the process of updating software becomes a low-risk operation as you can backup your current boot environment before upgrading or making software updates to your system. If needed, you also have the option of booting into a backup boot environment. For example:

Line 12:

Line 12:

* you can move a boot environment to another machine, physical or virtual, in order to check hardware support.

* you can move a boot environment to another machine, physical or virtual, in order to check hardware support.

−

{{warning|icon64=For boot environments to work properly, ''' ''do not delete the default ZFS mount points during installation.'' ''' The default ZFS layout ensures that when you create multiple boot environments, the ''/usr/pbi/'', ''/usr/local/'', ''/usr/home/'', ''/usr/ports/'', ''/usr/src/'' and ''/var/'' directories remain untouched. This way, if you rollback to a previous boot environment, you will not lose data in your home directories, any installed applications, or downloaded src or ports. During installation, you can add additional mount points, just don't delete the default ones.}}

+

{{warning|icon48=For boot environments to work properly, ''' ''do not delete the default ZFS mount points during installation.'' ''' The default ZFS layout ensures that when you create multiple boot environments, the ''/usr/pbi/'', ''/usr/local/'', ''/usr/home/'', ''/usr/ports/'', ''/usr/src/'' and ''/var/'' directories remain untouched. This way, if you rollback to a previous boot environment, you will not lose data in your home directories, any installed applications, or downloaded src or ports. During installation, you can add additional mount points, just don't delete the default ones.}}

=== Managing Boot Environments Using Boot Manager===

=== Managing Boot Environments Using Boot Manager===

−

To create and manager boot environments using a graphical interface, go to Control Panel ➜ Boot Manager or type '''pc-su pc-bootconfig'''. You will be prompted to enter your password.

+

To create and manage boot environments using a graphical interface, go to Control Panel ➜ Boot Manager or type '''pc-su pc-bootconfig'''. You will be prompted to enter your password.

−

During installation, PC-BSD® creates a boot environment named ''default''. As seen in Figure 8.4a, an entry for this boot environment will be displayed in the Boot Manager screen.

+

During installation, PC-BSD® creates a boot environment named ''default''. As seen in Figure 8.5a, an entry for this boot environment will be displayed in the Boot Manager screen.

Anything outside of the ''default'' dataset will not be included in the boot environment. To ensure that the files that the operating system needs are included when the system boots, all boot environments include ''/usr'', ''/usr/local'', and ''/var''. User-specific data is ''' ''not'' ''' included in the boot environment. This means that ''/usr/home'', ''/usr/jails'', ''/var/log'', ''/var/tmp'', and ''/var/audit'' will not change, regardless of which boot environment is selected at system boot.

Anything outside of the ''default'' dataset will not be included in the boot environment. To ensure that the files that the operating system needs are included when the system boots, all boot environments include ''/usr'', ''/usr/local'', and ''/var''. User-specific data is ''' ''not'' ''' included in the boot environment. This means that ''/usr/home'', ''/usr/jails'', ''/var/log'', ''/var/tmp'', and ''/var/audit'' will not change, regardless of which boot environment is selected at system boot.

Line 32:

Line 32:

'''Copy:''' creates a copy of an existing boot environment.

'''Copy:''' creates a copy of an existing boot environment.

−

'''Rename:''' used to rename the highlighted boot environment. The name is what appears in the boot menu when the system boots.

+

'''Rename:''' used to rename the highlighted boot environment. The name is what appears in the boot menu when the system boots. You cannot rename the BE you are currently booted into and an error message will occur if you try to do so.

'''Activate:''' tells the system to boot into the highlighted boot environment at next system boot. The ''Default'' will change to ''Yes'', but the ''Running'' will remain the same. In other words, ''Running'' refers to the boot environment the system last booted into (is currently running from) whereas ''Default'' indicates which boot environment the system will boot into at next system boot.

'''Activate:''' tells the system to boot into the highlighted boot environment at next system boot. The ''Default'' will change to ''Yes'', but the ''Running'' will remain the same. In other words, ''Running'' refers to the boot environment the system last booted into (is currently running from) whereas ''Default'' indicates which boot environment the system will boot into at next system boot.

−

If you create any boot environments, a boot menu similar to the one seen in Figure 8.4b will appear for five seconds during system boot. The menu contains the names of the boot environments and the date each was created. If you don't make a selection, the system will automatically boot into either the last "Running" boot environment or, if you have activated another boot environment, the environment that was set as the "Default".

+

If you create any boot environments, a boot menu similar to the one seen in Figure 8.5b will appear for five seconds during system boot. The menu contains the names of the boot environments and the date each was created. If you don't make a selection, the system will automatically boot into either the last "Running" boot environment or, if you have activated another boot environment, the environment that was set as the "Default".

* '''Font File:''' before a font can be used in the GRUB menu, it must first be converted to ''.pf2'' format using the grub-mkfont(1) command.

* '''Font File:''' before a font can be used in the GRUB menu, it must first be converted to ''.pf2'' format using the grub-mkfont(1) command.

−

* '''Timer:''' sets the delay time for accessing the GRUB menu. By default it is 2 seconds, so if you find that the time to access the menu goes by too quickly, increase this timer.

+

* '''Timer:''' sets the delay time for accessing the GRUB menu. By default it is 2 seconds, so if you find that the time to access the menu goes by too quickly, increase this timer. If you would like the graphical PC-BSD® bootloader menu to be displayed during boot, check the box “Show Timer Countdown”.

* '''Custom Entries:''' if you have an existing GRUB configuration that you would like to add to the menu, cut and paste it into the box. Refer to the {{citelink|url=http://www.gnu.org/software/grub/manual/grub.html|txt=GRUB Manual}} for more information on creating a custom GRUB configuration.

* '''Custom Entries:''' if you have an existing GRUB configuration that you would like to add to the menu, cut and paste it into the box. Refer to the {{citelink|url=http://www.gnu.org/software/grub/manual/grub.html|txt=GRUB Manual}} for more information on creating a custom GRUB configuration.

−

If you make any changes in this tab, the two buttons below "Settings" or "Custom Entries" will be activated. Use them to save your changes and to re-load the GRUB configuration. If you forget to do so, a pop-up message will remind you that you have unsaved changes when you exit Boot Manager. If you do not save the changes, the boot menu will remain the same.

+

If you make any changes in this tab, the two buttons below "Settings" or "Custom Entries" will be activated. Use them to save your changes or to re-load the GRUB configuration. If you forget to do so, a pop-up message will remind you that you have unsaved changes when you exit Boot Manager. If you do not save the changes using these buttons, the boot menu will remain the same.

=== Managing Boot Environments From the Command Line ===

=== Managing Boot Environments From the Command Line ===

Line 60:

Line 60:

If you are running TrueOS® or prefer to use the command line, you can manage boot environments using the '''beadm''' command as the superuser. For example, this command creates a boot environment named ''beforeupgrade'':

If you are running TrueOS® or prefer to use the command line, you can manage boot environments using the '''beadm''' command as the superuser. For example, this command creates a boot environment named ''beforeupgrade'':

−

{{txtbox|box='''beadm create beforeupgrade'''{{nbsp|45}}

+

{{txtbox|box='''beadm create beforeupgrade'''{{nbsp|45}}<nowiki>

−

Created successfully}}

+

GRUB configuration updated successfully

+

Created successfully</nowiki>}}

To view all boot environments, use the '''list''' command:

To view all boot environments, use the '''list''' command:

−

{{txtbox|box='''beadm list'''{{nbsp|70}}

+

{{txtbox|box='''beadm list'''{{nbsp|70}}<nowiki>

−

BE Active Mountpoint Space Policy Created

+

BE Active Mountpoint Space Created

−

default NR / 6.05G static 2013-08-23 09:03

+

default NR / 9.1G 2013-12-05 09:03

−

beforeupgrade - - 1K static 2013-08-27 10:14}}

+

beforeupgrade - - 2.1M 2013-12-06 10:14</nowiki>}}

The possible flags in the "Active" field are as follows:

The possible flags in the "Active" field are as follows:

Line 80:

Line 81:

In this example, the current boot environment is called ''default'', it is active now, will be used at next reboot, and it is mounted. The newly created ''beforeupgrade'' boot environment exists, but is inactive and unmounted. To activate the new boot environment:

In this example, the current boot environment is called ''default'', it is active now, will be used at next reboot, and it is mounted. The newly created ''beforeupgrade'' boot environment exists, but is inactive and unmounted. To activate the new boot environment:

−

{{txtbox|box='''beadm activate beforeupgrade'''{{nbsp|52}}

+

{{txtbox|box='''beadm activate beforeupgrade'''{{nbsp|52}}<nowiki>

Activated successfully

Activated successfully

'''beadm list'''

'''beadm list'''

−

BE Active Mountpoint Space Policy Created

+

BE Active Mountpoint Space Created

−

default N / 64.5K static 2013-08-23 09:03

+

default N / 3.1M 2013-12-05 09:03

−

beforeupgrade R - 6.05G static 2013-08-27 10:14}}

+

beforeupgrade R - 9.1G 2013-12-06 10:14</nowiki>}}

+

The flags now indicate that the system is currently booted into ''default'', but at next boot the system will boot into ''beforeupgrade''.

The flags now indicate that the system is currently booted into ''default'', but at next boot the system will boot into ''beforeupgrade''.

Line 91:

Line 93:

The boot menu configuration can be found in the ASCII text file ''/usr/local/etc/default/grub'':

The boot menu configuration can be found in the ASCII text file ''/usr/local/etc/default/grub'':

Latest revision as of 11:46, 9 January 2014

Boot ManagerProtection (edit): Edited by: FuzzyBot

PC-BSD® supports a feature of ZFS known as multiple boot environments (BEs). With multiple boot environments, the process of updating software becomes a low-risk operation as you can backup your current boot environment before upgrading or making software updates to your system. If needed, you also have the option of booting into a backup boot environment. For example:

if you are making software changes to a boot environment, you can take a snapshot of that environment at any stage during the modifications.

you can save multiple boot environments on your system and perform various updates on each of them as needed. You can install, test, and update different software packages on each.

you can mount a boot environment in order to chroot into the mount point and update specific packages on the mounted environment.

you can move a boot environment to another machine, physical or virtual, in order to check hardware support.

For boot environments to work properly, do not delete the default ZFS mount points during installation. The default ZFS layout ensures that when you create multiple boot environments, the /usr/pbi/, /usr/local/, /usr/home/, /usr/ports/, /usr/src/ and /var/ directories remain untouched. This way, if you rollback to a previous boot environment, you will not lose data in your home directories, any installed applications, or downloaded src or ports. During installation, you can add additional mount points, just don't delete the default ones.

To create and manage boot environments using a graphical interface, go to Control Panel ➜ Boot Manager or type pc-su pc-bootconfig. You will be prompted to enter your password.

During installation, PC-BSD® creates a boot environment named default. As seen in Figure 8.5a, an entry for this boot environment will be displayed in the Boot Manager screen.

Figure 8.5a: Managing Boot Environments

Anything outside of the default dataset will not be included in the boot environment. To ensure that the files that the operating system needs are included when the system boots, all boot environments include /usr, /usr/local, and /var. User-specific data is not included in the boot environment. This means that /usr/home, /usr/jails, /var/log, /var/tmp, and /var/audit will not change, regardless of which boot environment is selected at system boot.

From top to bottom, the icons on the far left are used to:

Create: a new boot environment. You should do this before making any changes to the system that may impact on your current boot environment. You will be prompted for a name which can only contain letters or numbers. Once you click OK, the system will create the environment, then add it to the list of boot environments.

Remove: will delete the highlighted boot environment. You can not delete the boot environment which has a Running status of Yes as that is the current boot environment.

Copy: creates a copy of an existing boot environment.

Rename: used to rename the highlighted boot environment. The name is what appears in the boot menu when the system boots. You cannot rename the BE you are currently booted into and an error message will occur if you try to do so.

Activate: tells the system to boot into the highlighted boot environment at next system boot. The Default will change to Yes, but the Running will remain the same. In other words, Running refers to the boot environment the system last booted into (is currently running from) whereas Default indicates which boot environment the system will boot into at next system boot.

If you create any boot environments, a boot menu similar to the one seen in Figure 8.5b will appear for five seconds during system boot. The menu contains the names of the boot environments and the date each was created. If you don't make a selection, the system will automatically boot into either the last "Running" boot environment or, if you have activated another boot environment, the environment that was set as the "Default".

Figure 8.5b: Boot Menu Shows Created Boot Environments

To customize this menu, click the "Grub Configuration" tab to see the screen seen in Figure 8.5c.

Font File: before a font can be used in the GRUB menu, it must first be converted to .pf2 format using the grub-mkfont(1) command.

Timer: sets the delay time for accessing the GRUB menu. By default it is 2 seconds, so if you find that the time to access the menu goes by too quickly, increase this timer. If you would like the graphical PC-BSD® bootloader menu to be displayed during boot, check the box “Show Timer Countdown”.

Custom Entries: if you have an existing GRUB configuration that you would like to add to the menu, cut and paste it into the box. Refer to the GRUB Manual[3] for more information on creating a custom GRUB configuration.

If you make any changes in this tab, the two buttons below "Settings" or "Custom Entries" will be activated. Use them to save your changes or to re-load the GRUB configuration. If you forget to do so, a pop-up message will remind you that you have unsaved changes when you exit Boot Manager. If you do not save the changes using these buttons, the boot menu will remain the same.

If you are running TrueOS® or prefer to use the command line, you can manage boot environments using the beadm command as the superuser. For example, this command creates a boot environment named beforeupgrade:

In this example, the current boot environment is called default, it is active now, will be used at next reboot, and it is mounted. The newly created beforeupgrade boot environment exists, but is inactive and unmounted. To activate the new boot environment: