Difference between revisions of "Boot Manager/9.2"

From PC-BSD Wiki
Jump to: navigation, search
(Marked this version for translation)
(13 intermediate revisions by one user not shown)
Line 20: Line 20:
  
 
<!--T:9-->
 
<!--T:9-->
{{warning|icon64=For boot environments to work properly, ''' ''do not change the default ZFS layout 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.}}
+
{{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.}}
  
=== Managing Boot Environments Using Boot Manager===
+
=== Managing Boot Environments Using Boot Manager=== <!--T:28-->
  
 +
<!--T:29-->
 
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 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.
  
 +
<!--T:30-->
 
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.4a, an entry for this boot environment will be displayed in the Boot Manager screen.   
  
 +
<!--T:31-->
 
'''Figure 8.4a: Managing Boot Environments'''
 
'''Figure 8.4a: Managing Boot Environments'''
  
 +
<!--T:32-->
 
[[File:Boot1.png]]
 
[[File:Boot1.png]]
  
 +
<!--T:33-->
 +
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.
 +
 +
<!--T:34-->
 
From top to bottom, the icons on the far left are used to:
 
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. Once you click OK, the system will create the environment, then add it to the list of boot environments. Its ''Running'' status will show as ''No'', until you activate it. Regardless of the number of boot environments, only one will have a ''Running'' status of ''Yes''.
+
<!--T:35-->
 +
'''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. 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''.
+
<!--T:36-->
 +
'''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.
  
 +
<!--T:37-->
 
'''Copy:''' makes a mountable copy? of the
 
'''Copy:''' makes a mountable copy? of the
  
'''Rename:'''
+
<!--T:38-->
 +
'''Rename:''' used to rename the highlighted boot environment. The name is what appears in the boot menu when the system boots.
  
'''Activate:'''
+
<!--T:39-->
 +
'''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.
  
'''Figure 8.4b: Managing GRUB Configuration'''
+
<!--T:40-->
 +
If you create any boot environments, a boot menu similar to the one seen in Figure 8.4b will appear if you press any key 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".
  
 +
<!--T:41-->
 +
'''Figure 8.4b: Boot Menu Shows Created Boot Environments'''
 +
 +
<!--T:42-->
 +
[[File:Boot4.png]]
 +
 +
<!--T:43-->
 +
To customize this menu, click the "Grub Configuration" tab to see the screen seen in Figure 8.4c.
 +
 +
<!--T:44-->
 +
'''Figure 8.4c: Managing GRUB Configuration'''
 +
 +
<!--T:45-->
 
[[File:Boot3.png]]
 
[[File:Boot3.png]]
  
 
=== Managing Boot Environments From the Command Line === <!--T:10-->
 
=== Managing Boot Environments From the Command Line === <!--T:10-->
  
<!--T:11-->
+
<!--T:46-->
Boot environments are managed with the '''beadm''' command which must be run as the superuser. The following example creates a BE named ''beforeupgrade''. The new BE is a clone of the current BE, the ZFS environment that you booted into.
+
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'':
  
 
<!--T:12-->
 
<!--T:12-->
{{txtbox|box='''beadm create beforeupgrade'''
+
'''beadm create beforeupgrade'''
Created successfully}}
+
Created successfully
  
 
<!--T:13-->
 
<!--T:13-->
To view all BEs, use the '''list''' command
+
To view all boot environments, use the '''list''' command:
  
 
<!--T:14-->
 
<!--T:14-->
{{txtbox|box='''beadm list'''
+
'''beadm list'''
BE            Active Mountpoint Space Policy Created
+
BE            Active Mountpoint Space Policy Created
default      NR    /          6.05G static 2012-07-09 05:06
+
default      NR    /          6.05G static 2013-08-23 09:03
beforeupgrade -      -            1K static 2012-07-10 12:25
+
beforeupgrade -      -            1K static 2013-08-27 10:14
|txt=
+
 
 +
<!--T:47-->
 
The possible flags in the "Active" field are as follows:
 
The possible flags in the "Active" field are as follows:
  
Line 75: Line 103:
  
 
<!--T:17-->
 
<!--T:17-->
* '''-:''' inactive}}
+
* '''-:''' inactive
  
 
<!--T:18-->
 
<!--T:18-->
In this example, the current BE is called ''default'', it is active now, and at next reboot; and it is mounted. The newly created ''beforeupgrade'' BE exists, but is inactive and unmounted. To activate the new BE:
+
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:
  
 
<!--T:19-->
 
<!--T:19-->
{{txtbox|box='''beadm activate beforeupgrade'''
+
'''beadm activate beforeupgrade'''
Activated successfully
+
Activated successfully
'''beadm list'''
+
'''beadm list'''
BE            Active Mountpoint Space Policy Created
+
BE            Active Mountpoint Space Policy Created
default      N      /          64.5K static 2012-07-09 05:06
+
default      N      /          64.5K static 2013-08-23 09:03
beforeupgrade R      -          6.05G static 2012-07-10 12:25}}
+
beforeupgrade R      -          6.05G static 2013-08-27 10:14
  
 
<!--T:20-->
 
<!--T:20-->
The flags now indicate that the system is currently booted into ''default'', but at next boot the system will boot into ''beforeupgrade''. Only one boot environment can be active at a time.
+
The flags now indicate that the system is currently booted into ''default'', but at next boot the system will boot into ''beforeupgrade''.  
 
+
  
 +
<!--T:48-->
 +
The boot menu configuration can be found in the ASCII text file ''/usr/local/etc/default/grub'':
  
 +
<!--T:49-->
 +
'''more /usr/local/etc/default/grub'''
 +
GRUB_THEME=/boot/grub/themes/pcbsd/theme.txt
 +
GRUB_FONT=/boot/grub/pcbsdfont.pf2
 +
GRUB_HIDDEN_TIMEOUT_QUIET=false
 +
GRUB_TIMEOUT=2
 +
GRUB_DEFAULT=1
  
 
<!--T:6-->
 
<!--T:6-->

Revision as of 13:21, 27 August 2013

(Sorry for the inconvenience)

Contents

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.


WARNING 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

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.

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.

Figure 8.4a: Managing Boot Environments

Boot1.png

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. 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: makes a mountable copy? of the

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

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 if you press any key 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.4b: Boot Menu Shows Created Boot Environments

Boot4.png

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

Figure 8.4c: Managing GRUB Configuration

Boot3.png

Managing Boot Environments From the Command Line

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:

beadm create beforeupgrade
Created successfully

To view all boot environments, use the list command:

beadm list
BE            Active Mountpoint Space Policy Created
default       NR     /          6.05G static 2013-08-23 09:03
beforeupgrade -      -             1K static 2013-08-27 10:14

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

  • R: active on reboot
  • N: active now
  • -: inactive

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:

beadm activate beforeupgrade
Activated successfully
beadm list
BE            Active Mountpoint Space Policy Created
default       N      /          64.5K static 2013-08-23 09:03
beforeupgrade R      -          6.05G static 2013-08-27 10:14

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

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

more /usr/local/etc/default/grub
GRUB_THEME=/boot/grub/themes/pcbsd/theme.txt
GRUB_FONT=/boot/grub/pcbsdfont.pf2
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=2
GRUB_DEFAULT=1

References


Other languages:German 9% • ‎English 100% • ‎French 20%