Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mounts datasets too late in boot process #101

Open
jgoerzen opened this issue Jan 23, 2014 · 4 comments
Open

Mounts datasets too late in boot process #101

jgoerzen opened this issue Jan 23, 2014 · 4 comments
Labels

Comments

@jgoerzen
Copy link

This is on Debian wheezy.

I have datasets like so:

NAME                                                USED  AVAIL  REFER  MOUNTPOINT
rpool/minerva-1/ROOT                                657M  6.05G   584M  /
rpool/minerva-1/usr                                6.70G  3.30G  4.43G  /usr
rpool/minerva-1/var                                 732M  4.29G   450M  /var

When the system boots, /etc/init.d/zfs-mount is running too late. Other things are running first, such as syslog, LVM, etc. They are creating directories under /var. When zfs-mount runs, /var is no longer empty, and it refuses to mount it. This results in a non-working system.

The workaround I have documented at http://wiki.complete.org/ConvertingToZFS#zfs_mounting_workaround_.28for_separate_.2BAC8-usr.2C_.2BAC8-var.29 is:

Edit /etc/insserv.conf, and at the end of the $local_fs line, add zfs-mount (without a plus).

And, edit /etc/init.d/zfs-mount and change the three lines near the top to:

 # Required-Start:
 # Required-Stop:
 # Default-Start: S

Additionally, for people that have a zpool atop dm-crypt, this will not work well. They need to set Required-Start: cryptdisks-early and add zpool import -a one line before zpool mount -a in /etc/init.d/zfs-mount. They also must edit mountall-bootclean.sh to set "Required-Start: mountall zfs-mount".

These are probably not the correct fixes for going in this package, but I am documenting them here as a starting point anyhow.

@jonathonf
Copy link

@jgoerzen Any idea how can this be accomplished with systemd?

@sanmadjack
Copy link

I have this issue on Ubuntu as well. I have to restart most of my services after boot, since they failed to start due to their ZFS partitions not being mounted yet.

dajhorn added a commit that referenced this issue Oct 13, 2014
Accomodate openzfs/zfs#2780 by importing pools in an upstart job before
mountall starts. The device timeout logic, although not event driven, should
mitigate the recurring mpt2sas problem described in section 4.3 of the ZoL
mountall FAQ.

Add a new `/etc/default/zfs` option:

  * `ZFS_AUTOIMPORT_TIMEOUT`, which is the number of seconds to wait
  for pool member devices to appear before attempting import.

Closes: #53
Closes: #101 for Ubuntu.
@dajhorn
Copy link
Member

dajhorn commented Oct 13, 2014

I have this issue on Ubuntu as well.

The packages for Utopic now have a /etc/init/zpool-import.conf enhancement that should generally resolve this kind of issue on Ubuntu. Feedback would be appreciated, especially with nested block device configurations like DM or LUKS.

@FransUrbo
Copy link
Contributor

In my dailies (0.6.3+) I added the ZFS_INITRD_ADDITIONAL_DATASETS to mount, in the initrd, any filesystem other than the root fs.

# List of additional datasets to mount after the root                    
# dataset is mounted.
# The init script will use the mountpoint specified in
# the 'mountpoint' property value in the dataset to
# determine where it should be mounted.
#ZFS_INITRD_ADDITIONAL_DATASETS="rpool/ROOT/usr_local"

This is also part of my #2087 pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants