Quantcast
Channel: Active questions tagged mount+fstab - Ask Ubuntu
Viewing all articles
Browse latest Browse all 699

How to prevent incorrect (double) mount points (generated by the docker service) before my LUKS disks are unlocked and mounted?

$
0
0

Situation

I have the following situation that has been bothering me for the last few years after I every restart but after many attempts I decided to drop the question here. I had this problem using Ubuntu and still have this problem using the Ubuntu-based ZorinOS. I'm having two external disks connected to my machine. Both encrypted LUKS disks (ext4). Those disks don't automount because they require a key to be entered manually. That's the intended. But I've noticed that after a restart, the mountpoints are claimed before the disks are mounted (I suspect by the docker service) and therefore giving my disks an invalid mountpoint after unlocking.

Example

Before restart (desired):

/media/username/diskA < real mountpoint with all the data from external disk/media/username/diskB < real mountpoint with all the data from external disk

After restart and manual unlocking encrypted disks (undesired):

/media/username/diskA < (mostly) empty folder/media/username/diskB < (mostly) empty folder/media/username/diskA1 < real mountpoint with all the data from external disk/media/username/diskB1 < real mountpoint with all the data from external disk

Attempts

I have tried several unsuccessful things including telling the Docker service to wait for the mounts to be ready before starting its service by changing /lib/systemd/system/docker.service and adding, under the [Unit] section RequiresMountsFor=/media/username/diskA /media/username/diskB followed by systemctl daemon-reload. It does not seem to result in what I want. Simply for Docker not to start. But maybe it isn't even the docker service and another thing is causing my mountpoints to be all mixed up. I always end up, stopping the docker service, removing the wrong mountpoints manually, remounting the disks and starting the docker service manually again. In that order.

Desired solution

In the most ideal situation I would like that the mountpoints are untouched after a restart and start the docker service but simply for docker not touch those points until the disks are mounted. Or to delay the start of the containers that require those external disks. Alternatively I'm fine with suspending the docker service altogether after a system restart, as long as my mountpoints are not messed with.


Viewing all articles
Browse latest Browse all 699

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>