• Need to rollback with ZFS from Live USB after upgrade


    Hello, I just upgraded to kernel 10.10 and it broke something in my system to where it won’t boot. Fortunately I take snapshots with zfs before each update I run. Can somebody help me with how to roll it back from a live USB?

    I’ve tried running zpool import, but it seems I’m missing a step before that. How do I get zfs to even know where my pool is (or rather how to find it). Do I need to mount the disk somehow before this? mount -t zfs /dev/sdX /mnt/wherever doesn’t seem to work.

    The error message is:
    Cannot import ‘antergos_0u2q’: no such pool available

    Thanks for any help :)

  • migth be related to my issue. I also just upgraded to kernel 4.10.10-1.
    now boot exits to rootfs, not able to load zfs module. and not beeing able too mount real root device.

    so I followed Arch wiki, exept i use antergos live usb stick.

    start a Terminal and run sudo su to get root.

    modprobe zfs

    zpool import -a -R /mnt

    mount /dev/sda2 /mnt/boot

    mount /dev/sda1 /mnt/efi

    arch-chroot /mnt /bin/bash

    running # ls verifies evrything is loaded
    next:

    pacman -Qi linux

    Name : linux
    Version : 4.10.10-1
    Description : The Linux kernel and modules
    Architecture : x86_64
    URL : https://www.kernel.org/
    Licenses : GPL2
    Groups : base
    Provides : None
    Depends On : coreutils linux-firmware kmod mkinitcpio>=0.7
    Optional Deps : crda: to set the correct wireless channels of your country [installed]
    Required By : zfs
    Optional For : None
    Conflicts With : None
    Replaces : None
    Installed Size : 79.92 MiB
    Packager : Tobias Powalowski [email protected]
    Build Date : Wed Apr 12 18:52:14 2017
    Install Date : Mon Apr 17 10:35:17 2017
    Install Reason : Explicitly installed
    Install Script : Yes
    Validated By : Signature

    uname -r

    4.10.6-1-ARCH

    depmod -a 4.10.10-1-ARCH

    [[email protected] /]#

    mkinitcpio -p linux

    ==> Building image from preset: /etc/mkinitcpio.d/linux.preset: ‘default’
    -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
    ==> Starting build: 4.10.10-1-ARCH
    -> Running build hook: [base]
    -> Running build hook: [udev]
    -> Running build hook: [autodetect]
    -> Running build hook: [modconf]
    -> Running build hook: [block]
    -> Running build hook: [keyboard]
    -> Running build hook: [keymap]
    -> Running build hook: [resume]
    -> Running build hook: [zfs]
    ==> ERROR: module not found: zavl' ==> ERROR: module not found:znvpair’
    ==> ERROR: module not found: zunicode' ==> ERROR: module not found:zcommon’
    ==> ERROR: module not found: zfs' ==> ERROR: module not found:zpios’
    ==> ERROR: module not found: zlib_deflate' -> Running build hook: [filesystems] ==> Generating module dependencies ==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img bsdcpio: Failed to set default locale ==> WARNING: errors were encountered during the build. The image may not be complete. ==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback' -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect ==> Starting build: 4.10.10-1-ARCH -> Running build hook: [base] -> Running build hook: [udev] -> Running build hook: [modconf] -> Running build hook: [block] ==> WARNING: Possibly missing firmware for module: wd719x ==> WARNING: Possibly missing firmware for module: aic94xx -> Running build hook: [keyboard] -> Running build hook: [keymap] -> Running build hook: [resume] -> Running build hook: [zfs] ==> ERROR: module not found:zavl’
    ==> ERROR: module not found: znvpair' ==> ERROR: module not found:zunicode’
    ==> ERROR: module not found: zcommon' ==> ERROR: module not found:zfs’
    ==> ERROR: module not found: zpios' ==> ERROR: module not found:zlib_deflate’
    -> Running build hook: [filesystems]
    ==> Generating module dependencies
    ==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-fallback.img
    bsdcpio: Failed to set default locale
    ==> WARNING: errors were encountered during the build. The image may not be complete.
    [[email protected] /]#

    this is where im stuck as the Arch wiki tells me there should be no errors.

  • ok, i got a script at the antergos IRC channel, wich rebuilt kernel modules.

    #!/bin/bash
    
    set -o errexit
    set -o nounset
    set -o xtrace
    
    install_module() {
      local module="${1}"
      local kernel="${2}"
      for m in $(ls /usr/src); do
        if [[ "${m}" =~ ^"${module}"-(.*)$ ]]; then
          dkms install "${module}/${BASH_REMATCH[1]}" -k "${kernel}"
        fi
      done
    }
    
    for kernel in $(ls /usr/lib/modules); do
      if [[ -d "/usr/lib/modules/${kernel}/kernel" ]]; then
        install_module spl "${kernel}"
        install_module zfs "${kernel}"
      fi
    done
    

    then after mkinitcpio -p linux
    nano /etc/fstab and added after the /dev/zvol/troot/swap line

    /mnt/zfspool		/srv/nfs4/music		none	bind,defaults,nofail,x-systemd.requires=zfs-mount.service	0 0
    

    voila my system booted again :)

  • Thanks so much for all of the info. I just blew away my install since it was only about a week old. However, I’m going to try and use this info to build against the lts kernel since it should have less problems in the future. I also added it to my notes so that I can do it later “when” it breaks again.

  • I am having the same problem except I am in a virtualbox. I followed the same instructions and came until

    [[email protected] /]# mkinitcpio -p linux
    ==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
      -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
    ==> Starting build: 4.10.10-1-ARCH
      -> Running build hook: [base]
      -> Running build hook: [udev]
      -> Running build hook: [autodetect]
      -> Running build hook: [modconf]
      -> Running build hook: [block]
      -> Running build hook: [keyboard]
      -> Running build hook: [keymap]
      -> Running build hook: [resume]
      -> Running build hook: [zfs]
    ==> ERROR: module not found: `zlib_deflate'
      -> Running build hook: [filesystems]
    ==> Generating module dependencies
    ==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
    bsdcpio: Failed to set default locale
    ==> WARNING: errors were encountered during the build. The image may not be complete.
    ==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
      -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
    ==> Starting build: 4.10.10-1-ARCH
      -> Running build hook: [base]
      -> Running build hook: [udev]
      -> Running build hook: [modconf]
      -> Running build hook: [block]
    ==> WARNING: Possibly missing firmware for module: aic94xx
    ==> WARNING: Possibly missing firmware for module: wd719x
      -> Running build hook: [keyboard]
      -> Running build hook: [keymap]
      -> Running build hook: [resume]
      -> Running build hook: [zfs]
    ==> ERROR: module not found: `zlib_deflate'
      -> Running build hook: [filesystems]
    ==> Generating module dependencies
    ==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-fallback.img
    bsdcpio: Failed to set default locale
    ==> WARNING: errors were encountered during the build. The image may not be complete.
    

    The image seems to be generated, however after reboot I am thrown back to the busy box.
    The following output is still

    [[email protected] /]# uname -r
    4.10.6-1-ARCH
    [[email protected] /]# pacman -Qi linux | grep "Version"
    Version         : 4.10.10-1
    

    What am i missing here?

    btw: dont understand your fstab entry (I guess it does not apply to my case)

  • @hhelle Thanks again for the instructions… I had the same problem today and chrooting into it from a live USB worked like a charm. Nice thing is that it also fixed ZFS not working with the LTS kernel (had to also run “mkinitcpio -p linux-lts” for that), so now if I forget to run that script again after a kernel upgrade I can boot into the LTS kernel instead of chrooting into it :)

    @rfor Do you have a regular prompt you can log into, or is it at the rootfs prompt?

  • @natewardawg Just the rootfs prompt (That’s what i meant with “busy box”) All the other output comes from the chroot envi.
    Actually, i did a complete reinstall of the VM this time with ext4 (I needed the VM urgently). Howerver, i’d be interested in solving the problem, as my original intent was getting in touch with zfs (what i got more than i wanted…)
    Anyway, thank you all for your input!

  • @rfor I just re-ran the script and it gave me almost all the same errors and warnings as you have and it boots just fine, so I’m not sure.

    It gave me these:
    WARNING: errors were encountered during the build. The image may not be complete.
    ERROR: module not found: `zlib_deflate’
    WARNING: Possibly missing firmware for module: aic94xx
    WARNING: Possibly missing firmware for module: aic94xx

    The only error I see that you have that I don’t have on my end is:
    bsdcpio: Failed to set default locale

    Here’s a link to a forum post with several more links to check out. I can’t imagine not setting the correct locale is breaking things though, but maybe you (or someone else) knows better than me on this.

    edit: https://bbs.archlinux.org/viewtopic.php?id=136166

    I did have some troubles with Antergos ZFS in a Virtual machine about 6 months ago, but I can’t remember if it was the same problem. I’ve had a much better time so far on actual hardware.

    Hope that helps :)

  • @natewardawg said in Need to rollback with ZFS from Live USB after upgrade:

    Here’s a link to a forum post with several more links to check out.

    Forgotten to post the link :worried: ?

zfs24 issues34 troubleshooting1 update45 Posts 11Views 501
Log in to reply