5

This question has been asked before, but because I have a few more doubts about the process.

I am working in ubuntu, this is what df -h shows:

Filesystem             Size  Used Avail Use% Mounted on
/dev/md0               423G  337G   65G  84% /
tmpfs                   12G     0   12G   0% /lib/init/rw
udev                    12G  188K   12G   1% /dev
tmpfs                   12G     0   12G   0% /dev/shm
/dev/md1               917G  527G  344G  61% /backup

The problem is that now we are using the /dev/md1 for more than just backups, and we have decided to change its name from /backup to /drive2

I want all the content to stay where it is, the only thing that has to change is the name of the drive mountpoint.

Please note however that I have certain symbolic links from the /dev/md0 to the /dev/md1, and they where built using /backup as a reference folder. Will I have to change each symbolic link or will the change be reflected automatically?

Could you please explain the commands necessary and the files to edit?

7

If you change the mountpoint name all your symlinks will break. Here are 2 options you can use:

Option 1

  • Edit the mountpoint name in /etc/fstab to the desired new mountpoint
  • To ensure the symlinks keep working, make /backup a symlink to the new mountpoint:

    ln -s /new/mountpoint /backup
    

Option 2

  • Use a bind mount to specify an alternative mountpoint for your RAID array while keeping the existing /backup mounted.

  • To do this from /etc/fstab, you need to specify bind as the filesystem type and add it to the list of options as well. See this LinuxQuestions Q&A

Note that the second option is Linux-specific.

Edit

Thoughts on option 1

  • Since /backup is currently a mountpoint, you'll need to delete it first so it can be recreated as a symlink. Be very careful to unmount it first as you don't want to delete the actual contents of your partition: only the mountpoint directory.
  • To be extra safe, when deleting /backup, use rmdir instead of rm. I learned this very useful usage of rmdir the hard way :(

Thoughts on option 2

  • This option is a bit more complicated and is specific to Linux. There may be a reason you might prefer it, though. If you go with option 1, anything that once depended on /backup being a mountpoint (i.e. on mountpoint /backup returning true) will break.
|improve this answer|||||

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.