1

I use OpenMediaVault, a NAS software on top of Debian Wheezy. This system usually mounts the file systems at /media/, but that is cumbersome to type and to identify.

As such, I've modified my fstab file to bind mount two file systems to different locations. Check the last two lines of my fstab file:

UUID=e2063e64-379f-4d8f-a8c4-75c1439636d6 /             ext4    errors=remount-ro    0 1
UUID=e5187843-c48d-411c-8716-fc35901d7901 none          swap    sw                   0 0

# >>> [openmediavault]
UUID=4d98f9b3-512f-4d8b-96c6-4c6c4caaab40 /media/4d98f9b3-512f-4d8b-96c6-4c6c4caaab40 xfs defaults,nofail,noexec,usrquota,grpquota 0 2
UUID=52efb2d8-3120-4113-88b0-01531f784ae7 /media/52efb2d8-3120-4113-88b0-01531f784ae7 ext4 defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2
# <<< [openmediavault]

# Remount /home with executable permissions
UUID=52efb2d8-3120-4113-88b0-01531f784ae7 /media/52efb2d8-3120-4113-88b0-01531f784ae7 none remount,exec 0 0

# Bind mount already-mounted filesystems to additional locations
/media/4d98f9b3-512f-4d8b-96c6-4c6c4caaab40 /storage none bind 0 0
/media/52efb2d8-3120-4113-88b0-01531f784ae7 /home none bind 0 0

This works nicely but has one small "issue". Applications which lists all the mounted partitions will have duplicate mount points for those two mounts, one from the /media/<uuid> and the other from the bind mount.

Of course, they both point to the same exact location and both work. But I'd like these applications to just list one of those mount points and the more recognizable ones. In my real example, that is /home and /storage.

Is this even possible?

  • dont use those applications – mikeserv Oct 11 '15 at 18:14
  • 1
    it is possible, though. you would have to separate the mount namespaces. doing so might be a bit more annoying to setup than youd like, though. – mikeserv Oct 11 '15 at 18:16
  • 3
    Have you considered using symbolic links instead of bind mount? – ctrl-alt-delor Oct 11 '15 at 20:41
1

It is somewhat possible, depending on the apps you use and if they rely on udisks2.

Adding x-gvfs-hide to the mount options in fstab would hide certain mount points from such apps.

Example:

# forcibly hide device in user interface
/dev/disk/by-id/ata-HITACHI_HTS723232A7A364_E3834563KRG2HN-part1   /home/davidz/Data  auto  defaults,x-gvfs-hide 0 0

https://git.gnome.org/browse/gvfs/tree/monitor/udisks2/what-is-shown.txt

  • Anonymous downvoter, care to explain what's wrong here? – A.P. Oct 11 '15 at 19:25
  • I had to actually add comment=x-gvfs-hode, but it didn't work anyways. The apps in question didn't hide them that is. – Ricardo Amaral Oct 12 '15 at 21:05
  • Why comment=? Where does this come from? Also be aware it's x-gvfs-hide not x-gvfs-hode – A.P. Oct 12 '15 at 21:08
  • I know it's hide, it was a typo. Well, I added just what you said and my partitions were unmountable. I searched a bit and I saw everyone eles recommend the comment= thing, so I added that. – Ricardo Amaral Oct 13 '15 at 12:55
  • The comment= thing is not listed in the official docs, though. Anyway, if x-gvfs-hide doesn't work, you apps do not rely on udisks2. – A.P. Oct 13 '15 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.