Benutzer Diskussion:Matthias Jakobi: Unterschied zwischen den Versionen

Aus Wiki StuRa HTW Dresden
Zur Navigation springen Zur Suche springen
Zeile 3: Zeile 3:
* [[Server]]
* [[Server]]
* [[Diskussion:Server]]
* [[Diskussion:Server]]
* [[Datenkultur]]
* [[Server/Bacula]]
* [[Server/Bacula]]
* [[Server/Dokumentation]]
* [[Server/Dokumentation]]

Version vom 29. Februar 2012, 01:04 Uhr

Beobachtungsseiten

weitere Admins

Benutzer:JohannesSchneemann

Laptop

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-RELEASE . Below is just a simple example ; there will be one ZFS filesystem on /, 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 ada0s1a- slice will be used for swap 4G ada0s1b - slice will be used for boot 1G ada0s1d - slice will be used for ZFS 51G (crypto)

gpart create -s MBR ada0
gpart add -t freebsd -s 56G ada0
gpart create -s BSD ada0s1
gpart add -t freebsd-swap -s 4G ada0s1
gpart add -t freebsd-ufs -s 1G ada0s1
gpart add -t freebsd-zfs ada0s1

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/ada0s1b dd if=/dev/urandom of=/dev/ada0p4

3. bsdlabeling: Code:

bsdlabel -w /dev/ada0s1d

4. Loading the required modules: Code:

kldload geom_eli zfs

5. Labeling partition: Code:

glabel label zrpool /dev/ada0s1d

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/ada0p3 newfs /dev/ada0s3

10. Copying /boot to ada0p3: Code:

mkdir /tmp/boot mount /dev/ada0p3 /tmp/boot cp -Rp /mnt/boot /tmp/boot/

11. Creation fstab and loader.conf: a) create /tmp/boot/boot/loader.conf and add the following lines: Code:

geom_eli_load="YES" zfs_load="YES"

  1. aesni_load="YES" # option see man aesni

vfs.root.mountfrom="zfs:zrpool/FreeBSD"

b) create /mnt/etc/fstab: Code:

  1. cat > /mnt/etc/fstab

/dev/ada0p4 / zfs rw 0 0 /dev/ada0p3 /boot ufs rw 0 0 /dev/ada0p2 swap sw 0 0

12. Generation and recording zpool.cache to /boot stick: Code:

zpool export zrpool zpool import -o cachefile=/tmp/boot/boot/zfs/zpool.cache zrpool

13. Change pool mountpoint to / Code:

zfs set mountpoint=/ zrpool

14. Finish. Code:

shutdown -r now