You are not logged in.

#1 2022-07-03 19:27:25

aymanelj
Member
Registered: 2022-05-13
Posts: 36

Increase root partition safely

I initially installed arch dual boot with windows and gave the root partition 40GB. I would like to add 100GB to the root partition. I looked online for solutions, but I am not feeling confident enough resize my partition without being 100% sure I will not lose anything. I will list out my current plan and would like to know if this seems right.

1) Full system backup using rsync to my hard drive.
2) Delete the root partition
3) Install Arch again
4) Make a single 140 GB partition
5) restore the backup using rsync

This is what I am currently planning on doing, please comment on the feasibility of achieving the goal using these steps or if there are any better alternatives. Thanks!

Offline

#2 2022-07-03 19:30:04

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,732
Website

Re: Increase root partition safely

No need to install again, just backup, repartition and rsync back.  Adjust /etc/fstab accordingly and your boot loader.

Offline

#3 2022-07-03 19:32:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,267

Re: Increase root partition safely

Sounds like a good plan. Make sure the hard drive has a linux/posix permissions compatible filesystem or you will break a lot of stuff.

Definitely do the backup, but afterwards is there anything to the right of the root partition? If there isn't you can quite safely grow the root partition and filesystem in place without data loss, see https://wiki.archlinux.org/title/Parted … partitions

Last edited by V1del (2022-07-03 19:32:53)

Offline

#4 2022-07-03 21:50:41

aymanelj
Member
Registered: 2022-05-13
Posts: 36

Re: Increase root partition safely

Thank you for the replies. The current 40GB root partition and the 100GB I am going to add are adjacent. But there are 3 additional partitions to the right of root.  Gparted Partition Screenshot Will that be an issue? I have also noticed that the full system backup command I will run excludes certain directories. The ArchWiki mentions:

The --exclude option causes files that match the given patterns to be excluded. The directories /dev, /proc, /sys, /tmp, and /run are included in the above command, but the contents of those directories are excluded. This is because they are populated on boot, but the directories themselves are not created.

Will arch generate the excluded directories automatically?

Last edited by aymanelj (2022-07-03 21:52:56)

Offline

#5 2022-07-03 22:34:46

yochananmarqos
Member
Registered: 2020-02-05
Posts: 222

Re: Increase root partition safely

I would backup (always backup first) and resize the partition using gparted via live media. If it goes well, no need to do anything else.

Offline

#6 2022-07-03 22:37:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,557

Re: Increase root partition safely

If you want to join p5 and p7 the problem is that p7 is *left* of p5
You'll have to remove p7, move p5 to the position of p7 and then grow p5, https://wiki.archlinux.org/title/Fdisk# … partitions
Afaik parted won't do this.

Will arch generate the excluded directories automatically?

The directories /dev, /proc, /sys, /tmp, and /run are included in the above command, but the contents of those directories are excluded.

Online

#7 2022-07-03 23:03:58

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: Increase root partition safely

parted may not be able to grow a partition to the left, but gparted can*. After making a backup of the root partition, I would use gparted to delete p7 and then grow p5 to the left (you could even just delete part of p7, leaving some free space between p7 and p5, and then grow p5 into the now available space). If everything works properly, you should not need to restore the backup.

I have done similar moves with gparted before, and I usually use a SystemRescue USB to do this, or a gparted live USB. The SystemRescue USB is useful for other things as well, so it is handy to keep around.

*Technically, I think gparted first moves the partition to the left, and then grows it to the right, but it all happens together.

And in any event, there is no need to reinstall.

Offline

#8 2022-07-05 23:40:00

aymanelj
Member
Registered: 2022-05-13
Posts: 36

Re: Increase root partition safely

I currently have a full system backup on my hdd. Can I proceed to deleting the partition now? I am still a bit confused. Do I need to use a bootable usb before deleting and merging the partitions? What happens after I delete the root partition? Is there no way i could somehow make my partitions compatible with LVM and dynamically resize them? It also seems like there are mixed comments about whether a partition can grow to the left or not. Thanks!

Offline

#9 2022-07-06 06:28:27

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,557

Re: Increase root partition safely

A partition cannot technically grow to the left, but it can effectively by moving it leftwards and then growing it to the right.
That's not contentious.
I was simply unaware that gparted automatizes this w/ a nice GUI in which case you should use that.

You'll *have* to do this offline, ie. booting an usb stick. Do not mount any of the partitions you want to change.
You'll have to remove the partition left of the root partition to create the empty space, but do NOT remove the root partition - just move/grow it.

Is there no way i could somehow make my partitions compatible with LVM

You could make the partition left of the root partition a https://wiki.archlinux.org/title/LVM#Physical_volumes create a volume group and a 40+GB logical volume inside, dd the exiting root partition into the new LV and make it the systems new root.
If everything works, remove the old root partion, grow the partition that holds the physical volume and also the physical volume and then manipulate the LVs inside as you see fit.

Online

Board footer

Powered by FluxBB