My Ubuntu LTS box is partitioned as shown in this GParted screenshot. There are separate ext4 partitions for root, usr, home, and a couple of ntfs data partitions (for Windows/Mac VM disk images). /
, /usr
, and /home
partitions are adjacent to each other in this order.
Now it turns out that the /usr
partition would be better off being larger than it is - during a recent update I an error message that it was out of space (there's ~2gb free).
root
has some unused space but not enough to simply move the files in /usr
. But,/home
does have enough space to move all the files in /usr
.
So I want /usr
to have more space. I see two ways -
basically merge
/
and/usr
. Copy (cp -a
) all the files in/usr
to/home
, then delete theusr
partition and expand/
to include the unused space. Then move the/usr
files fromhome
toroot
. Is it enough to simply move/copy the contents to another partition?shrink
/
and add space to/usr
. I am not sure if doing this is straightforward. Is it?
I am not sure which is the better option, and if my approaches make sense. I plan to do it using GParted off a live boot USB. Please advice, if you know how to go about this and which option above is better.
This question here was very helpful but not quite enough.
cp
to do this; maybe old prejudice from broken historical versions of cp that corrupt permissions, but you don't need to create the files on /home anyway. Instead, usetar
(as root) and save the files together as a single tar file and unpack that onto the new merged partition.tar cf /home/tmpsave.tar --one-file-system / /usr
/usr
, put it somewhere safe, then delete the partition containing/usr
and extend the partition containing/
into the now unused/empty space, and finally unpack the tarball into the all new spacious/
. Right? I understand your paranoia aboutcp
,tar
is indeed safer.