20

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
  • 1
    Why would you think a mount --bind would be any different than any other mount?
    – andol
    May 13, 2010 at 14:25

2 Answers 2

36

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

4
  • What do the "none" and 0 0 do?
    – raphael75
    Aug 23, 2018 at 19:09
  • 2
    "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, 2018 at 12:40
  • are source dir and mount point arguments in the same order as for the mount command? Sep 5, 2019 at 15:45
  • @JohnBachir yes, same order
    – Mugen
    Mar 31, 2020 at 11:36
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .