Benutzer Diskussion:Matthias Jakobi: Unterschied zwischen den Versionen
(→ZFS) |
(→Laptop) |
||
Zeile 30: | Zeile 30: | ||
[[Benutzer:JohannesSchneemann]] | [[Benutzer:JohannesSchneemann]] | ||
Greeting, I had a bit time, free slice on the disk with MBR and the desire to play with the new installation of FreeBSD 9.0-RC1 . | |||
Below is just a simple example ; there will be one ZFS filesystem on /, no swap, no keys for GELI, passphrase only. Nevertheless, I decided to share the method which can be used in different setups and configurations. | |||
My setup consists of: | |||
ada0 - hard drive | |||
ada0s1 - slice will be used for boot 1G | |||
ada0s2 - slice will be used for swap 4G | |||
ada0s3 - slice will be used for ZFS 50G | |||
1. Boot with your FreeBSD install disk and choose “Live CD” when prompted, login as root, no password is required. | |||
2. This step is optional but it's a good idea. | |||
Code: | |||
=== | dd if=/dev/urandom of=/dev/ada0s1 | ||
dd if=/dev/urandom of=/dev/ada0s3 | |||
3. bsdlabeling: | |||
Code: | |||
bsdlabel -w /dev/ada0s3 | |||
4. Loading the required modules: | |||
Code: | |||
kldload geom_eli zfs | |||
5. Labeling partition: | |||
Code: | |||
glabel label zrpool /dev/ada0s1a | |||
6. Initiation and attachment GELI: | |||
Code: | |||
geli init -b /dev/label/zrpool | |||
geli attach /dev/label/zrpool | |||
7. Creation ZFS pool and FS: | |||
Code: | |||
zpool create -O mountpoint=/mnt -O canmount=off zrpool /dev/label/zrpool.eli | |||
zfs create -o mountpoint=legacy zrpool/FreeBSD | |||
8. Installation FreeBSD: | |||
Code: | |||
mount -t zfs zrpool/FreeBSD /mnt | |||
tar -xf /usr/freebsd-dist/base.txz -C /mnt | |||
tar -xf /usr/freebsd-dist/kernel.txz -C /mnt | |||
You can select and install something else, please take a look at /usr/freebsd-dist/ | |||
9. ada0s1, preparation: | |||
Code: | |||
bsdlabel -B -v /dev/ada0s1 | |||
newfs /dev/ada0s1a | |||
10. Copying /boot to ada0s1: | |||
Code: | |||
mkdir /tmp/boot | |||
mount /dev/ada0s1 /tmp/boot | |||
cp -Rp /mnt/boot /tmp/boot/ | |||
11. Creation fstab and loader.conf: | |||
a) create /tmp/usbboot/boot/loader.conf and add the following lines: | |||
Code: | |||
geom_eli_load="YES" | |||
zfs_load="YES" | |||
# aesni_load="YES" # option see man aesni | |||
vfs.root.mountfrom="zfs:zrpool/FreeBSD" | |||
b) create /mnt/etc/fstab: | |||
Code: | |||
# cat > /mnt/etc/fstab | |||
zrpool/FreeBSD / zfs rw 0 0 | |||
^D | |||
12. Generation and recording zpool.cache to USB stick: | |||
Code: | |||
zpool export zrpool | |||
zpool import -o cachefile=/tmp/usbboot/boot/zfs/zpool.cache zrpool | |||
13. Change pool mountpoint to / | |||
Code: | |||
zfs set mountpoint=/ zrpool | |||
14. Finish. | |||
Code: | |||
shutdown -r now | |||
Version vom 2. Februar 2012, 21:33 Uhr
Beobachtungsseiten
- Server
- Diskussion:Server
- Server/Bacula
- Server/Dokumentation
- Diskussion:Server/Dokumentation
- Server/Hauptsystem
- Server/mailman
- Jail/SRS1 Plone 4
- Jail/SRS3 Samba
- Jail/SRS4 Plone (old)
- Jail/SRS5 Wikis
- Jail/SRS6 Umfragen
- Jail/SRS8 Test
- Jail/SRS13 Awesome Jail
- Jail/SRS21 Mail
- Website
- Diskussion:Website
- Notfallmanagment
- Datensicherung
- Bereich Administration Rechentechnik/zu erledigende Dinge
- Bereich Administration Website/zu erledigende Dinge
- Bereich Administration Wiki/zu erledigende Dinge
- PyConDE
- Doktorandenstammtisch
- FreeBSD/ThinkPad
weitere Admins
Greeting, I had a bit time, free slice on the disk with MBR and the desire to play with the new installation of FreeBSD 9.0-RC1 . Below is just a simple example ; there will be one ZFS filesystem on /, no swap, no keys for GELI, passphrase only. Nevertheless, I decided to share the method which can be used in different setups and configurations.
My setup consists of: ada0 - hard drive ada0s1 - slice will be used for boot 1G ada0s2 - slice will be used for swap 4G ada0s3 - slice will be used for ZFS 50G
1. Boot with your FreeBSD install disk and choose “Live CD” when prompted, login as root, no password is required. 2. This step is optional but it's a good idea. Code:
dd if=/dev/urandom of=/dev/ada0s1 dd if=/dev/urandom of=/dev/ada0s3
3. bsdlabeling: Code:
bsdlabel -w /dev/ada0s3
4. Loading the required modules: Code:
kldload geom_eli zfs
5. Labeling partition: Code:
glabel label zrpool /dev/ada0s1a
6. Initiation and attachment GELI: Code:
geli init -b /dev/label/zrpool geli attach /dev/label/zrpool
7. Creation ZFS pool and FS: Code:
zpool create -O mountpoint=/mnt -O canmount=off zrpool /dev/label/zrpool.eli zfs create -o mountpoint=legacy zrpool/FreeBSD
8. Installation FreeBSD: Code:
mount -t zfs zrpool/FreeBSD /mnt tar -xf /usr/freebsd-dist/base.txz -C /mnt tar -xf /usr/freebsd-dist/kernel.txz -C /mnt
You can select and install something else, please take a look at /usr/freebsd-dist/ 9. ada0s1, preparation: Code:
bsdlabel -B -v /dev/ada0s1 newfs /dev/ada0s1a
10. Copying /boot to ada0s1: Code:
mkdir /tmp/boot mount /dev/ada0s1 /tmp/boot cp -Rp /mnt/boot /tmp/boot/
11. Creation fstab and loader.conf: a) create /tmp/usbboot/boot/loader.conf and add the following lines: Code:
geom_eli_load="YES" zfs_load="YES"
- aesni_load="YES" # option see man aesni
vfs.root.mountfrom="zfs:zrpool/FreeBSD"
b) create /mnt/etc/fstab: Code:
- cat > /mnt/etc/fstab
zrpool/FreeBSD / zfs rw 0 0 ^D
12. Generation and recording zpool.cache to USB stick: Code:
zpool export zrpool zpool import -o cachefile=/tmp/usbboot/boot/zfs/zpool.cache zrpool
13. Change pool mountpoint to / Code:
zfs set mountpoint=/ zrpool
14. Finish. Code:
shutdown -r now