Last active
October 23, 2019 02:55
-
-
Save elreydetoda/f8e77579b572c95549cfadbd0d151410 to your computer and use it in GitHub Desktop.
these are the zfs mount and unmount commands based on this: https://github.com/zfsonlinux/zfs/wiki/Ubuntu-18.04-Root-on-ZFS#troubleshooting mount: https://git.io/Je0e0 unmount: https://git.io/Je0eu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
zpool export -a | |
zpool import -N -R /mnt rpool | |
zpool import -N -R /mnt bpool | |
# skipping first rpool/ROOT and initial root (i.e. rpool/ROOT/ubuntu), because doesn't have tailing '/' so grabs numbers | |
zfs list | grep ROOT | tail -n+3 | |
zfs mount rpool/ROOT/ubuntu | |
zfs mount -a | |
mount --rbind /dev /mnt/dev | |
mount --rbind /proc /mnt/proc | |
mount --rbind /sys /mnt/sys | |
chroot /mnt /bin/bash --login |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# get out of chroot | |
# type exit or Ctrl + d | |
mount | grep -v zfs | tac | awk '/\/mnt/ {print $3}' | xargs -i{} umount -lf {} | |
zpool export -a | |
reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment