source: manageBE/example.txt

Last change on this file was 136, checked in by cryx, 11 months ago

undo escape stuff

  • Property svn:mime-type set to text/plain
File size: 5.1 KB
Line 
1zfsbsd# uname -rs
2FreeBSD 8.1-RELEASE
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'
52Or make a complete FreeBSD update with 'manageBE src-upgrade -n newBE -p rpool'
53
54The new boot-environment was created, it is not yet activated but mounted on "/rpool/ROOT/newBE/"
55
56zfsbsd# manageBE list
57Poolname: rpool
58BE    Active Active Mountpoint        Space
59Name  Now    Reboot -                 Used
60----  ------ ------ ----------        -----
61newBE no     no     /rpool/ROOT/newBE     0
62oldBE yes    yes    /rpool/ROOT/oldBE  252M
63
64zfsbsd# mount
65rpool/ROOT/oldBE on / (zfs, local)
66devfs on /dev (devfs, local)
67rpool on /rpool (zfs, local)
68rpool/ROOT on /rpool/ROOT (zfs, local)
69rpool/ROOT/newBE on /rpool/ROOT/newBE (zfs, local)
70rpool/tmp on /tmp (zfs, local)
71rpool/usr-local on /usr/local (zfs, local)
72rpool/var on /var (zfs, local)
73
74Now you could do a "freebsd-update -b /rpool/ROOT/newBE" or "make installkernel DESTDIR=/rpool/ROOT/newBE/".
75
76After that, we activate the new boot-environment too boot from it.
77
78zfsbsd# manageBE activate -n newBE -p rpool
79
80We can see that it is activated on the next reboot.
81
82zfsbsd# manageBE list
83Poolname: rpool
84BE    Active Active Mountpoint        Space
85Name  Now    Reboot -                 Used
86----  ------ ------ ----------        -----
87newBE no     yes    /rpool/ROOT/newBE  252M
88oldBE yes    no     /rpool/ROOT/oldBE  252M
89
90Lets fire it up!
91
92zfsbsd# reboot
93
94After the reboot.
95
96zfsbsd# uname -rs
97FreeBSD 8.1-RELEASE
98
99Now the new boot-environment is enabled and in use, the old is mounted but not in use anymore.
100
101zfsbsd# manageBE list
102Poolname: rpool
103BE    Active Active Mountpoint        Space
104Name  Now    Reboot -                 Used
105----  ------ ------ ----------        -----
106newBE yes    yes    /rpool/ROOT/newBE  253M
107oldBE no     no     /rpool/ROOT/oldBE  383K
108
109zfsbsd# mount
110rpool/ROOT/newBE on / (zfs, local)
111rpool/ROOT on /rpool/ROOT (zfs, local)
112rpool/ROOT/oldBE on /rpool/ROOT/oldBE (zfs, local)
113rpool/tmp on /tmp (zfs, local)
114rpool/usr-local on /usr/local (zfs, local)
115rpool/var on /var (zfs, local)
116
117zfsbsd# zfs list -t all
118NAME                     USED  AVAIL  REFER  MOUNTPOINT
119rpool/ROOT               253M  6.89G    21K  /rpool/ROOT
120rpool/ROOT/newBE         253M  6.89G   252M  /rpool/ROOT/newBE
121rpool/ROOT/newBE@oldBE   391K      -   252M  -
122rpool/ROOT/newBE@newBE   185K      -   252M  -
123rpool/ROOT/oldBE         383K  6.89G   252M  /rpool/ROOT/oldBE
124rpool/tmp                 29K  6.89G    29K  /tmp
125rpool/usr-local         1.66M  6.89G  1.66M  /usr/local
126rpool/var               81.9M  6.89G  81.9M  /var
127
128Lets get rid of the old boot-environment if we don't need it anymore.
129
130zfsbsd# manageBE delete
131Usage: manageBE delete -n <BE> -p <pool> -o [yes|no]
132
133The -o option deletes the snapshot the old boot-environment is depending on too.
134
135zfsbsd# manageBE delete -n oldBE -p rpool -o yes
136
137Yep its gone.
138
139zfsbsd# zfs list -t all
140NAME                     USED  AVAIL  REFER  MOUNTPOINT
141rpool/ROOT               253M  6.89G    19K  /rpool/ROOT
142rpool/ROOT/newBE         253M  6.89G   252M  /rpool/ROOT/newBE
143rpool/ROOT/newBE@oldBE   706K      -   252M  -
144rpool/tmp                 29K  6.89G    29K  /tmp
145rpool/usr-local         1.66M  6.89G  1.66M  /usr/local
146rpool/var               81.9M  6.89G  81.9M  /var
147
148zfsbsd# manageBE list
149Poolname: rpool
150BE    Active Active Mountpoint        Space
151Name  Now    Reboot -                 Used
152----  ------ ------ ----------        -----
153newBE yes    yes    /rpool/ROOT/newBE  253M
154
155zfsbsd# mount
156rpool/ROOT/newBE on / (zfs, local)
157devfs on /dev (devfs, local)
158rpool on /rpool (zfs, local)
159rpool/ROOT on /rpool/ROOT (zfs, local)
160rpool/tmp on /tmp (zfs, local)
161rpool/usr-local on /usr/local (zfs, local)
162rpool/var on /var (zfs, local)
Note: See TracBrowser for help on using the repository browser.