Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
41
rated 0 times [  41] [ 0]  / answers: 1 / hits: 76935  / 3 Years ago, sun, november 14, 2021, 5:51:38

When I am doing:



mount --bind dirone dirtwo


After OS reboot the binding is lost.



I am checking binded dirs in /proc/mounts



How can I make these binds permanent without clogging up /etc/fstab ?



Here's one entry from /proc/mounts



/dev/disk/by-uuid/4f5082d7-aba2-4bc7-8d64-3bbb3d773aab /home/username/dir ext4 rw,relatime,data=ordered 0 0

More From » 14.04

 Answers
7

What do you mean "clogging up /etc/fstab"? The best place to put this in is /etc/fstab; that's what it was made for!



All you have to do is add one line after the first mount:



# <device>                                 <dir>                 <type>  <options>                 <dump>  <pass>
UUID=288a84bf-876c-4c4b-a4ba-d6b4cc6fc0d2 /mnt/device ext4 defaults,noatime,nofail 0 2
/mnt/device /srv/binded_device none bind 0 0

[#22367] Sunday, November 14, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
guialk

Total Points: 300
Total Questions: 144
Total Answers: 121

Location: Saint Vincent and the Grenadines
Member since Sat, Sep 11, 2021
3 Years ago
;