OpenMediaVault-Plugin-Developers / openmediavault-docker-gui

Docker plugin for OpenMediaVault
32 stars 17 forks source link

OMV enters emergency mode if mounting of /var/lib/docker/openmediavault fails #72

Open denis-martin opened 6 years ago

denis-martin commented 6 years ago

If the following fstab entry cannot be mount during boot, OMV enters emergency mode:

/srv/dev-disk-by-label-Data1/Docker /var/lib/docker/openmediavault none bind,defaults 0 0

This can happen, for instance, if the data disk is encrypted and needs to be unlocked manually. The emergency mode even prevents ssh from being started, which is especially painful in headless mode.

The data disk has the nofail option. If adding the nofail option to the docker mount point, the system starts gracefully. My fstab for the data disk and the docker mount points:

# >>> [openmediavault]
/dev/disk/by-label/Data1 /srv/dev-disk-by-label-Data1 ext4 defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2
/srv/dev-disk-by-label-Data1/Docker /var/lib/docker/openmediavault none bind,defaults,nofail 0 0
# <<< [openmediavault]

Note the nofail option on the docker mount point.

Not sure if openmediavault-docker-gui is the package responsible for this fstab entry, so please redirect me if I'm wrong here ;-)

ryecoaaron commented 6 years ago

What version of OMV? The latest OMV 4.x version doesn't use an fstab entry.

denis-martin commented 6 years ago

It's

Since what OVM 4.x version the usage of fstab has been removed?

ryecoaaron commented 6 years ago

Not sure but the removal code didn't seem to work on your system. I found the commit where the removal code was moved to a different location but it has been in the plugin longer than that - https://github.com/OpenMediaVault-Plugin-Developers/openmediavault-docker-gui/commit/5b616410fb86290a5e969d078d2b72844d34a86a

denis-martin commented 6 years ago

So... if understand the snippets correctly, there is some DB in OMV which manages the fstab entries. Is there a way to query the mount points which are registered in OMV?

If the docker bind mount is no longer in the DB, there was maybe just a missing trigger to rewrite the fstab entries.

I could probably just create a new mount in OMV and see what happens to the fstab entries. But I'm reluctant to do that while I do not have physical access to the device ;-)

ryecoaaron commented 6 years ago

omv-showkey mntent will show you the entries. omv-mkconf fstab will rewrite the omv entries in your /etc/fstab but this should happen on reboots.

denis-martin commented 6 years ago

This still shows the entry:

      <mntent>
        <uuid>aa92d4d7-c56f-4fb2-86c5-f11e0bf03789</uuid>
        <fsname>/dev/disk/by-label/Data1</fsname>
        <dir>/srv/dev-disk-by-label-Data1</dir>
        <type>ext4</type>
        <opts>defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl</opts>
        <freq>0</freq>
        <passno>2</passno>
        <hidden>0</hidden>
      </mntent>
      <mntent>
        <uuid>965985e2-34fe-4745-8efc-2687b41fe830</uuid>
        <fsname>/srv/dev-disk-by-label-Data1/Docker</fsname>
        <dir>/var/lib/docker/openmediavault</dir>
        <type>none</type>
        <opts>bind,defaults</opts>
        <freq>0</freq>
        <passno>0</passno>
        <hidden>0</hidden>
      </mntent>

I actually installed omv-docker-gui quite recently. I'm not 100% sure, but it could very well be that docker-gui v4.0.1 was a fresh install.

subzero79 commented 6 years ago

The docker plugin package with those changes is not yet available in the repositories. If you want you can build it from source and install it manually.