How can I shrink a partition so that I could expand an another partition?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
psg420
Level 1
Level 1
Posts: 4
Joined: Thu May 26, 2022 7:10 am

How can I shrink a partition so that I could expand an another partition?

Post by psg420 »

Code: Select all

Drives:    Local Storage: total: 476.94 GiB used: 56.78 GiB (11.9%) 
           ID-1: /dev/nvme0n1 vendor: SK Hynix model: HFM512GD3JX016N size: 476.94 GiB 
Partition: ID-1: / size: 18.21 GiB used: 12.34 GiB (67.8%) fs: ext4 dev: /dev/nvme0n1p7 
           ID-2: /boot size: 462.0 MiB used: 258.8 MiB (56.0%) fs: ext2 dev: /dev/nvme0n1p6 
           ID-3: /home size: 184.17 GiB used: 22.06 GiB (12.0%) fs: ext4 dev: /dev/nvme0n1p9 
           ID-4: swap-1 size: 7.63 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/nvme0n1p8
My root directory is full, I wanted to take half the free space of my home to expand my root?.
Is there any way I could do that?.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
decrepit
Level 5
Level 5
Posts: 859
Joined: Mon Dec 03, 2018 4:07 am
Location: Mandurah Western Australia

Re: How can I shrink a partition so that I could expand an another partition?

Post by decrepit »

I'm no expert.
But first think to do is Back up!!!!!!!
I don't think you need to increase it by half your home. just double existing / should be fine. I have a 40GB partition for / that's only half full

You need to use a live USB/DVD, device as you can't alter mounted systems. Your installation media will have gparted in it. With that you can shrink your home partition.
I've never done this, but I think you can then move the boot partition into that space, then expand your / partition into the vacant space.

But check on this before proceeding, maybe an expert will come along and help more
User avatar
antikythera
Level 15
Level 15
Posts: 5721
Joined: Thu Jul 02, 2020 12:52 pm
Location: Cymru

Re: How can I shrink a partition so that I could expand an another partition?

Post by antikythera »

You'd need to shift the swap partition too as it is in the middle of root and home (going by the nvme partition numbers at the end of the output lines). Leave boot alone though.
I’ll tell you a DNS joke but be advised, it could take up to 24 hours for everyone to get it.
User avatar
AndyMH
Level 21
Level 21
Posts: 13759
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: How can I shrink a partition so that I could expand an another partition?

Post by AndyMH »

Again, guessing from the partition numbers you are dual booting. Yes use gparted, yes boot from your install stick as you cannot change a mounted partition and booting normally you cannot unmount /, /home and boot. 30GiB should be adequate for / unless you plan to hibernate. My / is 20GiB used, lot of stuff installed, but no flatpaks, snaps or appimages.

Why have you got a separate boot partition, it is not needed? You will have to monitor that, as you install new kernels it will fill up, so when you do software updates, each time you get a kernel update you are going to have to remember to use update manager to remove the old kernels. Keep the current kernel and one previous.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
ajgreeny
Level 7
Level 7
Posts: 1662
Joined: Mon Nov 19, 2007 3:27 pm

Re: How can I shrink a partition so that I could expand an another partition?

Post by ajgreeny »

When asking questions of this sort it can be much more revealing to see a screenshot of a gparted (or disks) window which shows more clearly the position on disk of partitions. Partition numbers do not always sit on disk in their numerical order which can cause d9ifficulties when wishing to enlarge one or move it.
psg420
Level 1
Level 1
Posts: 4
Joined: Thu May 26, 2022 7:10 am

Re: How can I shrink a partition so that I could expand an another partition?

Post by psg420 »

ajgreeny wrote: Mon Jun 27, 2022 5:53 am When asking questions of this sort it can be much more revealing to see a screenshot of a gparted (or disks) window which shows more clearly the position on disk of partitions. Partition numbers do not always sit on disk in their numerical order which can cause d9ifficulties when wishing to enlarge one or move it.
Attachments
Screenshot from 2022-06-27 18-07-19.png
User avatar
AndyMH
Level 21
Level 21
Posts: 13759
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: How can I shrink a partition so that I could expand an another partition?

Post by AndyMH »

Confirms what pbear said, you will need to shrink and move home right, then move swap right so that the unallocated space is after /, then you will be able to expand it.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
axrusar
Level 7
Level 7
Posts: 1515
Joined: Sat Jan 30, 2021 5:30 pm

Re: How can I shrink a partition so that I could expand an another partition?

Post by axrusar »

psg420 wrote: Mon Jun 27, 2022 3:32 am
My root directory is full, I wanted to take half the free space of my home to expand my root?.
Is there any way I could do that?.
I had pretty much the same issue more than a year ago. Check here:
viewtopic.php?f=46&t=342339&p=1977675&h ... d#p1977675
Linux Mint Una Cinnamon 20.3 Kernel: 5.15.x | Quad Core I7 4.2Ghz | 24GB Ram | 1TB NVMe | Intel Graphics
Image
pbear
Level 16
Level 16
Posts: 6569
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: How can I shrink a partition so that I could expand an another partition?

Post by pbear »

AndyMH wrote: Mon Jun 27, 2022 6:29 am Confirms what pbear said ...
I did? :shock:

psg420, the live session will mount the swap partition automatically. Before you can move it, you'll have to swapoff. As I recall, it's a right-click option in GParted. For future reference, putting swap between the system and home partitions wasn't a great idea. Nor was setting up a boot partition.
Locked

Return to “Beginner Questions”