You are not logged in.

#1 2020-09-20 12:10:56

Flavoured-Goo
Member
Registered: 2020-08-17
Posts: 31

[SOLVED] Resize and repartition root partition

I wanted to have a separate common partition for Windows and Arch so Is there a way to repartition Arch's root partition ? I wanted to be sure before poking around on my own and possibly losing my data

Last edited by Flavoured-Goo (2020-09-20 20:28:04)

Offline

#2 2020-09-20 12:19:33

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,648
Website

Re: [SOLVED] Resize and repartition root partition

Sure, use partitioning tools. Of course, depending on what filesystem you used for the rootfs, you may not be able to shrink it.

If you want more specific advice, you're going to have to give us a lot more information about your setup.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2020-09-20 12:33:36

Flavoured-Goo
Member
Registered: 2020-08-17
Posts: 31

Re: [SOLVED] Resize and repartition root partition

UEFI with GPT. The only linux partition I have is the primary root partition and a swap, the rest are Windows partitions, the primary root partition is a regular ext4 filesystem. Correct me if i'm wrong, i'm still learning, but partitioning my root partition would require it to be unmounted right?

Last edited by Flavoured-Goo (2020-09-20 12:42:59)

Offline

#4 2020-09-20 12:42:54

loqs
Member
Registered: 2014-03-06
Posts: 19,044

Re: [SOLVED] Resize and repartition root partition

Altering the partition table can be done with filesystems mounted.  For resizing an ext4 filesystem see `man 8 resize2fs`.

Last edited by loqs (2020-09-20 12:43:18)

Offline

#5 2020-09-20 12:43:01

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,687

Re: [SOLVED] Resize and repartition root partition

Still not clear what you're trying to do:

I wanted to have a separate common partition for Windows and Arch

You already have a separate partition - one for Windows and one for Arch.
Is your intention to have a separate partition you can access from both Windows and Arch?
Important before doing anything. Always have a backup.

Last edited by d_fajardo (2020-09-20 12:43:36)

Offline

#6 2020-09-20 12:47:47

Flavoured-Goo
Member
Registered: 2020-08-17
Posts: 31

Re: [SOLVED] Resize and repartition root partition

Yes a separate NTFS partition since it will be readable and writable by WIndows as well as Arch is what I'm trying to acheive. Hence I'm trying to repartition my rootfs to make that small NTFS partition

Offline

#7 2020-09-20 14:21:03

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,687

Re: [SOLVED] Resize and repartition root partition

Have a look at 'man 8 resize2fs' as loqs suggested. According to that shrinking a partition requires that the partition is unmounted which means you have to do it on a chroot environment with an archiso.
Shrinking risks data loss so make sure you have a backup.

Offline

#8 2020-09-20 14:42:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,517
Website

Re: [SOLVED] Resize and repartition root partition

You could also acheive this without repartitioning.  Just mount the windows partition, then - if you want to for convenience - bind mount the directory you intend to share.

1. Create %HOMEPATH%\shared or whatever you'd want it called on Windows
2. Mount the windows partition under /mnt/windows in linux
3. Bind mount /mnt/windows/path/to/shared to $HOME/shared in linux

This would resulted in a "shared" directory in your user's home in both windows and linux but without requiring any additional partition.  As a side-benefit, you wouldn't need to pre-define a size limit for it as it would just use space on the existing windows partition.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2020-09-20 16:02:36

Flavoured-Goo
Member
Registered: 2020-08-17
Posts: 31

Re: [SOLVED] Resize and repartition root partition

@Trilby I don't want to do anything on my windows partition as my is already pretty small in comparison to the linux one that has tons of free space. I'd much rather repartition the linux one to use up the free space

Offline

#10 2020-09-20 16:06:36

Flavoured-Goo
Member
Registered: 2020-08-17
Posts: 31

Re: [SOLVED] Resize and repartition root partition

So correct me if i'm wrong I would need to first resize the rootfs with resize2fs while it's unmounted after which I then need to resize the partition with something like fdisk right? Also, would gparted alone be able to accomplish the same thing ?

Offline

#11 2020-09-20 19:44:47

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,687

Re: [SOLVED] Resize and repartition root partition

After shrinking your rootfs (unmounted as you said), you will then have an unallocated space in the drive. Just format that drive and for what you're intending to do, with ntfs, so both Windows and arch can recognize it. You can use gparted.

Offline

#12 2020-09-20 20:27:14

Flavoured-Goo
Member
Registered: 2020-08-17
Posts: 31

Re: [SOLVED] Resize and repartition root partition

Alright, will do. Thanks a  lot everyone!! Solved!

Offline

Board footer

Powered by FluxBB