Add a parition after install.
It looks like I made my / partition a bit small and now it's running out of space. I looked a bit, and the /usr filesystem seems to be the the big space eater. So, how could I move /usr to a new partition not to clutter up / ?
I'm on Linux Mint 15. |
What is the output of mount?
|
In terminal run
fdisk -l post results |
Quote:
|
Quote:
|
I think the simplest option is to reboot to Mint's liveCD and work with that.
Open gparted and view your disk partitions do you have a partition in mind for /usr ? assuming you do,right click that partition and select information You want to look for the UUID this will be a long string in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx where x is an alphanumeric Note this string will change if you format the partition Mount both the root partition and your intended usr partition ( you should see Hard Drive icons in the 'My Computer' section of the file manger or desktop. ) Open a terminal and : Code:
df -h Code:
cp -a /path/to/root/usr/* /path/to/usr/ Now find the /etc/fstab on your root partition and edit it assuming it looks something like this Code:
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / ext4 defaults 0 1 Code:
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / ext4 defaults 0 1 Assumes /usr is ext4, substitute with appropriate fs. The last number is the order to run fsck when booting. Now when you reboot /usr should be the new partition check with Code:
df -h Code:
rm -rf /path/to/root/usr/* If you wanted, you could go direct and use mv instead of cp -a, reboot, check , reboot, rm. Much quicker and to be honest the risk involved is low You could do all this on the running system, but as files in usr will almost certainly be in use you would need to drop to a single user mode. You may like to read up on that for future reference. |
Looking back, I notice your root is 28G ?
this should be plenty, you might want to look a little further into what is using the space I find ncdu to be great for this Code:
sudo apt-get install ncdu Code:
ncdu -x / |
Thank's a lot for the helpful reply, Firerat! I'll try the your suggestion and see how it goes. Also, ncdu also showed /usr as taking up the most space.
And all the usage is probably from the games I installed so far. /usr is where they all go, right? |
yes, probably the games
with ncdu you can navigate with up/down arrows and <enter> so you can see the usage within each directory. It might make sense to have a separate partition for a subdir of /usr instead of all of it if it is /usr/games that is using most of the space, then you can probably skip the Live CD method by making sure those games are not in use. example assuming /usr/games is the culprit and /dev/sda12 is intended extra partition Code:
sudo mount /dev/sda12 /mnt Note, you can also find the UUID with Code:
ls -l /dev/disk/by-uuid/ Code:
sudo umount /mnt |
oh, and for the future consider LVM
https://en.wikipedia.org/wiki/Logica...er_%28Linux%29 which offers greater flexibility over traditional partitioning. or if you want to live life on the edge https://en.wikipedia.org/wiki/Btrfs and zfs is worth a look https://en.wikipedia.org/wiki/ZFS |
I got it working without problems. I just followed Firerat's suggestions and now I've got /usr on a new partition! Thanks.
|
All times are GMT -5. The time now is 06:15 PM. |