Benutzer Diskussion:Matthias Jakobi: Unterschied zwischen den Versionen

Aus Wiki StuRa HTW Dresden
Zur Navigation springen Zur Suche springen
Zeile 30: Zeile 30:
[[Benutzer:JohannesSchneemann]]
[[Benutzer:JohannesSchneemann]]


== Labtop ==
== 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-RC1 .
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 /, no swap, no keys for GELI, passphrase only. Nevertheless, I decided to share the method which can be used in different setups and configurations.
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:
My setup consists of:
ada0 - hard drive
ada0 - hard drive
ada0s1 - slice will be used for boot 1G
ada0s1a- slice will be used for swap 4G
ada0s2 - slice will be used for swap 4G
ada0s1b - slice will be used for boot 1G
ada0s3 - slice will be used for ZFS  50G
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.
1. Boot with your FreeBSD install disk and choose “Live CD” when prompted, login as root, no password is required.
Zeile 45: Zeile 52:
Code:
Code:


dd if=/dev/urandom of=/dev/ada0s1
dd if=/dev/urandom of=/dev/ada0s1b
dd if=/dev/urandom of=/dev/ada0s3
dd if=/dev/urandom of=/dev/ada0p4


3. bsdlabeling:
3. bsdlabeling:
Code:
Code:


bsdlabel -w /dev/ada0s3
bsdlabel -w /dev/ada0s1d


4. Loading the required modules:
4. Loading the required modules:
Zeile 61: Zeile 68:
Code:
Code:


glabel label zrpool /dev/ada0s1a
glabel label zrpool /dev/ada0s1d


6. Initiation and attachment GELI:
6. Initiation and attachment GELI:
Zeile 86: Zeile 93:
Code:
Code:


bsdlabel -B -v /dev/ada0s1
bsdlabel -B -v /dev/ada0p3
newfs /dev/ada0s1a
newfs /dev/ada0s3


10. Copying /boot to ada0s1:
10. Copying /boot to ada0p3:
Code:
Code:


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


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


Zeile 109: Zeile 116:


# cat > /mnt/etc/fstab
# cat > /mnt/etc/fstab
zrpool/FreeBSD / zfs rw 0 0
/dev/ada0p4 / zfs rw 0 0
^D
/dev/ada0p3    /boot ufs rw 0 0
/dev/ada0p2  swap sw 0 0


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


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


13. Change pool mountpoint to /
13. Change pool mountpoint to /

Version vom 2. Februar 2012, 23:18 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