My /usr folder needs to get moved to a new partition. How can I do this without erasing the contents?
Can this be done while Ubuntu is running, or do I need to use the LiveCD for this?
|
My Can this be done while Ubuntu is running, or do I need to use the LiveCD for this? |
||||
|
|
|
It would be safest to use a Live CD, but you could do:
See below for details on each step. Note that you can't mount the new partition on Copying the filesI would use
Editing /etc/fstabYou need to know the UUID of your new partition. You can see the mapping by doing:
And then add this line to
Change the UUID to your UUID, and change Delete the old filesAfter the reboot, the old files in
But some slight mistyping (say, hitting Enter when you'd only typed |
|||||||||||||||||||||
|
|
Attention: I have no idea what I'm doing, I'm just copying commands and doing as suggested by the others. This may be the incorrect way to do it, but it works for me (for now, at least). This is how I've done it (following the Hamish's answer and the comments):
|
|||||||||||||||||
|
|
Since most libraries that are used are in /usr, I would not recommend to move this directory while running Ubuntu. In fact, you probably get error messages when you try to do this. Hence, the best is to use the LiveCD. You can use several possibilities to move/copy the files cp, rsync etc. you want to make sure that any symlinks are created and not just copied. cp and rsync both have options for this. After moving the files to the other partition you need to add another mount in /etc/fstab to mount the new partition to /usr. |
|||
|
|