From d7e4941614d94d664d6333b823e5fe0e46998d9e Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Wed, 10 Apr 2019 09:50:13 -0500 Subject: [PATCH] Debian: Use pinning for stretch-backports This ensures that updates in stretch-backports will be installed. I also made Debian.md and Debian-Stretch-Root-on-ZFS.md consistent with their setup of sources. I'm keeping the simpler setup in the Live CD environment, as that is only temporary. --- Debian-Stretch-Root-on-ZFS.md | 14 +++++++++++--- Debian.md | 21 +++++++++++++-------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Debian-Stretch-Root-on-ZFS.md b/Debian-Stretch-Root-on-ZFS.md index 59d2fdd..f805383 100644 --- a/Debian-Stretch-Root-on-ZFS.md +++ b/Debian-Stretch-Root-on-ZFS.md @@ -41,7 +41,7 @@ If you have a second system, using SSH to access the target system can be conven $ sudo -i -1.4 Add `contrib` archive area: +1.4 Setup and update the repositories: # echo deb http://deb.debian.org/debian stretch contrib >> /etc/apt/sources.list # echo deb http://deb.debian.org/debian stretch-backports main contrib >> /etc/apt/sources.list @@ -53,6 +53,8 @@ If you have a second system, using SSH to access the target system can be conven # apt install --yes -t stretch-backports zfs-dkms # modprobe zfs +* The dkms dependency is installed manually just so it comes from stretch and not stretch-backports. This is not critical. + ## Step 2: Disk Formatting 2.1 If you are re-using a disk, clear it as necessary: @@ -270,9 +272,15 @@ Customize this file if the system is not a DHCP client. deb http://deb.debian.org/debian stretch main contrib deb-src http://deb.debian.org/debian stretch main contrib + # vi /etc/apt/sources.list.d/stretch-backports.list deb http://deb.debian.org/debian stretch-backports main contrib deb-src http://deb.debian.org/debian stretch-backports main contrib + # vi /etc/apt/preferences.d/90_zfs + Package: libnvpair1linux libuutil1linux libzfs2linux libzpool2linux spl-dkms zfs-dkms zfs-test zfsutils-linux zfsutils-linux-dev zfs-zed + Pin: release n=stretch-backports + Pin-Priority: 990 + 4.4 Bind the virtual filesystems from the LiveCD environment to the new system and `chroot` into it: # mount --rbind /dev /mnt/dev @@ -296,8 +304,8 @@ Even if you prefer a non-English system language, always ensure that `en_US.UTF- 4.6 Install ZFS in the chroot environment for the new system: - # apt install --yes dkms dpkg-dev linux-headers-$(uname -r) linux-image-amd64 - # apt install --yes -t stretch-backports zfs-initramfs + # apt install --yes dpkg-dev linux-headers-$(uname -r) linux-image-amd64 + # apt install --yes zfs-initramfs 4.7 For LUKS installs only: diff --git a/Debian.md b/Debian.md index 60b40d6..adfe938 100644 --- a/Debian.md +++ b/Debian.md @@ -11,25 +11,30 @@ Offical ZFS on Linux [DKMS](https://en.wikipedia.org/wiki/Dynamic_Kernel_Module_ ## Installation For Debian Stretch, ZFS packages are included in the [contrib repository](https://packages.debian.org/source/stretch/zfs-linux). Newer ZFS packages are provided by the [backports repository](https://backports.debian.org/Instructions/). +If you want to boot from ZFS, see [[Debian Stretch Root on ZFS]] instead. + Add the backports repository: - # echo "deb http://deb.debian.org/debian stretch-backports main contrib" > /etc/apt/sources.list.d/stretch-backports.list + # vi /etc/apt/sources.list.d/stretch-backports.list + deb http://deb.debian.org/debian stretch-backports main contrib + deb-src http://deb.debian.org/debian stretch-backports main contrib + + # vi /etc/apt/preferences.d/90_zfs + Package: libnvpair1linux libuutil1linux libzfs2linux libzpool2linux spl-dkms zfs-dkms zfs-test zfsutils-linux zfsutils-linux-dev zfs-zed + Pin: release n=stretch-backports + Pin-Priority: 990 Update the list of packages: - # apt update + # apt update Install the kernel headers and other dependencies: - # apt install linux-headers-$(uname -r) linux-headers-amd64 dkms build-essential libelf-dev + # apt install --yes dpkg-dev linux-headers-$(uname -r) linux-image-amd64 Install the zfs packages: - # apt-get install -t stretch-backports zfs-dkms zfsutils-linux - -If you want to boot from ZFS (for more information, see [[Debian Stretch Root on ZFS]]), you'll need the `zfs-initramfs` package too: - - # apt-get install -t stretch-backports zfs-initramfs + # apt-get install zfs-dkms zfsutils-linux ## Jessie to Stretch update From Debian Stretch packages are included in Debian official `contrib` repository. Steps to reinstall packages: