Re: replacing /usr with a new mountpoint
Andrew Sackville-West <andrew@farwestbilliards.com> writes:
> my reading of man mount suggests that you want
>
> mount --rbind / /mnt
> -------^^^
>
> but its not very clearly written (IMO) so I suggest you
> touch a dummy file in the new /usr and double check whether its in
> /mnt/usr as a test to confirm that the mount of new /usr doesn't carry
> over.
I'm not sure that's right.
Since Linux 2.4.0 it is possible to remount part of the file hierarchy
somewhere else. The call is
mount --bind olddir newdir
After this call the same contents is accessible in two places. One can
also remount a single file (on a single file).
This call attaches only (part of) a single filesystem, not possible
submounts. The entire file hierarchy including submounts is attached a
second place using
mount --rbind olddir newdir
This means that if you have something like this
/dev/sda1 /
/dev/sda5 /usr
Doing a --bind on / will only mount /, not /usr, while --rbind will
mount both / and /usr.
According to the original message, he has the original /usr directory
shadowed by another /usr partition, and what he wants is to remove the
original /usr directory.
At least that's my understanding.
--
John L. Fjellstad
web: http://www.fjellstad.org/ Quis custodiet ipsos custodes
Reply to: