How can I make the file system (ext4) partition larger?

14 replies [Last post]
nbtrap
Offline
Joined: 09/20/2010

By default, Trisquel 4.0 installs a 10GB partition for the root filesystem on my 320GB drive, and I can't figure out how to make this larger. Is this possible? Could it be done without reformatting and reinstalling?

akirashinigami

I am a member!

I am a translator!

Offline
Joined: 02/25/2010

If you run the Live CD, you should be able to use gparted to resize your root filesystem. I don't think you can do it from the installed system, because I'm pretty sure you can't resize a filesystem while it's mounted, and you can't really unmount your root filesystem.

I'm not sure if gparted is included on the Live CD or not, though. If it's not, you'll have to install it.

nbtrap
Offline
Joined: 09/20/2010

So you're saying I can resize the root file-system EVEN AFTER THE SYSTEM HAS BEEN INSTALLED via GParted Live CD?

That's what I figured. I just want to be sure.

Magic Banana

I am a member!

I am a translator!

Offline
Joined: 07/24/2010

You can. And you do not need the gParted Live CD. Just use the Trisquel one and execute gParted (in the System/Administration menu).

nbtrap
Offline
Joined: 09/20/2010

Thanks for the help.

Ark74

I am a member!

I am a translator!

Online
Joined: 07/15/2009

On Mon, 20 Sep 2010 22:50:26 +0200 (CEST), name at domain wrote:
> You can. And you do not need the gParted Live CD. Just use the Trisquel
one
>
> and execute gParted (in the System/Administration menu).

I think you can't do that, AFAIK editing, formating and resizing a
partition can't be if it's mounted.
The root FS is mounted when the system is loaded, so if i'm not wrong you
won't be able to resize it.
It would be like pulling the carpet you're standing on.

--
Luis A. Guzmán García
http://ark.switnet.org
¡Se Libre! -- http://fsfla.org/selibre/

akirashinigami

I am a member!

I am a translator!

Offline
Joined: 02/25/2010

That's what I meant: by using the Trisquel Live CD. Sorry if I was unclear.

Ark74

I am a member!

I am a translator!

Online
Joined: 07/15/2009

On Mon, 20 Sep 2010 23:11:51 +0200 (CEST), name at domain wrote:
> That's what I meant: by using the Trisquel Live CD. Sorry if I was
> unclear.

Oh!, sorry i got it wrong :P

--
Luis A. Guzmán García
http://ark.switnet.org
¡Se Libre! -- http://fsfla.org/selibre/

nbtrap
Offline
Joined: 09/20/2010

Apparently it's impossible to shrink an XFS filesystem. So I cannot expand my root filesystem unless I significantly shrink the linux-swap partition. Is this a bad idea?

Michał Masłowski

I am a member!

I am a translator!

Offline
Joined: 05/15/2010

> Apparently it's impossible to shrink an XFS filesystem. So I cannot expand
my
> root filesystem unless I significantly shrink the linux-swap partition. Is
> this a bad idea?

For suspend to disk it is useful to have swap not smaller than RAM. For other
uses it depends on memory use by programs. See how much swap use is reported
by top or equivalents.

There are two different ways than shrinking a partition:
- copy it to separate disk and make a new partition, then restore the data
- use this partition for directories which need more space on / (unless they
are needed to make it available, /usr and /var aren't)

nbtrap
Offline
Joined: 09/20/2010

If I make the new partition, and copy the data back over with identical folder hierarchy, will Trisquel automatically know to mount it as the home directory as it does now? That's what I'm worried about.

Michał Masłowski

I am a member!

I am a translator!

Offline
Joined: 05/15/2010

> If I make the new partition, and copy to data back over with identical
folder
> hierarchy, will Trisquel automatically know to mount it as the home
directory
> as it does now? That's what I'm worried about.

Changing the /etc/fstab file will be needed if you change the filesystem type,
and (depending on which is specified there) its UUID, label (these are changed
by formatting) or device file.

When I copied files to use a different partition (on larger disks), I used tar
on a LiveCD, restored with the option to preserve permissions, and then
changed /etc/fstab.

If you change the / partition, then it will require reinstalling the
bootloader.

nbtrap
Offline
Joined: 09/20/2010

Thank you for your help. However, I feel like there would be a very good chance of me screwing something up and having to re-install, so I'm just going to see if I can deal with 10GB.

flop

I am a translator!

Offline
Joined: 02/16/2009

I have never run out of space with standard 10 GB in system partition -I think I have now about 4 GB free-. In any case, if you backup your contents in /home, then reformat that partition (e.g. ext4) and change sizes as you like, you will later have to change the file type in fstab and perhaps the UUID, but that information is provided by gparted. Even if you decide not to do anything, have a look to the line for the /home partition in the file "fstab" in /etc, you will see that the parameters you need to configure in it are just a few and you only need to actually modify two of them (UUID and file type).

quiliro
Offline
Joined: 02/24/2009

2010/9/20 <name at domain>

> By default, Trisquel 4.0 installs a 10GB partition for the root filesystem
> on my 320GB drive, and I can't figure out how to make this larger. Is this
> possible? Could it be done without reformatting and reinstalling?
>

The installation with LVM from the Trisquel CD is the best solution to avoid
these types of problems. Remember it has to be connected to the internet so
that it can download some packages it needs. With a 700 kbps connection it
took about 2 or 3 hours.
--
Saludos/Greetings
Quiliro Ordóñez
593(2)340 1517 / 593(9)821 8696
Even The Troops Are Waking Up
ACTA – Un acuerdo que puede garantizar la crucificción de
internet
GNU should mean "GNU's not
Ubuntu!
"Lo único que se necesita para que triunfe el mal es que los hombres de bien
no hagan nada." Sergei Bondarchuk
Estas son opiniones personales y no representan la posición de organización
alguna.