Create new mount point(/backup) from existing partition

5,958

Another solution is to make a Bind mount, which will "link" the two directories together.

Extract from mount man page :

 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.

So do something like :

mount --bind /home/backup/ /backup/

All you have to do next is to make this permanent by adding the corresponding line to /etc/fstab

Share:
5,958

Related videos on Youtube

Ram
Author by

Ram

:)

Updated on September 18, 2022

Comments

  • Ram
    Ram almost 2 years

    i have 2 partition on cenos 6.4 in SOFT RAID 1.

    my current mounted partitions(df -h):

    Filesystem            Size  Used Avail Use% Mountedon
    /dev/md1               20G  5.4G   14G  29% /
    /dev/md2              897G  680M  851G   1% /home
    

    How to mount /backup in /dev/md2 ? or

    How to create new mount point for /backup?

    • terdon
      terdon over 10 years
      What's backup? Is it another partition? Partitions are mounted at directories, not the other way around. Please edit your question to clarify what you are trying to do. Are you trying to create a new partition in /dev/md2 and mount that as backup?
    • mveroone
      mveroone over 10 years
      What you could also do is backup /home's content, remove/shrink the partition and create new ones as needed.
  • Ram
    Ram over 10 years
    i'll take syn backup /home to /backup. any problem?
  • mveroone
    mveroone over 10 years
    Then you'll have /home subdirectories in /backup also =)