How to increase root 's size

9 replies [Last post]
Aprendiz_de_linux
Offline
Joined: 03/02/2014

Hi all,

I am facing difficulties to increase root's size. There is a "popup" saying that i have only something like 330 Mb free. I deleted one game on wine after i saw it and the next thing i did i went to GPARTED to see the disk size and on ext4 , root , has total 13,97 Gb. Used: 12,94 Gb.
I am asking it because yesterday i have installed several games from gnu-linux systems just to test if i like or not and now i am lacking space on disk despite it is basically 1 Tb harddrive.
As you can see on the printscreen images the root is very small comparing with overall size of the disk.

What i want:

I want increase size of root but i dont know how to do it. I tried to unmount like when i deleted hard drive to install Trisquell and hoping to increase it via GUI just "grabbing with the mouse" and to drag the mark of the level to the rigth side thus increasing space but it didnt work.
Any ideas how to solve it?
Thanks in advance.

AttachmentSize
Captura de ecra de 2014-03-29 13:56:08.png113.21 KB
Captura de ecra de 2014-03-29 13:56:34.png113.31 KB
Magic Banana

I am a member!

I am a translator!

Offline
Joined: 07/24/2010

Your file hierarchy lives into two separate partitions: everything in /home is in a partition with an XFS filesystem. The rest of it (i.e., the root partition) is in a partition with an ext4 filesystem. This second partition is almost full because you installed heavy games (a lot of images, musics, etc. that go into the root partition).

XFS is a great filesystem, which is particularly efficient when it comes to manage large files (such as those in /home), but it has one very boring drawback: you cannot reduce it. What you can do, from a Live system, is:

  1. backup (using, for instance, an external disk or the local network and another computer) its content, i.e., the directories bearing the names of the users of the system;
  2. delete the XFS partition and the swap partition;
  3. increase the size of the root partition as much as you want (notice that you do not need a lot much than the current size: because /home is separated, / only hosts the system that does not grow forever);
  4. recreate, in the extended partition, the swap partition (I do not think you need it to be as large as currently: when the computer exhausted all the RAM and starts using the swap, it become so slow that you notice it and start terminating programs) and the the partition for /home (all the remaining space; you may want to choose another filesystem if you feel pissed off by XFS shrinking limitation: ext4 or btrfs if you feel a little bit adventurous: the very modern btrfs is still marked as "experimental" by kernel developers);
  5. take note of the number of those two partitions (something like /dev/sda5);
  6. mount the new (and empty) /home filesystem (you can just double click on the right disk icon in the file browser) and move the back-upped user directories onto it;
  7. mount the extended / filesystem and, in its sub-directory "etc", edit the file named "fstab". For the swap and /home, you want, in the first column (instead of the "UUID=...") the /dev/sdX you took note of (X being a different number for the swap and for /home);
  8. reboot.

Come back here (from the Live system) if you face some troubles. We can help you. Notice that the important point is to not lose your users' data!

Notice that, if you just want a few GB more for /, then you can just take them from the swap partition and never delete (only resize) any partition.

a_slacker_here
Offline
Joined: 06/30/2013

Oh my goodness. I didn't know that xfs had that drawback...

Magic Banana

I am a member!

I am a translator!

Offline
Joined: 07/24/2010

Before going into all of that you can run, from the system (not a Live system) the following command to remove the packages that are archived:
$ sudo apt-get clean

You can also search for the kernels installed on your system (packages whose name start with "linux-") and remove all of them but those related to the latest version (the one you are currently using).

The few GB you will save in this way may be all you need. For a few GB more, you can take them from the sole swap partition (as I already wrote). For even more, well, go through the steps I listed in the previous post.

Aprendiz_de_linux
Offline
Joined: 03/02/2014

I did rigth now $ sudo apt-get clean , but noting happened. I typed again "sudo apt-get clean" and just follow my user name as appeared before even i put the password to root. Maybe i have noting to clean.
And next thing i did , for the package i went to "Gestor de Pacotes Synpatic" (package manager Synaptic , in english? :P) to find for linux- , and appeared only 3.2.0.60.71+6.0trisquel2 , so was not selected but blank. And on Add/remove applications only appears "Vectoroids" ; "hamfax" ; "Gnome Format" ; "Pacemaker GUI". I have followed a post "how to update kernel" and following guide of jxself and it went all ok, so i have the most recent kernel.
CAn i find the olders kernel via terminal? If so how can i do it?
Thanks Magic Banana.

Magic Banana

I am a member!

I am a translator!

Offline
Joined: 07/24/2010

When a command does not say anything, it means it did the job.

You can search the packages from Synaptic. But use the search button (not the "quick filter") and search "linux-" on the package names only. By clicking on the header of the first column you can order the results by status (and choose to have the installed packages first).

Aprendiz_de_linux
Offline
Joined: 03/02/2014

Alrigth Magic Banana. I made step 1 to 2. Inside Gparted i couldnt accede to internet so i was feeling at the same time a bit crazy and adventurous to try things. So in my first time to try i deleted xfs and swap partition without a problem. But after i couldnt increase the root. I dont know why. And the "lecture" of this version of GPARTED it gaves me the bigger harddrive (and only the one available because the other is all formated and disabled by default) as sdb not sda.
After that i tried to to delete just to try to see what would happens. Result: no alocation and all the disk became grey and i said :"uh-oh"...and tried the option to go back but now it was later. At least i think i learn something new because i never did this way. I only used GPARTED just to delete and only delete partitions, and after placing it new operative systems... lol...
The good notice inside of bad notice is that now i can install Trisquel 64 bits and i made backup thanks to your advise! :D

Magic Banana

I am a member!

I am a translator!

Offline
Joined: 07/24/2010

GParted does not effectively do anything until you press the "Apply" button.

I believe you had to remove.resize the extended partition before increasing /dev/sda1.

a_slacker_here
Offline
Joined: 06/30/2013

Hello again mister Aprendiz_de_linux.
How is your day today?

Well the answer is easy, you cannot change a partition size if the partition is mounted. You cannot unmount your partition because all your system is using those in order to work.

Do not worry for the words I used becouse your problem is easilly resolvable. All you have to do is to use Gparted from a live CD; because the partitions you want to change size will not be mounted if you run a system from a live CD.

Please, tell me how It goes.

Aprendiz_de_linux
Offline
Joined: 03/02/2014

Thanks a lot Magic Banana and a _slacker_here. I will do for now the second advice like you said Magic Banana.
Meanwhile i am so tired my eyes hurt seeing on the monitor and need a bit of rest and a bit of sleep.
More later i will do the first advice and i will tell you how it went.
Thanks very much for your attention.