14

I'm having trouble finding an answer for this question

Does mount --bind persist over reboot?

On my CentOS it looks like it doesn't, so I've placed apropriate mount --bind calls in rc.local.

How can I do mount --bind to avoid rc.local scenario?

  • 1
    Why would you think a mount --bind would be any different than any other mount? – andol May 13 '10 at 14:25
27

Create an entry for the bound mount in your /etc/fstab. An example is below.

/path/to/source/dir /path/to/mount/point none bind 0 0

  • What do the "none" and 0 0 do? – raphael75 Aug 23 '18 at 19:09
  • 1
    "none" represents the file system and "0 0" provide configuration used by dump and fsck, respectively. Since this is an existing path and not a unique disk/file system, empty or disabled values are specified for these fields. – nabrond Sep 23 '18 at 12:40
  • are source dir and mount point arguments in the same order as for the mount command? – John Bachir Sep 5 '19 at 15:45
0

You should add the appropriate info into /etc/fstab in order to mount the filesystem at boot.

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.