diff options
author | Sven Gothel <[email protected]> | 2019-07-15 00:44:57 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-07-15 00:44:57 +0200 |
commit | 2ceee0f005328272e8d184aaa77d183981741d5e (patch) | |
tree | 95a7af2fe2d861ed39b22ea5d235add6ab9823a6 |
Make Debian ZFS Live ISO Image. Baseline: Debian 10 (Buster) and ZFSonLinux 0.7.13.
31 files changed, 1093 insertions, 0 deletions
diff --git a/doc/DebianStretchRootOnZFS.pdf b/doc/DebianStretchRootOnZFS.pdf Binary files differnew file mode 100644 index 0000000..a38b279 --- /dev/null +++ b/doc/DebianStretchRootOnZFS.pdf diff --git a/scripts/apt-preferences.d-local-pin-init b/scripts/apt-preferences.d-local-pin-init new file mode 100644 index 0000000..13982b2 --- /dev/null +++ b/scripts/apt-preferences.d-local-pin-init @@ -0,0 +1,8 @@ +Package: zfs-zed zfs-initramfs zfsutils-linux zfs-dkms libzfs2linux libzpool2linux libuutil1linux libnvpair1linux spl spl-dkms +Pin: version * +Pin-Priority: -1 + +Package: libzfs2-devel zfs-initramfs zfs zfs-dkms libzfs2 libzpool2 libuutil1 libnvpair1 spl spl-dkms zfs-dracut zfs-test +Pin: version * +Pin-Priority: -1 + diff --git a/scripts/deblive01.sh b/scripts/deblive01.sh new file mode 100644 index 0000000..e8a2e91 --- /dev/null +++ b/scripts/deblive01.sh @@ -0,0 +1,41 @@ +#! /bin/sh + +. ./settings00.sh + +rm -rf $LIVEROOT +mkdir -p $LIVECHROOT + +(cd $LIVECHROOT && \ + tar --xattrs -xapf $STRAPBALL +) + +echo "127.0.1.1 $MYHOSTNAME" >> $LIVECHROOT/etc/hosts +#or if the system has a real name in DNS: +#echo "127.0.1.1 $MYFQDN $MYHOSTNAME" >> $LIVECHROOT/etc/hosts + +# Using NetworkManager should not require this +#mv $LIVECHROOT/etc/resolv.conf $LIVECHROOT/etc/resolv.conf-orig +#cat /etc/resolv.conf > $LIVECHROOT/etc/resolv.conf + +mount --rbind /dev $LIVECHROOT/dev +mount --rbind /proc $LIVECHROOT/proc +mount --rbind /sys $LIVECHROOT/sys +mount --make-rslave $LIVECHROOT/dev +mount --make-rslave $LIVECHROOT/proc +mount --make-rslave $LIVECHROOT/sys +echo umount -R $LIVECHROOT/dev +echo umount -R $LIVECHROOT/proc +echo umount -R $LIVECHROOT/sys +echo "cat /proc/mounts | awk '{print $2}' | grep "^$LIVECHROOT" | sort -r | xargs umount" + +mkdir -p $LIVECHROOT/root +cp -a ../../zfs $LIVECHROOT/root + +mkdir -p $LIVECHROOT/root/debian +cp -a ../../debian/packages $LIVECHROOT/root/debian/ + +mkdir -p $LIVECHROOT/root/.ssh +cp -a /home/$MYUSERNAME/.ssh/authorized_keys $LIVECHROOT/root/.ssh/ + +echo RUN: chroot $LIVECHROOT /bin/bash --login + diff --git a/scripts/deblive02.sh b/scripts/deblive02.sh new file mode 100644 index 0000000..29ff693 --- /dev/null +++ b/scripts/deblive02.sh @@ -0,0 +1,22 @@ +#! /bin/sh + +. ./settings00.sh + +chown -R root:root /root/.ssh + +apt-get install --yes \ + live-boot \ + xserver-xorg-core xserver-xorg xinit xterm \ + kde-plasma-desktop kde-baseapps kate okular kdeadmin kdenetwork plasma-nm kdeutils kde-style-breeze \ + kdeconnect kdiff3 krdc partitionmanager ksystemlog \ + firefox-esr sddm +apt-get update +apt-get clean + +update-initramfs -u -k all + +echo PASSWD FOR USER $MYUSERNAME +useradd -m $MYUSERNAME +passwd $MYUSERNAME + +echo "YOU MAY POPULATE FS WITH SOME ADDITIONAL DATA NOW, then exit" diff --git a/scripts/deblive03-isolinux-boot.txt b/scripts/deblive03-isolinux-boot.txt new file mode 100644 index 0000000..abf1c0e --- /dev/null +++ b/scripts/deblive03-isolinux-boot.txt @@ -0,0 +1,5 @@ +1 - Debian10 ZFS Live Graphical +2 - Debian10 ZFS Live Console + +3 - HDT low-level hardware info +4 - memtest86+ diff --git a/scripts/deblive03-isolinux.cfg b/scripts/deblive03-isolinux.cfg new file mode 100644 index 0000000..ba8d941 --- /dev/null +++ b/scripts/deblive03-isolinux.cfg @@ -0,0 +1,24 @@ +display boot.txt +prompt 1 +default 1 + +timeout 100 + +label 1 + kernel /live/vmlinuz1 + append initrd=/live/initrd1 boot=live systemd.unit=graphical.target + +label 2 + kernel /live/vmlinuz1 + append initrd=/live/initrd1 boot=live systemd.unit=multi-user.target + +label 3 + kernel hdt.c32 + text help + HDT displays low-level information about the systems hardware. + endtext + +label 4 + kernel /live/memtest + + diff --git a/scripts/deblive03.sh b/scripts/deblive03.sh new file mode 100644 index 0000000..eed5fee --- /dev/null +++ b/scripts/deblive03.sh @@ -0,0 +1,31 @@ +#! /bin/sh + +. ./settings00.sh + +mkdir -p $LIVECHROOT/home/$MYUSERNAME +cp -a /home/$MYUSERNAME/.ssh $LIVECHROOT/home/$MYUSERNAME/ +cp -a /home/$MYUSERNAME/.gnupg $LIVECHROOT/home/$MYUSERNAME/ + +/usr/sbin/chroot $LIVECHROOT /bin/chown -R $MYUSERNAME:$MYUSERNAME /home/$MYUSERNAME/.ssh +/usr/sbin/chroot $LIVECHROOT /bin/chown -R $MYUSERNAME:$MYUSERNAME /home/$MYUSERNAME/.gnupg + +#umount -R $LIVECHROOT/dev +#umount -R $LIVECHROOT/proc +#umount -R $LIVECHROOT/sys +cat /proc/mounts | awk '{print $2}' | grep "^$LIVECHROOT" | sort -r | xargs umount + +rm -rf $LIVEROOT/image +mkdir -p $LIVEROOT/image/live + +# mksquashfs default compression is gzip, enhance small size: -comp xz +(cd $LIVEROOT && \ + mksquashfs chroot image/live/filesystem.squashfs -e boot +) + +(cd $LIVEROOT && \ + cp chroot/boot/vmlinuz-$KVERSION image/live/vmlinuz1 + cp chroot/boot/initrd.img-$KVERSION image/live/initrd1 + cp chroot/boot/memtest86+.bin image/live/memtest +) + + diff --git a/scripts/deblive04-iso.sh b/scripts/deblive04-iso.sh new file mode 100644 index 0000000..196e3a6 --- /dev/null +++ b/scripts/deblive04-iso.sh @@ -0,0 +1,61 @@ +#! /bin/sh + +. ./settings00.sh + +# +# CD +# + +rm -rf $LIVEROOT/image/isolinux +mkdir -p $LIVEROOT/image/isolinux +cp deblive03-isolinux.cfg $LIVEROOT/image/isolinux/isolinux.cfg +cp deblive03-isolinux-boot.txt $LIVEROOT/image/isolinux/boot.txt + +#(cd $LIVEROOT/image/ && \ +# cp $LIVECHROOT/usr/lib/ISOLINUX/isolinux.bin isolinux/ && \ +# cp $LIVECHROOT/usr/lib/syslinux/modules/bios/menu.c32 isolinux/ && \ +# cp $LIVECHROOT/usr/lib/syslinux/modules/bios/hdt.c32 isolinux/ && \ +# cp $LIVECHROOT/usr/lib/syslinux/modules/bios/ldlinux.c32 isolinux/ && \ +# cp $LIVECHROOT/usr/lib/syslinux/modules/bios/libutil.c32 isolinux/ && \ +# cp $LIVECHROOT/usr/lib/syslinux/modules/bios/libmenu.c32 isolinux/ && \ +# cp $LIVECHROOT/usr/lib/syslinux/modules/bios/libcom32.c32 isolinux/ && \ +# cp $LIVECHROOT/usr/lib/syslinux/modules/bios/libgpl.c32 isolinux/ && \ +# cp $LIVECHROOT/usr/share/misc/pci.ids isolinux/ +#) + +(cd $LIVEROOT/image/ && \ + cp $LIVECHROOT/usr/lib/ISOLINUX/isolinux.bin isolinux/ && \ + cp $LIVECHROOT/usr/lib/syslinux/modules/bios/*.c32 isolinux/ && \ + cp $LIVECHROOT/usr/share/misc/pci.ids isolinux/ +) + +rm -f $LIVEROOT/debian10-zfs-live.iso + +#genisoimage \ +# -volid "DEBIAN9_ZFS_LIVE" \ +# -rational-rock \ +# -cache-inodes \ +# -joliet \ +# -hfs \ +# -full-iso9660-filenames \ +# -b isolinux/isolinux.bin \ +# -c isolinux/boot.cat \ +# -no-emul-boot \ +# -boot-load-size 4 \ +# -boot-info-table \ +# -output $LIVEROOT/debian10-zfs-live.iso \ +# $LIVEROOT/image + +xorriso \ + -volid "DEBIAN10_ZFSLIVE" \ + -as mkisofs -r -J -joliet-long -l -cache-inodes \ + -isohybrid-mbr $LIVECHROOT/usr/lib/ISOLINUX/isohdpfx.bin \ + -partition_offset 16 \ + -b isolinux/isolinux.bin \ + -c isolinux/boot.cat \ + -no-emul-boot \ + -boot-load-size 4 \ + -boot-info-table \ + -o $LIVEROOT/debian10-zfs-live.iso \ + $LIVEROOT/image + diff --git a/scripts/deblive04-usb.sh b/scripts/deblive04-usb.sh new file mode 100644 index 0000000..c1f3b03 --- /dev/null +++ b/scripts/deblive04-usb.sh @@ -0,0 +1,39 @@ +#! /bin/sh + +. ./settings00.sh + +# +# USB +# +# Prepare FAT32 formatted on part-1 w/ boot flag +# + +USBDEV=/dev/sdz +USBMNT=/mnt/usb + +mkdir -p $USBMNT + +syslinux -i $USBDEV"1" + +dd \ + if=/usr/lib/syslinux/mbr.bin \ + of=$USBDEV \ + conv=notrunc bs=440 count=1 + +mount $USBDEV"1" $USBMNT + +cp /usr/lib/syslinux/modules/bios/menu.c32 $USBMNT/ && \ +cp /usr/lib/syslinux/modules/bios/hdt.c32 $USBMNT/ && \ +cp /usr/lib/syslinux/modules/bios/ldlinux.c32 $USBMNT/ && \ +cp /usr/lib/syslinux/modules/bios/libutil.c32 $USBMNT/ && \ +cp /usr/lib/syslinux/modules/bios/libmenu.c32 $USBMNT/ && \ +cp /usr/lib/syslinux/modules/bios/libcom32.c32 $USBMNT/ && \ +cp /usr/lib/syslinux/modules/bios/libgpl.c32 $USBMNT/ && \ +cp /boot/memtest86+.bin $USBMNT/memtest && \ +cp deblive03-isolinux.cfg $USBMNT/syslinux.cfg && \ +cp deblive03-isolinux-boot.txt $USBMNT/boot.txt && \ +cp /usr/share/misc/pci.ids $USBMNT/ && \ +rsync -rv $LIVEROOT/image/live $USBMNT/ + +umount $USBMNT + diff --git a/scripts/debootstrap01.sh b/scripts/debootstrap01.sh new file mode 100644 index 0000000..5312eef --- /dev/null +++ b/scripts/debootstrap01.sh @@ -0,0 +1,62 @@ +#! /bin/sh + +. ./settings00.sh + +apt-get install \ + debootstrap xorriso live-build syslinux isolinux squashfs-tools genisoimage memtest86+ \ + rsync + +rm -f $STRAPBALL +rm -rf $STRAPROOT +mkdir -p $STRAPROOT + +mkdir -p $STRAPROOT/var/tmp +chmod 1777 $STRAPROOT/var/tmp + +debootstrap --arch=amd64 --variant=buildd \ + --include=net-tools,openssh-server,locales,rsync,sharutils,psmisc,htop,iftop,patch,less \ + --components main,contrib,non-free buster $STRAPROOT + +echo $MYHOSTNAME > $STRAPROOT/etc/hostname + +mkdir -p $STRAPROOT/etc/network +echo "auto lo" >> $STRAPROOT/etc/network/interfaces +echo "iface lo inet loopback" >> $STRAPROOT/etc/network/interfaces +echo "#auto enp6s0" >> $STRAPROOT/etc/network/interfaces +echo "#allow-hotplug enp6s0" >> $STRAPROOT/etc/network/interfaces +echo "#iface enp6s0 inet dhcp" >> $STRAPROOT/etc/network/interfaces + +echo "deb http://deb.debian.org/debian buster main contrib non-free" > $STRAPROOT/etc/apt/sources.list +echo "deb-src http://deb.debian.org/debian buster main contrib non-free" >> $STRAPROOT/etc/apt/sources.list +echo "" >> $STRAPROOT/etc/apt/sources.list +echo "deb http://deb.debian.org/debian/ buster-updates main non-free contrib" >> $STRAPROOT/etc/apt/sources.list +echo "deb-src http://deb.debian.org/debian/ buster-updates main non-free contrib" >> $STRAPROOT/etc/apt/sources.list +echo "" >> $STRAPROOT/etc/apt/sources.list +echo "deb http://deb.debian.org/debian/ buster-backports main non-free contrib" >> $STRAPROOT/etc/apt/sources.list +echo "deb-src http://deb.debian.org/debian/ buster-backports main non-free contrib" >> $STRAPROOT/etc/apt/sources.list +echo "" >> $STRAPROOT/etc/apt/sources.list +echo "deb http://security.debian.org/ buster/updates main contrib non-free" >> $STRAPROOT/etc/apt/sources.list +echo "deb-src http://security.debian.org/ buster/updates main contrib non-free" >> $STRAPROOT/etc/apt/sources.list + +mount --rbind /dev $STRAPROOT/dev +mount --rbind /proc $STRAPROOT/proc +mount --rbind /sys $STRAPROOT/sys +mount --make-rslave $STRAPROOT/dev +mount --make-rslave $STRAPROOT/proc +mount --make-rslave $STRAPROOT/sys +echo umount -R $STRAPROOT/dev +echo umount -R $STRAPROOT/proc +echo umount -R $STRAPROOT/sys +echo "cat /proc/mounts | awk '{print $2}' | grep "^$STRAPROOT" | sort -r | xargs umount" + +mkdir -p $STRAPROOT/root +cp -a ../../zfs $STRAPROOT/root + +mkdir -p $STRAPROOT/root/debian +cp -a ../../debian/packages $STRAPROOT/root/debian/ + +mkdir -p $STRAPROOT/root/.ssh +cp -a /home/$MYUSERNAME/.ssh/authorized_keys $STRAPROOT/root/.ssh/ + +echo RUN: chroot $STRAPROOT /bin/bash --login + diff --git a/scripts/debootstrap02.sh b/scripts/debootstrap02.sh new file mode 100644 index 0000000..0f7e1cf --- /dev/null +++ b/scripts/debootstrap02.sh @@ -0,0 +1,64 @@ +#! /bin/sh + +. ./settings00.sh + +chown -R root:root /root/.ssh + +ln -s /proc/self/mounts /etc/mtab +apt-get update + +apt-get install --yes dialog apt-utils + +apt-get install --yes locales +dpkg-reconfigure locales + +dpkg-reconfigure tzdata +apt-get install --yes gdisk build-essential dkms dpkg-dev linux-headers-amd64 linux-image-amd64 +apt-get install --yes amd64-microcode atmel-firmware firmware-amd-graphics firmware-bnx2 firmware-bnx2x \ + firmware-brcm80211 firmware-intelwimax firmware-ipw2x00 \ + firmware-iwlwifi firmware-libertas firmware-linux firmware-linux-free firmware-linux-nonfree \ + firmware-misc-nonfree firmware-myricom firmware-netxen firmware-qlogic firmware-realtek \ + intel-microcode + +# +# apt-get install --yes zfs-dkms zfs-initramfs +# + +apt-get install --yes grub-pc + +apt-get install --yes \ + systemd-sysv \ + debootstrap xorriso live-build syslinux isolinux squashfs-tools genisoimage memtest86+ + +apt-get install --yes \ + hwinfo dmidecode cpuid cpufrequtils pciutils usbutils hwdata discover \ + gnupg gnupg-agent gnupg2 \ + git git-buildpackage git-cola git-core git-cvs git-doc git-email git-gui git-man git-svn gitk \ + nano pv vim \ + gparted ntfs-3g hfsprogs dosfstools chntpw partclone \ + xfsdump xfsprogs \ + isc-dhcp-client ifupdown network-manager net-tools \ + wireless-tools wpasupplicant wpagui \ + nfs-common nfs-kernel-server nfswatch \ + smbclient cifs-utils \ + rsync tcpdump wget openssh-server openssh-client iptables \ + lsof rpcbind iptraf iftop wireshark tcpdump pcaputils ngrep + +# Replace Debian ZFS packages and replace with vanilla latest release +. ./zfs-buster-remove.sh +. ./zfs-0.7.13-install-debian10.sh +cat apt-preferences.d-local-pin-init >> /etc/apt/preferences.d/local-pin-init +apt-get update +apt-get clean + +update-initramfs -u -k all + +echo PASSWD FOR USER ROOT +passwd root + +echo PASSWD FOR USER TEST +useradd -m test +passwd test + +echo "YOU MAY POPULATE FS WITH SOME ADDITIONAL DATA NOW, then exit" + diff --git a/scripts/debootstrap03.sh b/scripts/debootstrap03.sh new file mode 100644 index 0000000..94c2290 --- /dev/null +++ b/scripts/debootstrap03.sh @@ -0,0 +1,16 @@ +#! /bin/sh + +. ./settings00.sh + +#umount -R $STRAPROOT/dev +#umount -R $STRAPROOT/proc +#umount -R $STRAPROOT/sys +cat /proc/mounts | awk '{print $2}' | grep "^$STRAPROOT" | sort -r | xargs umount + +rm -f $STRAPBALL +cd $STRAPROOT +tar --xattrs -capf $STRAPBALL . + +# Extract on target: +# cd $STRAPROOT +# tar --xattrs -xapf $STRAPBALL diff --git a/scripts/etc-apt-sources.list b/scripts/etc-apt-sources.list new file mode 100644 index 0000000..883caeb --- /dev/null +++ b/scripts/etc-apt-sources.list @@ -0,0 +1,11 @@ +deb http://deb.debian.org/debian buster main contrib non-free +deb-src http://deb.debian.org/debian buster main contrib non-free + +deb http://deb.debian.org/debian/ buster-updates main non-free contrib +deb-src http://deb.debian.org/debian/ buster-updates main non-free contrib + +deb http://deb.debian.org/debian/ buster-backports main non-free contrib +deb-src http://deb.debian.org/debian/ buster-backports main non-free contrib + +deb http://security.debian.org/ buster/updates main contrib non-free +deb-src http://security.debian.org/ buster/updates main contrib non-free diff --git a/scripts/s01.sh b/scripts/s01.sh new file mode 100644 index 0000000..abd40e0 --- /dev/null +++ b/scripts/s01.sh @@ -0,0 +1,114 @@ +#! /bin/sh + +. ./settings00.sh + +apt-get update + +#sed -i "s/PasswordAuthentication no/PasswordAuthentication yes/g" /etc/ssh/sshd_config +#service ssh restart + +modprobe zfs + +# If you are re-using a MDADM disk, clear it as necessary: +# +# If the disk was previously used in an MD array, zero the superblock: +#apt install --yes mdadm +#mdadm --zero-superblock --force /dev/disk/by-id/$DISK1 +#mdadm --zero-superblock --force /dev/disk/by-id/$DISK2 +#mdadm --zero-superblock --force /dev/disk/by-id/$DISK3 + +# Clear the partition table: +sgdisk --zap-all /dev/disk/by-id/$DISK1 +sgdisk --zap-all /dev/disk/by-id/$DISK2 +sgdisk --zap-all /dev/disk/by-id/$DISK3 + +# 2.2 Partition your disk: +# +# Run this if you need legacy (BIOS) booting: +sgdisk -a1 -n2:34:2047 -t2:EF02 /dev/disk/by-id/$DISK1 +sgdisk -a1 -n2:34:2047 -t2:EF02 /dev/disk/by-id/$DISK2 +sgdisk -a1 -n2:34:2047 -t2:EF02 /dev/disk/by-id/$DISK3 + +#Run these in all cases: +sgdisk -n1:0:0 -t1:BF01 /dev/disk/by-id/$DISK1 +sgdisk -n1:0:0 -t1:BF01 /dev/disk/by-id/$DISK2 +sgdisk -n1:0:0 -t1:BF01 /dev/disk/by-id/$DISK3 + +## +## Create POOL +## + +zpool create -f -o ashift=12 -o autoexpand=on \ + -O atime=off -O compression=off \ + -O mountpoint=/ -R /mnt \ + $POOL raidz2 \ + /dev/disk/by-id/$DISK1-part1 \ + /dev/disk/by-id/$DISK2-part1 \ + /dev/disk/by-id/$DISK3-part1 + +zpool autoexpand=on $POOL +zpool autoreplace=off $POOL +zpool listsnapshots=off $POOL + +zfs set dedup=off $POOL +zfs set compression=off $POOL +zfs set atime=off $POOL +zfs set mountpoint=none $POOL + +# Create Dataset System Root +zfs create -o mountpoint=none $POOL/system +zfs create -o mountpoint=/ $POOL/system/debian +#zfs mount $POOL/system/debian +zpool set bootfs=$POOL/system/debian $POOL + +zfs create -o compression=lz4 $POOL/system/debian/var + +# Create Datasets .. +zfs create -o mountpoint=/home $POOL/users +zfs create -o mountpoint=/root $POOL/users/root + +zfs create -o mountpoint=/backup -o compression=lz4 $POOL/backup +zfs create -o mountpoint=/data $POOL/data +zfs create -o mountpoint=/srv $POOL/services +zfs create -o mountpoint=/usr/local/projects -o compression=lz4 $POOL/projects + +## +## Prepare ROOT +## + +mkdir -p /mnt + +(cd /mnt && \ + tar --xattrs -xapf $STRAPBALL +) + +zfs set devices=off $POOL + +echo $MYHOSTNAME > /mnt/etc/hostname + +echo "127.0.1.1 $MYHOSTNAME" >> /mnt/etc/hosts +#or if the system has a real name in DNS: +#echo "127.0.1.1 $MYFQDN $MYHOSTNAME" >> /mnt/etc/hosts + +# Using NetworkManager should not require this +#mv /mnt/etc/resolv.conf /mnt/etc/resolv.conf-orig +#cat /etc/resolv.conf > /mnt/etc/resolv.conf +echo You may want to adjust /mnt/etc/network/interfaces + +cp -a ../../zfs /mnt/root/ + +mount --rbind /dev /mnt/dev +mount --rbind /proc /mnt/proc +mount --rbind /sys /mnt/sys +mount --make-rslave /mnt/dev +mount --make-rslave /mnt/proc +mount --make-rslave /mnt/sys +echo umount -R /mnt/dev +echo umount -R /mnt/proc +echo umount -R /mnt/sys +echo "cat /proc/mounts | awk '{print $2}' | grep "/mnt" | sort -r | xargs umount" + +echo RUN chroot /mnt /bin/bash --login + + + diff --git a/scripts/s02.sh b/scripts/s02.sh new file mode 100644 index 0000000..4cf1622 --- /dev/null +++ b/scripts/s02.sh @@ -0,0 +1,27 @@ +#! /bin/sh + +. ./settings00.sh + +apt-get update +apt-get clean + +echo SET ROOT PASSWORD +passwd root + +echo Test whether grub detects ZFS ROOT +echo grub-probe / +grub-probe / + +update-initramfs -u -k all + +update-grub + +grub-install /dev/disk/by-id/$DISK1 +grub-install /dev/disk/by-id/$DISK2 +grub-install /dev/disk/by-id/$DISK3 + +ls /boot/grub/*/zfs.mod + +zfs snapshot $POOL/system/debian@install + +echo "YOU MAY POPULATE FS WITH SOME ADDITIONAL DATA NOW, then exit" diff --git a/scripts/s03.sh b/scripts/s03.sh new file mode 100644 index 0000000..d9c9f21 --- /dev/null +++ b/scripts/s03.sh @@ -0,0 +1,33 @@ +#! /bin/sh + +. ./settings00.sh + +zfs create -V $MYSWAPSIZE -b $(getconf PAGESIZE) -o compression=zle \ + -o logbias=throughput -o sync=always \ + -o primarycache=metadata -o secondarycache=none \ + -o com.sun:auto-snapshot=false $POOL/swap + +zfs set compression=zle $POOL/swap +zfs set logbias=throughput $POOL/swap +zfs set sync=always $POOL/swap +zfs set primarycache=metadata $POOL/swap +zfs set secondarycache=none $POOL/swap +zfs set com.sun:auto-snapshot=false $POOL/swap +zfs set checksum=off $POOL/swap + +mkswap -f /dev/zvol/$POOL/swap +echo /dev/zvol/$POOL/swap none swap defaults 0 0 >> /etc/fstab +# UUID=ee57ce05-7287-4b37-93c4-03aeaba756f1 +# /etc/fstab +# /dev/zvol/$POOL/swap none swap defaults 0 0 +# +swapon /dev/zvol/$POOL/swap + +#umount -R /mnt/dev +#umount -R /mnt/proc +#umount -R /mnt/sys +cat /proc/mounts | awk '{print $2}' | grep "/mnt" | sort -r | xargs umount + +zfs unmount -a +zpool export $POOL + diff --git a/scripts/s04.sh b/scripts/s04.sh new file mode 100644 index 0000000..64e7528 --- /dev/null +++ b/scripts/s04.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +. ./settings00.sh + +for file in /etc/logrotate.d/* ; do + if grep -Eq "(^|[^#y])compress" "$file" ; then + sed -i -r "s/(^|[^#y])(compress)/\1#\2/" "$file" + fi +done diff --git a/scripts/settings00.sh b/scripts/settings00.sh new file mode 100644 index 0000000..f8823c5 --- /dev/null +++ b/scripts/settings00.sh @@ -0,0 +1,32 @@ +#! /bin/sh + +# +# For Debian debootstrap tar ball +# +STRAPROOT=/data/debian10/debootstrap +ZFSDEBDIR=`readlink -f ../zfs-linux-0.7.13-debian10-amd64` + +# +# For All +# +STRAPBALL=`readlink -f ../debian10-zfs-debootstrap.tar.bz2` + +MYHOSTNAME="debian-zfs" +MYUSERNAME="sven" + +# +# For Debian ZFS Live Installation +# +KVERSION="4.19.0-5-amd64" +LIVEROOT=/data/debian10/live_boot +LIVECHROOT=$LIVEROOT/chroot + +# +# For ZFS System Installation +# +POOL=tpool +DISK1=ata-WDC_WD2003FYYS-02W0B1_WD-WCAY00187731 +DISK2=ata-WDC_WD2003FYYS-02W0B1_WD-WCAY00187732 +DISK3=ata-WDC_WD2003FYYS-02W0B1_WD-WCAY00187733 +MYSWAPSIZE=33G + diff --git a/scripts/settings00.sh-test02 b/scripts/settings00.sh-test02 new file mode 100644 index 0000000..3ff797c --- /dev/null +++ b/scripts/settings00.sh-test02 @@ -0,0 +1,32 @@ +#! /bin/sh + +# +# For Debian debootstrap tar ball +# +STRAPROOT=/data/debian9/debootstrap +ZFSDEBDIR=`readlink -f ../zfs-linux-0.7.3-debian9-amd64` + +# +# For All +# +STRAPBALL=`readlink -f ../debian9-zfs-debootstrap.tar.bz2` + +MYHOSTNAME="test02" +MYUSERNAME="sven" + +# +# For Debian ZFS Live Installation +# +KVERSION="4.9.0-4-amd64" +LIVEROOT=/data/debian9/live_boot +LIVECHROOT=$LIVEROOT/chroot + +# +# For ZFS System Installation +# +POOL=test02 +DISK1=ata-VBOX_HARDDISK_VB0534c422-330be595 +DISK2=ata-VBOX_HARDDISK_VB9f812506-27aeef4e +DISK3=ata-VBOX_HARDDISK_VBb4e81953-01afbdc6 +MYSWAPSIZE=2G + diff --git a/scripts/sh-zfs-arc.sh b/scripts/sh-zfs-arc.sh new file mode 100644 index 0000000..fe359af --- /dev/null +++ b/scripts/sh-zfs-arc.sh @@ -0,0 +1,25 @@ +# 21474836480 # 0x500000000 (20 GB) +# 17179869184 # 0x400000000 (16 GB) +# 12884901888 # 0x300000000 (12 GB) +# 8589934592 # 0x200000000 ( 8 GB) +# 6442450944 # 0x180000000 ( 6 GB) +# 5368709120 # 0x140000000 ( 5 GB) +# 4294967296 # 0x100000000 ( 4 GB) +# 1073741824 # 0x040000000 ( 1 GB) +# 536870912 # 0x020000000 (.5 GB) + +# 4294967296 # 0x100000000 ( 4 GB) +echo options zfs zfs_arc_max=4294967296 >> /etc/modprobe.d/zfs.conf +echo zfs zfs_arc_max=4294967296 >> /etc/initramfs-tools/modules +#echo zfs zfs_arc_max=4294967296 >> /etc/modules + +# 5368709120 # 0x140000000 ( 5 GB) +echo options zfs zfs_arc_max=4294967296 >> /etc/modprobe.d/zfs.conf +echo zfs zfs_arc_max=4294967296 >> /etc/initramfs-tools/modules +#echo zfs zfs_arc_max=4294967296 >> /etc/modules + +# 17179869184 # 0x400000000 (16 GB) +echo options zfs zfs_arc_max=17179869184 >> /etc/modprobe.d/zfs.conf +echo zfs zfs_arc_max=17179869184 >> /etc/initramfs-tools/modules +#echo zfs zfs_arc_max=17179869184 >> /etc/modules + diff --git a/scripts/zfs-0.6.5-remove.sh b/scripts/zfs-0.6.5-remove.sh new file mode 100644 index 0000000..aac0d9c --- /dev/null +++ b/scripts/zfs-0.6.5-remove.sh @@ -0,0 +1,5 @@ + +dpkg -r --force-all zfs-initramfs zfsutils zfs-dkms libzfs2 libzpool2 libuutil1 libnvpair1 spl spl-dkms +dpkg -P --force-all zfs-initramfs zfsutils zfs-dkms libzfs2 libzpool2 libuutil1 libnvpair1 spl spl-dkms + +#dpkg -r grub-common grub-pc grub-pc-bin grub2-common diff --git a/scripts/zfs-0.7.12-remove.sh b/scripts/zfs-0.7.12-remove.sh new file mode 100644 index 0000000..1c23fc6 --- /dev/null +++ b/scripts/zfs-0.7.12-remove.sh @@ -0,0 +1,5 @@ + +dpkg -r --force-all zfs-initramfs zfs zfs-dkms libzfs2 libzpool2 libuutil1 libnvpair1 spl spl-dkms +dpkg -P --force-all zfs-initramfs zfs zfs-dkms libzfs2 libzpool2 libuutil1 libnvpair1 spl spl-dkms + +#dpkg -r grub-common grub-pc grub-pc-bin grub2-common diff --git a/scripts/zfs-0.7.13-install-debian10.sh b/scripts/zfs-0.7.13-install-debian10.sh new file mode 100644 index 0000000..188e25b --- /dev/null +++ b/scripts/zfs-0.7.13-install-debian10.sh @@ -0,0 +1,25 @@ +#! /bin/sh + +ZFSDEBDIR=`readlink -f ../zfs-linux-0.7.13-debian10-amd64` + +#apt-get install spl-dkms spl +dpkg -i $ZFSDEBDIR/spl-dkms_0.7.13-1_amd64.deb +dpkg -i $ZFSDEBDIR/spl_0.7.13-1_amd64.deb + +#apt-get install libnvpair1 libuutil1 libzpool2 libzfs2 +dpkg -i $ZFSDEBDIR/libuutil1_0.7.13-1_amd64.deb +dpkg -i $ZFSDEBDIR/libnvpair1_0.7.13-1_amd64.deb +dpkg -i $ZFSDEBDIR/libzpool2_0.7.13-1_amd64.deb +dpkg -i $ZFSDEBDIR/libzfs2_0.7.13-1_amd64.deb +#apt-get install zfs-dkms zfs zfs-initramfs +dpkg -i $ZFSDEBDIR/zfs-dkms_0.7.13-1_amd64.deb +dpkg -i $ZFSDEBDIR/zfs_0.7.13-1_amd64.deb +dpkg -i $ZFSDEBDIR/zfs-initramfs_0.7.13-1_amd64.deb + +apt-mark manual zfs-initramfs zfs zfs-dkms libzfs2 libzpool2 libuutil1 libnvpair1 spl spl-dkms dkms + +# FIX /etc/default/zfs +# ZFS_INITRD_ADDITIONAL_DATASETS="$POOL/users $POOL/users/root $POOL/backup $POOL/data $POOL/services $POOL/projects" +# and run: update-initramfs -u -k all + +##apt-get install grub-common grub-pc grub-pc-bin grub2-common diff --git a/scripts/zfs-0.7.13-install-debian9.sh b/scripts/zfs-0.7.13-install-debian9.sh new file mode 100644 index 0000000..a215123 --- /dev/null +++ b/scripts/zfs-0.7.13-install-debian9.sh @@ -0,0 +1,25 @@ +#! /bin/sh + +ZFSDEBDIR=`readlink -f ../zfs-linux-0.7.13-debian9-amd64` + +#apt-get install spl-dkms spl +dpkg -i $ZFSDEBDIR/spl-dkms_0.7.13-1_amd64.deb +dpkg -i $ZFSDEBDIR/spl_0.7.13-1_amd64.deb + +#apt-get install libnvpair1 libuutil1 libzpool2 libzfs2 +dpkg -i $ZFSDEBDIR/libuutil1_0.7.13-1_amd64.deb +dpkg -i $ZFSDEBDIR/libnvpair1_0.7.13-1_amd64.deb +dpkg -i $ZFSDEBDIR/libzpool2_0.7.13-1_amd64.deb +dpkg -i $ZFSDEBDIR/libzfs2_0.7.13-1_amd64.deb +#apt-get install zfs-dkms zfs zfs-initramfs +dpkg -i $ZFSDEBDIR/zfs-dkms_0.7.13-1_amd64.deb +dpkg -i $ZFSDEBDIR/zfs_0.7.13-1_amd64.deb +dpkg -i $ZFSDEBDIR/zfs-initramfs_0.7.13-1_amd64.deb + +apt-mark manual zfs-initramfs zfs zfs-dkms libzfs2 libzpool2 libuutil1 libnvpair1 spl spl-dkms dkms + +# FIX /etc/default/zfs +# ZFS_INITRD_ADDITIONAL_DATASETS="$POOL/users $POOL/users/root $POOL/backup $POOL/data $POOL/services $POOL/projects" +# and run: update-initramfs -u -k all + +##apt-get install grub-common grub-pc grub-pc-bin grub2-common diff --git a/scripts/zfs-0.7.13-remove.sh b/scripts/zfs-0.7.13-remove.sh new file mode 100644 index 0000000..1c23fc6 --- /dev/null +++ b/scripts/zfs-0.7.13-remove.sh @@ -0,0 +1,5 @@ + +dpkg -r --force-all zfs-initramfs zfs zfs-dkms libzfs2 libzpool2 libuutil1 libnvpair1 spl spl-dkms +dpkg -P --force-all zfs-initramfs zfs zfs-dkms libzfs2 libzpool2 libuutil1 libnvpair1 spl spl-dkms + +#dpkg -r grub-common grub-pc grub-pc-bin grub2-common diff --git a/scripts/zfs-0.7.3-remove.sh b/scripts/zfs-0.7.3-remove.sh new file mode 100644 index 0000000..1c23fc6 --- /dev/null +++ b/scripts/zfs-0.7.3-remove.sh @@ -0,0 +1,5 @@ + +dpkg -r --force-all zfs-initramfs zfs zfs-dkms libzfs2 libzpool2 libuutil1 libnvpair1 spl spl-dkms +dpkg -P --force-all zfs-initramfs zfs zfs-dkms libzfs2 libzpool2 libuutil1 libnvpair1 spl spl-dkms + +#dpkg -r grub-common grub-pc grub-pc-bin grub2-common diff --git a/scripts/zfs-buster-remove.sh b/scripts/zfs-buster-remove.sh new file mode 100644 index 0000000..450a131 --- /dev/null +++ b/scripts/zfs-buster-remove.sh @@ -0,0 +1,19 @@ + +# old stretch/buster stuff .. +dpkg -r --force-all zfs-zed zfs-initramfs zfsutils-linux zfs-dkms libzfs2linux libzpool2linux libuutil1linux libnvpair1linux spl spl-dkms +dpkg -P --force-all zfs-zed zfs-initramfs zfsutils-linux zfs-dkms libzfs2linux libzpool2linux libuutil1linux libnvpair1linux spl spl-dkms + +dpkg -r --force-all simplesnap zfssnap +dpkg -P --force-all simplesnap zfssnap + +# 0.7.3 - 0.7.12 +dpkg -r --force-all libzfs2-devel +dpkg -P --force-all libzfs2-devel + +dpkg -r --force-all zfs-initramfs zfs zfs-dkms libzfs2 libzpool2 libuutil1 libnvpair1 spl spl-dkms +dpkg -P --force-all zfs-initramfs zfs zfs-dkms libzfs2 libzpool2 libuutil1 libnvpair1 spl spl-dkms + +dpkg -r --force-all zfs-dracut zfs-test +dpkg -P --force-all zfs-dracut zfs-test + +#dpkg -r grub-common grub-pc grub-pc-bin grub2-common diff --git a/scripts/zfs-stretch-install.sh b/scripts/zfs-stretch-install.sh new file mode 100644 index 0000000..c6d02a2 --- /dev/null +++ b/scripts/zfs-stretch-install.sh @@ -0,0 +1,5 @@ + +apt-get install spl-dkms spl +apt-get install libnvpair1linux libuutil1linux libzpool2linux libzfs2linux +apt-get install zfs-dkms zfsutils-linux zfs-initramfs zfs-zed +#apt-get install grub-common grub-pc grub-pc-bin grub2-common diff --git a/scripts/zfs-stretch-remove.sh b/scripts/zfs-stretch-remove.sh new file mode 100644 index 0000000..6c53238 --- /dev/null +++ b/scripts/zfs-stretch-remove.sh @@ -0,0 +1,5 @@ + +dpkg -r --force-all zfs-zed zfs-initramfs zfsutils-linux zfs-dkms libzfs2linux libzpool2linux libuutil1linux libnvpair1linux spl spl-dkms +dpkg -P --force-all zfs-zed zfs-initramfs zfsutils-linux zfs-dkms libzfs2linux libzpool2linux libuutil1linux libnvpair1linux spl spl-dkms + +#dpkg -r grub-common grub-pc grub-pc-bin grub2-common diff --git a/zfs-install-new.txt b/zfs-install-new.txt new file mode 100644 index 0000000..5cd2e13 --- /dev/null +++ b/zfs-install-new.txt @@ -0,0 +1,325 @@ +# +# ZFS on Linux https://zfsonlinux.org/ +# +# Derived from: https://github.com/zfsonlinux/zfs/wiki/Debian-Buster-Root-on-ZFS +# https://github.com/zfsonlinux/zfs/wiki/Debian-Stretch-Root-on-ZFS +# +# Binary debian packages within +# - zfs-linux-0.7.13-debian10-amd64 +# - zfs-linux-0.7.13-debian9-amd64 +# have been produced using the contained zfs-0.7.13 zfs-linux-0.7.13-source.tar.gz +# on debian10-amd64 and debian9-amd64 +# using git sources from +# - https://github.com/zfsonlinux/spl.git +# - https://github.com/zfsonlinux/zfs.git +# + +# Assuming the following steps have been prepared - artifacts are available! +# 1) Using own Debian10 Prepared debootstrap: debootstrap01.sh - debootstrap03.sh +# 2) Using own Debian10 Live ISO: deblive01.sh - deblive03-iso.sh +# +# Boot with the created (1) Debian ZFS Live System +# +# <s00.sh start> +# +MYHOSTNAME=jordan +POOL=jordan +DISK1=ata-WDC_WD2003FYYS-02W0B1_WD-WCAY00187731 +DISK2=ata-WDC_WD2003FYYS-02W0B1_WD-WCAY00187732 +DISK3=ata-WDC_WD2003FYYS-02W0B1_WD-WCAY00187733 +MYSWAPSIZE=33G +STRAPBALL=../debian10-zfs-debootstrap.tar.bz2 +# +# <s00.sh end> +# + +## Host + +sudo -i + +# +# <s01.sh start> +# +apt-get update +apt-get clean + +#sed -i "s/PasswordAuthentication no/PasswordAuthentication yes/g" /etc/ssh/sshd_config +#service ssh restart + +modprobe zfs + +# If you are re-using a MDADM disk, clear it as necessary: +# +# If the disk was previously used in an MD array, zero the superblock: +#apt-get install --yes mdadm +#mdadm --zero-superblock --force /dev/disk/by-id/$DISK1 +#mdadm --zero-superblock --force /dev/disk/by-id/$DISK2 +#mdadm --zero-superblock --force /dev/disk/by-id/$DISK3 + +# Clear the partition table: +sgdisk --zap-all /dev/disk/by-id/$DISK1 +sgdisk --zap-all /dev/disk/by-id/$DISK2 +sgdisk --zap-all /dev/disk/by-id/$DISK3 + +# 2.2 Partition your disk: +# +# Run this if you need legacy (BIOS) booting: +sgdisk -a1 -n2:34:2047 -t2:EF02 /dev/disk/by-id/$DISK1 +sgdisk -a1 -n2:34:2047 -t2:EF02 /dev/disk/by-id/$DISK2 +sgdisk -a1 -n2:34:2047 -t2:EF02 /dev/disk/by-id/$DISK3 + +#Run these in all cases: +sgdisk -n1:0:0 -t1:BF01 /dev/disk/by-id/$DISK1 +sgdisk -n1:0:0 -t1:BF01 /dev/disk/by-id/$DISK2 +sgdisk -n1:0:0 -t1:BF01 /dev/disk/by-id/$DISK3 + +# 2.3 Create the root pool +# +zpool create -f -o ashift=12 -o autoexpand=on \ + -O atime=off -O compression=off \ + -O mountpoint=/ -R /mnt \ + $POOL raidz2 \ + /dev/disk/by-id/$DISK1-part1 \ + /dev/disk/by-id/$DISK2-part1 \ + /dev/disk/by-id/$DISK3-part1 + +zpool autoexpand=on $POOL +zpool autoreplace=off $POOL +zpool listsnapshots=off $POOL + +zfs set dedup=off $POOL +zfs set compression=off $POOL +zfs set atime=off $POOL +zfs set mountpoint=none $POOL + +# Create Dataset System Root +zfs create -o mountpoint=none $POOL/system +zfs create -o mountpoint=/ $POOL/system/debian +#zfs mount $POOL/system/debian +zpool set bootfs=$POOL/system/debian $POOL + +zfs create -o compression=lz4 $POOL/system/debian/var + +# Create Datasets .. +zfs create -o mountpoint=/home $POOL/users +zfs create -o mountpoint=/root $POOL/users/root + +zfs create -o mountpoint=/backup -o compression=lz4 $POOL/backup +zfs create -o mountpoint=/data $POOL/data +zfs create -o mountpoint=/srv $POOL/services +zfs create -o mountpoint=/usr/local/projects -o compression=lz4 $POOL/projects + +## Export / Import ( '-d ..' also changes the dev names ) +##zpool export $POOL +##zpool import -d /dev/disk/by-id -R /mnt $POOL + +#3.4 Prepare ROOT + +mkdir -p /mnt + +(cd /mnt && \ + tar --xattrs -xapf $STRAPBALL +) + +zfs set devices=off $POOL + +#Step 4: System Configuration +# +#4.1 Configure the hostname (change HOSTNAME to the desired hostname). +# +echo $MYHOSTNAME > /mnt/etc/hostname + +echo "127.0.1.1 $MYHOSTNAME" >> /mnt/etc/hosts +#or if the system has a real name in DNS: +#echo "127.0.1.1 $MYFQDN $MYHOSTNAME" >> /mnt/etc/hosts + +#Using NetworkManager should not require this +# mv /mnt/etc/resolv.conf /mnt/etc/resolv.conf-orig +# cat /etc/resolv.conf > /mnt/etc/resolv.conf +# + +#4.3 Bind the virtual filesystems from the LiveCD environment to the new system and chroot into it: +# +cp -a ../../zfs /mnt/root/ + +mount --rbind /dev /mnt/dev +mount --rbind /proc /mnt/proc +mount --rbind /sys /mnt/sys +mount --make-rslave /mnt/dev +mount --make-rslave /mnt/proc +mount --make-rslave /mnt/sys +echo umount -R /mnt/dev +echo umount -R /mnt/proc +echo umount -R /mnt/sys +echo "cat /proc/mounts | awk '{print $2}' | grep "/mnt" | sort -r | xargs umount" + +echo RUN chroot /mnt /bin/bash --login + +# +# <s01.sh end> +# + +CHROOT ENVIRONMENT + +#4.0 Without NetworkManager, you may want to adjust /etc/network/interfaces +# +#Find the interface name: +ip addr show + +vi /etc/network/interfaces.d/NAME ++++ +auto NAME +iface NAME inet dhcp ++++ + +#4.1 Refine ZFS default (JAU - Required for ZFS 0.7) +# /etc/default/zfs +# ZFS_INITRD_ADDITIONAL_DATASETS before fstab, i.e. ready for bind! +ZFS_INITRD_ADDITIONAL_DATASETS="$POOL/users $POOL/users/root $POOL/backup $POOL/data $POOL/services $POOL/projects" +#VERBOSE_MOUNT='yes' + +#4.2 Optional (but highly recommended): Make debugging GRUB easier: +# +vi /etc/default/grub ++++ +Remove quiet from: GRUB_CMDLINE_LINUX_DEFAULT +Add 'elevator=noop' to: GRUB_CMDLINE_LINUX_DEFAULT + GRUB_CMDLINE_LINUX_DEFAULT="elevator=noop" +Uncomment: GRUB_TERMINAL=console +Save and quit. ++++ +# (JAU - Required for ZFS 0.7) +++ +# /etc/default/grub +GRUB_CMDLINE_LINUX_DEFAULT="elevator=noop" +GRUB_CMDLINE_LINUX="root=ZFS=$POOL/system/debian boot=zfs rpool=$POOL bootfs=$POOL/system/debian" +++ ++++ + +#5.0 Configure a basic system environment: +# + +# +# <s02.sh start> +# +apt-get update +apt-get clean + +passwd + +#5.1 Verify that the ZFS root filesystem is recognized: +# +grub-probe / +++ +zfs +++ + +#Step 5: GRUB Installation +# +#5.2 Refresh the initrd files: +# + +update-initramfs -u -k all + +#5.4 Update the boot configuration: +# +update-grub + +#5.5 Install the boot loader +# +#5.5a For legacy (MBR) booting, install GRUB to the MBR: +# +grub-install /dev/disk/by-id/$DISK1 +grub-install /dev/disk/by-id/$DISK2 +grub-install /dev/disk/by-id/$DISK3 + +#5.6 Verify that the ZFS module is installed: +# +ls /boot/grub/*/zfs.mod +# + +#Step 6: First Boot +# +#6.1 Snapshot the initial installation: +# +zfs snapshot $POOL/system/debian@install +# +# <s02.sh end> +# + +#6.2 Exit from the chroot environment back to the LiveCD environment: +# +exit + +HOST ENVIRONMENT + +#6.3 Run these commands in the LiveCD environment to unmount all filesystems: +# +# <s03.sh start> +# + +#7.2 Configure the swap device: +#7.2a Create an unencrypted (regular) swap device: +# +# Swap ZVOL / machine w/ 32GB Ram, x86_64 4k pagesize `getconf PAGESIZE` +# +zfs create -V $MYSWAPSIZE -b $(getconf PAGESIZE) -o compression=zle \ + -o logbias=throughput -o sync=always \ + -o primarycache=metadata -o secondarycache=none \ + -o com.sun:auto-snapshot=false $POOL/swap + +zfs set compression=zle $POOL/swap +zfs set logbias=throughput $POOL/swap +zfs set sync=always $POOL/swap +zfs set primarycache=metadata $POOL/swap +zfs set secondarycache=none $POOL/swap +zfs set com.sun:auto-snapshot=false $POOL/swap +zfs set checksum=off $POOL/swap + +mkswap -f /dev/zvol/$POOL/swap +echo /dev/zvol/$POOL/swap none swap defaults 0 0 >> /etc/fstab +# UUID=ee57ce05-7287-4b37-93c4-03aeaba756f1 +# /etc/fstab +# /dev/zvol/$POOL/swap none swap defaults 0 0 +# +swapon /dev/zvol/$POOL/swap + +#umount -R /mnt/dev +#umount -R /mnt/proc +#umount -R /mnt/sys +cat /proc/mounts | awk '{print $2}' | grep "/mnt" | sort -r | xargs umount + +zfs unmount -a +zpool export $POOL +# +# <s03.sh end> +# + +#6.4 Reboot: +# +reboot + +#Step 8: Full Software Installation +# +#8.1 Upgrade the minimal system: +# +apt-get update +apt-get dist-upgrade --yes + +#8.2 Optional: Disable log compression: +# +# <s04.sh start> +# +for file in /etc/logrotate.d/* ; do + if grep -Eq "(^|[^#y])compress" "$file" ; then + sed -i -r "s/(^|[^#y])(compress)/\1#\2/" "$file" + fi +done +# +# <s04.sh end> +# + +#8.3 Reboot: +reboot + + diff --git a/zfs-stretch-troubles.txt b/zfs-stretch-troubles.txt new file mode 100644 index 0000000..23693ae --- /dev/null +++ b/zfs-stretch-troubles.txt @@ -0,0 +1,13 @@ + +1) linux boot -> busybox: "No pool imported. Manually import the root pool." +zfs import -R /root $POOL +zfs import -d /dev/disk/by-id -R /root $POOL +exit + +If still nagging about 'mount manually', +do each single 'zfs mount $POOL/dataset' +even though they were already mounted. + +Double check /etc/default/zfs + + |