root/manageBE/example.txt

Revision 32, 5.1 KB (checked in by cryx, 8 months ago)

A small example how stuff works.

Line 
1zfsbsd# uname -rs
2FreeBSD 7.2-STABLE
3
4Lets take a look at our zfs-root setup.
5
6zfsbsd# zpool status
7  pool: rpool
8 state: ONLINE
9 scrub: none requested
10config:
11
12        NAME        STATE     READ WRITE CKSUM
13        rpool       ONLINE       0     0     0
14          ad0p3     ONLINE       0     0     0
15
16errors: No known data errors
17
18zfsbsd# zfs list -t all
19NAME                     USED  AVAIL  REFER  MOUNTPOINT
20rpool/ROOT               252M  6.89G    20K  /rpool/ROOT
21rpool/ROOT/oldBE         252M  6.89G   252M  /rpool/ROOT/oldBE
22rpool/ROOT/oldBE@oldBE   287K      -   252M  -
23rpool/tmp                 29K  6.89G    29K  /tmp
24rpool/usr-local         1.66M  6.89G  1.66M  /usr/local
25rpool/var               81.9M  6.89G  81.9M  /var
26
27Our current boot-environment is called "oldBE" and is mounted on /.
28
29zfsbsd# manageBE list
30Poolname: rpool
31BE    Active Active Mountpoint        Space
32Name  Now    Reboot -                 Used
33----  ------ ------ ----------        -----
34oldBE yes    yes    /rpool/ROOT/oldBE  252M
35
36zfsbsd# mount
37rpool/ROOT/oldBE on / (zfs, local)
38devfs on /dev (devfs, local)
39rpool on /rpool (zfs, local)
40rpool/ROOT on /rpool/ROOT (zfs, local)
41rpool/tmp on /tmp (zfs, local)
42rpool/usr-local on /usr/local (zfs, local)
43rpool/var on /var (zfs, local)
44
45Lets create a new boot-environment "newBE" using the old boot-environment "oldBE" as source, thus including all the files.
46
47zfsbsd# manageBE create
48Usage: manageBE create -n <newBE> -s <sourceBE> -p <pool>
49
50zfsbsd# manageBE create -n newBE -s oldBE -p rpool
51Install new kernel with option 'DESTDIR=/rpool/ROOT/newBE/' and run 'manageBE activate -n newBE -p rpool'
52
53The new boot-environment was created, it is not yet activated but mounted on "/rpool/ROOT/newBE/"
54
55zfsbsd# manageBE list
56Poolname: rpool
57BE    Active Active Mountpoint        Space
58Name  Now    Reboot -                 Used
59----  ------ ------ ----------        -----
60newBE no     no     /rpool/ROOT/newBE     0
61oldBE yes    yes    /rpool/ROOT/oldBE  252M
62
63zfsbsd# mount
64rpool/ROOT/oldBE on / (zfs, local)
65devfs on /dev (devfs, local)
66rpool on /rpool (zfs, local)
67rpool/ROOT on /rpool/ROOT (zfs, local)
68rpool/ROOT/newBE on /rpool/ROOT/newBE (zfs, local)
69rpool/tmp on /tmp (zfs, local)
70rpool/usr-local on /usr/local (zfs, local)
71rpool/var on /var (zfs, local)
72
73Now you could do a "freebsd-update -b /rpool/ROOT/newBE" or "make installkernel DESTDIR=/rpool/ROOT/newBE/".
74
75After that, we activate the new boot-environment too boot from it.
76
77zfsbsd# manageBE activate -n newBE -p rpool
78
79We can see that it is activated on the next reboot.
80
81zfsbsd# manageBE list
82Poolname: rpool
83BE    Active Active Mountpoint        Space
84Name  Now    Reboot -                 Used
85----  ------ ------ ----------        -----
86newBE no     yes    /rpool/ROOT/newBE  252M
87oldBE yes    no     /rpool/ROOT/oldBE  252M
88
89Lets fire it up!
90
91zfsbsd# reboot
92
93After the reboot.
94
95zfsbsd# uname -rs
96FreeBSD 7.2-STABLE
97
98Now the new boot-environment is enable and in use, the old is mounted but not in use anymore.
99
100zfsbsd# manageBE list
101Poolname: rpool
102BE    Active Active Mountpoint        Space
103Name  Now    Reboot -                 Used
104----  ------ ------ ----------        -----
105newBE yes    yes    /rpool/ROOT/newBE  253M
106oldBE no     no     /rpool/ROOT/oldBE  383K
107
108zfsbsd# mount
109rpool/ROOT/newBE on / (zfs, local)
110rpool/ROOT on /rpool/ROOT (zfs, local)
111rpool/ROOT/oldBE on /rpool/ROOT/oldBE (zfs, local)
112rpool/tmp on /tmp (zfs, local)
113rpool/usr-local on /usr/local (zfs, local)
114rpool/var on /var (zfs, local)
115
116zfsbsd# zfs list -t all
117NAME                     USED  AVAIL  REFER  MOUNTPOINT
118rpool/ROOT               253M  6.89G    21K  /rpool/ROOT
119rpool/ROOT/newBE         253M  6.89G   252M  /rpool/ROOT/newBE
120rpool/ROOT/newBE@oldBE   391K      -   252M  -
121rpool/ROOT/newBE@newBE   185K      -   252M  -
122rpool/ROOT/oldBE         383K  6.89G   252M  /rpool/ROOT/oldBE
123rpool/tmp                 29K  6.89G    29K  /tmp
124rpool/usr-local         1.66M  6.89G  1.66M  /usr/local
125rpool/var               81.9M  6.89G  81.9M  /var
126
127Lets get rid of the old boot-environment if we don't need it anymore.
128
129zfsbsd# manageBE delete
130Usage: manageBE delete -n <BE> -p <pool> -o [yes|no]
131
132The -o option deletes the snapshot the old boot-environment is depending on too.
133
134zfsbsd# manageBE delete -n oldBE -p rpool -o yes
135
136Yep its gone.
137
138zfsbsd# zfs list -t all
139NAME                     USED  AVAIL  REFER  MOUNTPOINT
140rpool/ROOT               253M  6.89G    19K  /rpool/ROOT
141rpool/ROOT/newBE         253M  6.89G   252M  /rpool/ROOT/newBE
142rpool/ROOT/newBE@oldBE   706K      -   252M  -
143rpool/tmp                 29K  6.89G    29K  /tmp
144rpool/usr-local         1.66M  6.89G  1.66M  /usr/local
145rpool/var               81.9M  6.89G  81.9M  /var
146
147zfsbsd# manageBE list
148Poolname: rpool
149BE    Active Active Mountpoint        Space
150Name  Now    Reboot -                 Used
151----  ------ ------ ----------        -----
152newBE yes    yes    /rpool/ROOT/newBE  253M
153
154zfsbsd# mount
155rpool/ROOT/newBE on / (zfs, local)
156devfs on /dev (devfs, local)
157rpool on /rpool (zfs, local)
158rpool/ROOT on /rpool/ROOT (zfs, local)
159rpool/tmp on /tmp (zfs, local)
160rpool/usr-local on /usr/local (zfs, local)
161rpool/var on /var (zfs, local)
Note: See TracBrowser for help on using the browser.