Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »


Image result for page under construction

Boot a Cento 7 Live DVD


Install ZFS
yum -y install
sed -i -e '/\[zfs\]/,/^\[/s/enabled=1/enabled=0/' /etc/yum.repos.d/zfs.repo
sed -i -e '/\[zfs-kmod\]/,/^\[/s/enabled=0/enabled=1/' /etc/yum.repos.d/zfs.repo
yum -y install zfs zfs-dracut pigz 
modprobe zfs

Create /etc/zfs/vdev_id.conf with the following contents:

udevadm trigger

Partition the SSDs

sgdisk -a1 -n2:34:2047  -t2:EF02 /dev/disk/by-vdev/ssd1
sgdisk     -n9:-8M:0    -t9:BF07 /dev/disk/by-vdev/ssd1
# rpool
sgdisk     -n1:0:40G    -t1:BF01 /dev/disk/by-vdev/ssd1
# cache
sgdisk     -n3:0:+40G   -t3:BF01 /dev/disk/by-vdev/ssd1
# swap
sgdisk     -n4:0:+8G    -t4:8200 /dev/disk/by-vdev/ssd1
sgdisk -a1 -n2:34:2047  -t2:EF02 /dev/disk/by-vdev/ssd2
sgdisk     -n9:-8M:0    -t9:BF07 /dev/disk/by-vdev/ssd2
# rpool
sgdisk     -n1:0:40G    -t1:BF01 /dev/disk/by-vdev/ssd2
# cache
sgdisk     -n3:0:+40G   -t3:BF01 /dev/disk/by-vdev/ssd2
# swap
sgdisk     -n4:0:+8G    -t4:8200 /dev/disk/by-vdev/ssd2


Create rpool

Create rpool
zpool create -f -d \
	-o feature@async_destroy=enabled \
	-o feature@empty_bpobj=enabled \
	-o feature@lz4_compress=enabled \
	-o ashift=12 \
	-O compression=lz4 \
	-O canmount=off \
	-O mountpoint=/ \
	-R /mnt/rpool \
	rpool \
	mirror /dev/disk/by-vdev/ssd1-part1 /dev/disk/by-vdev/ssd2-part1

Populate rpool from image

Substitute URL as necessary:

wget -qO- "" | unpigz | zfs receive -vF rpool

Remount in proper order

zfs umount -a && rm -rf /mnt/rpool
zfs mount rpool/ROOT/centos
zfs mount -a

Prepare rpool for new host

for dir in proc sys dev;do mount --rbind /$dir /mnt/rpool/$dir;done
chroot /mnt/rpool /bin/bash --login
cd /dev;ln -s /dev/disk/by-vdev/* .;cd
rm /etc/zfs/zpool.cache
zpool set cachefile=/etc/zfs/zpool.cache rpool
grub2-mkconfig -o /boot/grub2/grub.cfg
grep ROOT /boot/grub2/grub.cfg
grub2-install /dev/disk/by-vdev/ssd1
grub2-install /dev/disk/by-vdev/ssd2





Setup Nagios Monitoring: 

  • No labels