[zfs-discuss] zfs import hangs - options please! :)

Randy Syring randy.syring at level12.io
Fri Jan 8 09:51:42 EST 2016

Thank you both so much for your suggestions!

I've been able to boot in through the initramfs and import rpool using -N,
perform a scrub (no errors), and remove rpool/data/etc.  I was also able to
mount rpool/data/home and browse the files.  I have some snapshots of
rpool/ROOT that I'm currently sending to a pool on an external hard drive
in the hopes of saving a more recent backup.

However, my attempts to get rpool/ROOT mounted have failed.  When I try it,
I get a stack trace as shown in the linked picture.  :(


Any suggestions?

Randy Syring (sent from my mobile)
Chief Executive Developer
Direct: 502-276-0459
Office: 812-285-8766

Level 12 - Principled People | Software that Works
Putting /etc onto a separate file system is a particularly bad idea
(considerably worse than splitting off other parts of the rootfs).

Note: The following would work on Fedora/CentOS/RHEL. Hopefully the Ubuntu
setup isn't fundamentally different.

Since you are running zfs root, pass rd.break=pre-mount parameter (since
all the zfs tools will be in the dracut generated initramfs, you should
never need a separate rescue system, unless you lose the initramfs).
This will interrupt the boot process before pool importing and drop you to
the command prompt.

Then do:
# zpool import -N rpool
That will import the pool but not mount any file systems.

You might want to run a scrub at this point and wait for it to finish to
make sure nothing is broken.

Then zfs mount each fs in turn, starting with ROOT and data/etc. Then move
the contents of your data/etc fs back to ROOT and zfs destroy
rpool/data/root. If you are using legacy mounts, make sure you remove
rpool/data/etc from fstab.

Find out which particular fs is blocking the regular import process.

If they all mount fine:
# zpool export rpool

Hit Ctrl-D, and regular boot should resume (it'll re-import the pool, mount
root, and proceed with switchroot).

Unless something else is broken, it should boot successfully.

On Fri, Jan 8, 2016 at 4:20 AM, Randy Syring via zfs-discuss <
zfs-discuss at list.zfsonlinux.org> wrote:

> Current status:
>    - Macbook Pro (11,1) w/ 1 TB SSD drive
>       - At most, 150GB of data
>    - Recently installed ZFS on root on ubuntu 14.04
>    - Installed on a luks container following these instructions:
>    https://help.ubuntu.com/community/encryptedZfs
>    - The above was all working fine for at least the past couple of days
>    - Recently ran memtest86 overnight (4 passes) and had no detectable
>    memory errors
> Recent changes:
>    - Wanted to use a bit different of a snapshot scheme for data files vs
>    system files
>    - Moved /home /etc /tmp from normal directories on rpool/ROOT to
>    instead be zfs datasets mounted in those locations
>       - rpool/data/home, rpool/data/etc, etc.
>    - Booted into single-user mode in order to complete the setup of the
>    new zfs datasets and their mount points
>    - When I moved the home directory, it was about 60GB of data
>    - When I moved the /etc directory, I had some problems getting ZFS to
>    work.  In hindsight, I probably shouldn't have tried to put /etc on a
>    separate dataset.  The last thing I did was setup the zfs dataset to mount
>    at /etc, moved /etc to /etc.bak, and rebooted.
>    - The system wouldn't reboot with shutdown -r now, so I ended up just
>    holding the power button until the computer shutdown.
> Problem:
>    - When I tried to reboot back into the operating system normally, I
>    would get a kernel panic.  Unfortunately, there was never detailed info but
>    it did seem to happen immediately after the zfs startup sequence.
>       - In hindsight, I'm guessing this has to do with the /etc dataset
>       trying to be mounted by the zfs tools not working because /etc isn't
>       present.
>    - No problem (so I thought), I have a SystemRescueCD with ZFS support
>    which I used to troubleshoot previously, so I booted it up.
>    - After decrypting the LUKS volume, `zpool import` shows the rpool
>    - running `zpool import -R /media/zfs rpool` hangs
>       - The first time I tried running this command, I had to use "-f",
>       presumably because the shutdown I did while in single user didn't properly
>       "export" the device.
>       - `iotop` and `top` show no significant activity during this time.
>       - I can CTRL-C out of the zpool import and then `zfs list` shows
>       the mounted volumes.  But, I don't think they are really mounted because
>       there are no files in the directories they are supposed to be mounted at.
> Other info:
>    - If I keep messing around trying to examine the zfs datasets, or try
>    to delete the "etc" dataset, then the console completely hangs, CTRL-C
>    doesn't do anything.
>    - I've tried importing with "-o failmode=continue" but that doesn't
>    seem to change anything.
>    - I thought I might be able to use `zdb` to help, but since I can't
>    import the pool, I wasn't sure if it could just work on a plain block
>    device.  I did have it print the labels using the "-l" option, but wasn't
>    sure what else to do with it.
> I do have a recent backup on an externalusb drive, but I did a bunch of
> configuration changes to my machine today and some programming and I would
> really hate to lose that info.
> Thanks in advance for any help or suggestions you can provide.
> --
> *Randy Syring*
> Chief Executive Developer
> Direct: 502.276.0459
> Office: 812.285.8766
> _______________________________________________
> zfs-discuss mailing list
> zfs-discuss at list.zfsonlinux.org
> http://list.zfsonlinux.org/cgi-bin/mailman/listinfo/zfs-discuss

zfs-discuss mailing list
zfs-discuss at list.zfsonlinux.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.zfsonlinux.org/pipermail/zfs-discuss/attachments/20160108/085876af/attachment.html>

More information about the zfs-discuss mailing list