How to mount a directory or device to a new location

|

Sometimes it is necessary or beneficial to mount a directory or device to another, or second, location. This can be done easily in linux.


Step 1 Make sure the folder or location you are mounting to exists and is an empty folder. Otherwise it may not work, or if there is something in the folder before-hand it may disappear until the old directory is unmounted again.

Step 2 in a terminal, type the following:

"sudo mount --bind [OLDLOCATION] [NEWLOCATION]" where [OLDLOCATION] is the location that the directory or device is currently mounted, and [NEWLOCATION] is where you would like it to be mounted.

Step 3 An example would be: "sudo mount --bind /home/ncarlson/anoldfolder /home/ncarlson/newmount". This will mount the folder "anoldfolder" to the folder "newmount".

0 comment:

Post a Comment

 

©2009 computer technology World | Template Blue by TNB