You are not logged in.

#1 2014-01-22 17:18:20

ball
Member
From: Germany
Registered: 2011-12-23
Posts: 164

[SOLVED] Prevent racy mounting when booting

Hey there!

When booting I mount an external (encrypted) drive by the means of fstab (and crypttab) under a directory which is only accessible by root.  In order to allow read-only access for users, I remount the the device under another directory which allows reading for ordinary users by the means of bindfs.

The relevant part of my /etc/fstab goes like this:

/dev/mapper/backup /mnt/root/backup ext4 defaults 0 2
bindfs#/mnt/root/backup /mnt/backup fuse perms=a-w 0 0

However, after booting up the contents of /mnt/root/backup do not show up under /mnt/backup. Remounting /mnt/backup manually makes the files appear.  I suspect that this is because the bindfs mounting is done before mounting /mnt/root/backup has finished; also the order of the two mounts shown when issuing the mount command is inverted to the order in fstab.

How do I have to cope with this situation?

Shall I add noauto to the bindfs instruction and write a custom service file for systemd in order to mount the read-only ressource at a later time? (I am asking this because I am fairly unexperienced when in comes to systemd and I don't want to head for the wrong track...)

Last edited by ball (2014-01-22 18:36:25)

Offline

#2 2014-01-22 18:07:11

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,943
Website

Re: [SOLVED] Prevent racy mounting when booting

See this topic regarding how to write bindfs fstab entries: https://bbs.archlinux.org/viewtopic.php?id=175230


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2014-01-22 18:39:02

ball
Member
From: Germany
Registered: 2011-12-23
Posts: 164

Re: [SOLVED] Prevent racy mounting when booting

Thanks, this is solved. (But it's a bit frustrating that this is not documented in bindfs(1) -- I've reported it upstream.)

Offline

Board footer

Powered by FluxBB