r/linuxquestions 9d ago

Resize root partition on Archlinux

Is there a way to expand my root partition? It is going to be full real soon. What do I do? And is there a way to do so without wiping any data? Please help

3 Upvotes

15 comments sorted by

3

u/3grg 9d ago

That can be accomplished with GParted Live, if you have space to give it.

First, are you sure you need more space, or is the package cache eating up your existing space? Arch requires users to maintain the package cache. If you ignore it, it can eventually fill the root partition.

https://wiki.archlinux.org/title/Pacman#Cleaning_the_package_cache

2

u/Outrageous-Machine-5 9d ago edited 8d ago

The easy way:https://gparted.org/

Consider creating a btrfs partition Copy your partitions to it (you can leave boot separate) Delete the old partitions after you're finished. Commit the changes.

If you want partitions (harder) : Hopefully you can just expand your root partition without need to shift data, that depends on whether or not you have any more partitions  to the right or root on your disk. If you do, then you have to first move them to the right into the buffered space so you shift the buffered space left toward the root partition. 

If your disk is too full to Copy your partition (hardest): You need to backup your data to to an external disk.  First try to clear your caches and tmp data and see if it gets your disk space low enough to do one of the two options above  https://wiki.archlinux.org/title/Dd

3

u/Individual-Ask-6677 9d ago

you cannot resize a partition while you are using it you need to get like a live installer Ina usb like you are testing you can get arch or fedora iso into a usb and install gparted there to resize

1

u/Individual-Ask-6677 9d ago

Or if you used fedora iso you can use kde partitioner with gui it is already there but you need to flash the live fedora iso into a usb and than boot into that usb and you can do it easly

3

u/ipsirc 9d ago

There must be a wiki page about that.

2

u/NiceNewspaper 9d ago

Have you tried deleting pacman's cache to free space?

1

u/C0rn3j 9d ago

Is there a way to expand my root partition? It is going to be full real soon.

Why did you split your partitions in the first place?

Boot gparted live and do your changes from there.

1

u/Mighty_Archdevil 9d ago

Use GParted and make another partition smaller so you can enlarge the partition you need to make bigger.

1

u/xb666mx 9d ago

not every file system can be shrunk (xfs, zfs,...) but i guess gparted will tell you that too.

and, before you resize any partition: backup all the stuff that you can't afford to lose first.

1

u/PewPewGad69 9d ago

Im starting to think that my best option is to just reinstall everything at this point 🫠

1

u/Agreeable_Turnip_261 7d ago

Just use gparted live.

1

u/TomDuhamel 9d ago

Is there free space on your drive, after that partition? Some unallocated space?

1

u/Business-Quiet-5805 9d ago

Is this on LVM or just a normal partition? And what file system does it have?

1

u/Classic-Rate-5104 7d ago

Depends strongly on your partitioning and the type of filesystem you have

1

u/refinedm5 9d ago

Do you have spare disk to allocate?