How can I resize the root partition in archlinux?

I recently installed archlinux on my laptop with the following configuration:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme0n1 259:0 0 477G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part
├─nvme0n1p2 259:2 0 10G 0 part /
└─nvme0n1p3 259:3 0 466.4G 0 part /home

I chose 10Gb for the root partition which turned out to be too small, I am wondering if there is any good way to shrink the nvme0n1p3 (home) partition and then expand the nvme0n1p2 (root) partition into the new free space. Both partitions are currently formatted as ext4 filesystems.

Thanks in advance :)

1

1 Answer

It is possible. The easiest way would probably still be to copy the filesystem to external disk or similar, rebuild the partition table as desired (while preserving uuids, labels and similar things to keep things like your fstab functioning) and copy the files back.

Assuming that's not possible/convenient, there are partitioning tools capable of growing, shrinking and moving partitions without disturbing their contents. For example there's gparted which is capable of doing exactly that on ext4 (see ). If you'll choose this tool, you'll need to use the offline version. That means creating live cd or usb stick with the tool, booting into it and using it while the target filesystem is not in use.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like