Installation minimal d’un Kimsufi sous FreeBSD 9.1 en full ZFS

Pour bénéficier de tous les avantages du ZFS sur les Kimsufi de chez OVH, il faut passer par une ‘manual install’.

Prérequis :
- réinstaller son Kimsufi tout frais en FreeBSD Standard 9.1 64b (sinon il n’est pas possible de Netbooter la rescue FreeBSD)
- passer en netboot et Booter en mode rescue-pro

Préparation du disque :

# gpart destroy -F ada0
ada0 destroyed
# gpart create -s gpt ada0
ada0 created
# gpart add -s 64K -t freebsd-boot ada0
ada0p1 added
# gpart add -s 4G -t freebsd-swap -l swap ada0
ada0p2 added
# gpart add -t freebsd-zfs -l data ada0
ada0p3 added
# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
bootcode written to ada0
# gpart show
=>        34  3907029101  ada0  GPT  (1.8T)
          34           6        - free -  (3.0k)
          40         128     1  freebsd-boot  (64k)
         168     8388608     2  freebsd-swap  (4.0G)
     8388776  3898640352     3  freebsd-zfs  (1.8T)
  3907029128           7        - free -  (3.5k)

Création du volume ZFS :

# zpool create -f -o altroot=/mnt -o cachefile=/var/tmp/zpool.cache zroot /dev/gpt/data
# zpool export zroot
# zpool import -o altroot=/mnt -o cachefile=/var/tmp/zpool.cache zroot
# zfs create zroot/ROOT
# zfs create -o mountpoint=/ zroot/ROOT/default
# zfs set freebsd:boot-environment=1 zroot/ROOT/default
# zpool set bootfs=zroot/ROOT/default zroot

Récupération système :

# mkdir /root/sets
# mount -t tmpfs -o size=300000000 dummy /root/sets
# cd /root/sets
# ftp ftp.freebsd.org
ftp> cd /pub/FreeBSD/releases/amd64/amd64/9.1-RELEASE
ftp> get base.txz
ftp> get kernel.txz
ftp> ^D
221 Goodbye.

Installation système :

# cat base.txz | tar --unlink -xpJf - -C /mnt
# cat kernel.txz | tar --unlink -xpJf - -C /mnt

Configuration système :

# chroot /mnt
chroot:/ # echo /dev/label/swap none swap sw 0 0 > /etc/fstab
chroot:/ # echo 'zfs_load="YES"' > /boot/loader.conf
chroot:/ # echo 'vfs.root.mountfrom="zfs:zroot/ROOT/default"' >> /boot/loader.conf
chroot:/ # echo 'sshd_enable="YES"' > /etc/rc.conf
chroot:/ # echo 'hostname="dist"' >> /etc/rc.conf
chroot:/ # echo 'ifconfig_re0="DHCP"' >> /etc/rc.conf
chroot:/ # echo 'zfs_enable="YES"' >> /etc/rc.conf
chroot:/ # passwd
Changing local password for root
[...]

Autoriser le ssh root :

chroot:/ # vi /etc/ssh/sshd_config
PermitRootLogin yes
chroot:/ # exit

Placer les points de montages finaux :

# cp /var/tmp/zpool.cache /mnt/boot/zfs/zpool.cache
# zfs umount -a       
# zfs set mountpoint=/zroot zroot
cannot mount '/mnt/zpool': failed to create mountpoint
property may be set but unable to remount filesystem
# zfs set mountpoint=/zroot/ROOT zroot/ROOT
# zfs set mountpoint=legacy zroot/ROOT/default

Boot du système :
Repasser de netboot à boot disque via le manager OVH.

# reboot

Suppression des points de montages inutiles :

root@dist:/root # zfs list
NAME                 USED  AVAIL  REFER  MOUNTPOINT
zroot                629M  1.78T    32K  /zroot
zroot/ROOT           629M  1.78T    31K  /zroot/ROOT
zroot/ROOT/default   629M  1.78T   629M  legacy
root@dist:/root # zfs set mountpoint=none zroot/ROOT
root@dist:/root # zfs set mountpoint=none zroot
Ce poste s’inspire fortement de Installation d’une kimsufi sous FreeBSD en full-ZFS de Frédéric Perrin.
This entry was posted in unix and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

ERROR: si-captcha.php plugin says GD image support not detected in PHP!

Contact your web host and ask them why GD image support is not enabled for PHP.

ERROR: si-captcha.php plugin says imagepng function not detected in PHP!

Contact your web host and ask them why imagepng function is not enabled for PHP.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>