Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have this disk set up like so:

/dev/sda3 mounted to: /usr/local

if I just change this (in fstab, right?) to:

/dev/sda3 mounted to: /usr

What happens? Do I lose anything or does it all just default to the new mount point?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

If you just changed the mount point in your fstab, without copying files over, then the contents that were in /usr/local/ will appear in /usr/. The original contents of /usr/ would be hidden from the OS.

Because /usr/ contains many of your system settings, libraries, binaries, and other important files, I am sure that your system would not work properly after remapping the drive's mount point.

In effect, the OS would not be able to find anything it would be looking for in /usr/ or its subdirectories (including /usr/local). The /usr/ directory is full of libraries which include symbolic links, and some of it's files have very specific ownership and permissions requirements.

I would not suggest changing the mount points, copying, or moving these files unless you have to.

share|improve this answer
    
What if I were to copy over /usr to someplace, change the mountpoint as above and then move that data back to the (new) usr dir? –  Jesse Oct 1 '13 at 5:28
1  
It would be better to copy the contents of /usr into the new partition first and then mount it on /usr. And I would recommend using tar to do the copy. –  Sazhen86 Oct 1 '13 at 8:19
2  
Or use cp --archive. –  Mechanical snail Oct 1 '13 at 8:36
1  
Also remember to move all data that previously was in /usr/local to the "new" /usr/local. –  Andrea Corbellini Oct 1 '13 at 8:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.