[SOLVED] Running out of space on root - Can I resize Partitions?

All Gurus once were Newbies
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. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
trope
Level 4
Level 4
Posts: 279
Joined: Tue Feb 19, 2013 1:10 pm

[SOLVED] Running out of space on root - Can I resize Partitions?

Post by trope »

I am running out of space on my 30GB root and it seems to be mostly due to applications, including a flatpak. I need to use the largest applications already installed and want to install more. I also made a 30 GB partition for Mint 20, which is unused, but which I think is too small.

With the current configuration, can I boot Mint from a USB (since my computer does not have a CD-ROM drive) and increase the size of the current root (Mint 19) and the mint 20 partitions to 40 GBs?

If not, can I transfer some things to an external HD, to allow me to increase Mint 19 and 20 partitions to 40 GB each?

I want to keep sdb2 untouched, which is Windows, and sdb8 is my data partition, where I put basically everything (except what Mint installs automatically to root).
Attachments
partition_table.png
Last edited by trope on Sat Aug 08, 2020 12:21 pm, edited 2 times in total.
linux-rox
Level 4
Level 4
Posts: 327
Joined: Sun Jul 19, 2020 9:17 pm

Re: Running out of space on root - Can I resize Partitions?

Post by linux-rox »

Others will have to comment on whether it's advisable (or even possible) to move an encrypted data partition. If I had this problem, I'd be inclined to create a new partition with the unallocated, mount that at boot, then symlink folders for Flatpaks and Timeshiift. Or you could create two partitions and mount them directly. Alternatively, you could delete swap, shrink home, expand root, then recreate swap (modifying fstab to reflect the new UUID). Obviously you do this from a live session. Be aware you'll have to swapoff, if you're going that route, as live boot grabs it.
User avatar
Pierre
Level 20
Level 20
Posts: 10599
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Running out of space on root - Can I resize Partitions?

Post by Pierre »

for that / root partition .. have an closer look at how many Linux Kernels,
are being kept, and if you can delete a few of them.

- rather than messing with the encrypted partition, via:
Update Manager - View - Kernels . .
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
trope
Level 4
Level 4
Posts: 279
Joined: Tue Feb 19, 2013 1:10 pm

Re: Running out of space on root - Can I resize Partitions?

Post by trope »

linux-rox wrote:
Thu Jul 30, 2020 9:42 pm
Others will have to comment on whether it's advisable (or even possible) to move an encrypted data partition. If I had this problem, I'd be inclined to create a new partition with the unallocated, mount that at boot, then symlink folders for Flatpaks and Timeshiift. Or you could create two partitions and mount them directly. Alternatively, you could delete swap, shrink home, expand root, then recreate swap (modifying fstab to reflect the new UUID). Obviously you do this from a live session. Be aware you'll have to swapoff, if you're going that route, as live boot grabs it.
Thanks for the input. Some clarifications:

I wasn't planning on touching the encrypted partition, I would de-encrypt it, transfer the data to an external drive, do whatever I had to with the encrypted partition, make a new encrypted partition, and transfer the data back.

Timeshift is located on the /data partition.

I guess I didn't want to just make new partitions because I didn't want to lose the 60 GB that is already allocated to Mint 19 and 20. But I haven't used the mint 20 partition yet, so that is currently empty.

The only thing I care about after the root partition is the data partition. So
  • 1. is it possible to delete everything after root, and then can I make that root partition bigger, re-create all the partitions after that, including swap (because I think having a swap is advisable), make a partition for Mint 20, and a new data partition?

    2. Do I need to make another swap for the Mint 20 partition, or can I point it somehow to the same swap?

    3. If it is possible to delete/re-write old partitions, is it going to be bad for the hard drive?
User avatar
Pierre
Level 20
Level 20
Posts: 10599
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Running out of space on root - Can I resize Partitions?

Post by Pierre »

1. not with re-installing the LinuxMint System, again

2. NO .. the same /swap can be used by multi_systems

3.YES .. in order to re-create, as per step 1. it's okay for drive, too.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
trope
Level 4
Level 4
Posts: 279
Joined: Tue Feb 19, 2013 1:10 pm

Re: Running out of space on root - Can I resize Partitions?

Post by trope »

Pierre wrote:
Thu Jul 30, 2020 10:00 pm
1. not with re-installing the LinuxMint System, again
My root partition currently has Mint 19 installed. So even if I remove everything after it, I cannot "expand" that partition while keeping the current installation of Mint 19? Why not, is it because I have the swap after it?
linux-rox
Level 4
Level 4
Posts: 327
Joined: Sun Jul 19, 2020 9:17 pm

Re: Running out of space on root - Can I resize Partitions?

Post by linux-rox »

trope wrote:
Thu Jul 30, 2020 9:54 pm
I guess I didn't want to just make new partitions because I didn't want to lose the 60 GB that is already allocated to Mint 19 and 20. But I haven't used the mint 20 partition yet, so that is currently empty.

The only thing I care about after the root partition is the data partition. So
  • 1. is it possible to delete everything after root, and then can I make that root partition bigger, re-create all the partitions after that, including swap (because I think having a swap is advisable), make a partition for Mint 20, and a new data partition?

    2. Do I need to make another swap for the Mint 20 partition, or can I point it somehow to the same swap?

    3. If it is possible to delete/re-write old partitions, is it going to be bad for the hard drive?
First, to clarify/correct my earlier answer, I misread and thought sdb7 is a home partition. So, never mind about the alternative suggestion.

As for your questions,

#1. Yes, but if you plan to keep both Mint 19 and Mint 20, I think my original suggestion makes more sense. Would be easier too.

#2. As Pierre says, a swap partition can be shared. I doubt you need a 16 GB one, though. Easy to delete and create a new one. Just remember to edit /etc/fstab, as mentioned earlier.

#3. In theory, a small amount of wear-and-tear. Not enough to worry about. Your plan is fine in this respect.
User avatar
AndyMH
Level 12
Level 12
Posts: 4247
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Running out of space on root - Can I resize Partitions?

Post by AndyMH »

Whether or not you can move/shrink an encrypted partition - no idea, but you probably can, just make sure you have an image backup of the drive before you start.

The easiest way to get more space in / is to turn off swap and delete the swap partition and then turn swap back on with a swap file. That will give you another 16GB which should be more than enough. If you want to keep a swap partition, then I'd reduce the size of sdb8 and recreate swap in the space created after sdb8.

The alternative is shrink sdb8 and then move it right along with sdb6/7/8 to create space after sdb5. As sdb8 is +200GB used this will take quite a long time, deleting/moving swap will be a lot quicker.

The only problem I can think of is - your encrypted partition is showing 200GB used. If you boot from a live stick (as long as the encrypted partition isn't /home you should be able to do this booting as normal - you can unmount it) will gparted know that that partition is only partly used and thus be able to resize it? Don't use encrypted partitions, so no idea.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate
linux-rox
Level 4
Level 4
Posts: 327
Joined: Sun Jul 19, 2020 9:17 pm

Re: Running out of space on root - Can I resize Partitions?

Post by linux-rox »

Sigh, yet another correction/clarification. On review, I see the 216 GB in unallocated space is outside sdb3 (the extended partition). So, to add that space to any of the logical partitions, sdb3 would have to be expanded first. Easily done, but a step I neglected to mention. Alternatively, the unallocated space could be used for a new partition (one primary slot is still open) but not two. For two or more new partitions, sdb3 would have to be expanded.
User avatar
AndyMH
Level 12
Level 12
Posts: 4247
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Running out of space on root - Can I resize Partitions?

Post by AndyMH »

On review, I see the 216 GB in unallocated space is outside sdb3
Good call, hadn't spotted that, although extending an extended partition is easy.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate
trope
Level 4
Level 4
Posts: 279
Joined: Tue Feb 19, 2013 1:10 pm

Re: Running out of space on root - Can I resize Partitions?

Post by trope »

AndyMH wrote:
Fri Jul 31, 2020 12:21 pm
The easiest way to get more space in / is to turn off swap and delete the swap partition and then turn swap back on with a swap file. That will give you another 16GB which should be more than enough. If you want to keep a swap partition, then I'd reduce the size of sdb8 and recreate swap in the space created after sdb8.
Is there a difference between a swap partition and a swap file? I did some reading on it and did not get a clear answer/apply it to my particular setup.
AndyMH wrote:
Fri Jul 31, 2020 12:21 pm
The alternative is shrink sdb8 and then move it right along with sdb6/7/8 to create space after sdb5. As sdb8 is +200GB used this will take quite a long time, deleting/moving swap will be a lot quicker.
How much is "quite a long time", do you mean hours? Days?
trope
Level 4
Level 4
Posts: 279
Joined: Tue Feb 19, 2013 1:10 pm

Re: Running out of space on root - Can I resize Partitions?

Post by trope »

I had to do some research on a lot of the terms you mentioned such a mounting, swapoff, mounting directly, etc, but not sure that I understand.
linux-rox wrote:
Thu Jul 30, 2020 9:42 pm
Others will have to comment on whether it's advisable (or even possible) to move an encrypted data partition. If I had this problem, I'd be inclined to create a new partition with the unallocated, mount that at boot, then symlink folders for Flatpaks and Timeshiift.
Right now isn't everything from sdb3 to sdb8 mounted at boot? Or is the "main" sdb3 considered mounted at boot only, and the idea is that I would switch that to the new partition I would create (say sdb4), but I could make symlinks to everything currently installed on sdb3? So essentially I would be using 2 different partitions as one?
linux-rox wrote:
Thu Jul 30, 2020 9:42 pm
Or you could create two partitions and mount them directly.
I know you clarified that I can only add 1 partition, but if I could add 2 partitions, what does it mean mount them directly?
linux-rox wrote:
Thu Jul 30, 2020 9:42 pm
Alternatively, you could delete swap, shrink home, expand root, then recreate swap (modifying fstab to reflect the new UUID). Obviously you do this from a live session. Be aware you'll have to swapoff, if you're going that route, as live boot grabs it.
If I boot from a USB (since the computer does not have a CD-ROM drive), how do I swapoff, is it something I have to do explicitly? Does it mean that I cannot do something to the swab when adjusting/deleting/resizing partitions because the live boot is using the swap partition (sdb6)?
trope
Level 4
Level 4
Posts: 279
Joined: Tue Feb 19, 2013 1:10 pm

Re: Running out of space on root - Can I resize Partitions?

Post by trope »

Also I am reading that I don't need so much space for swap, a rule of thumb for 16 GB RAM is 1/2 of that (https://opensource.com/article/18/9/swa ... ux-systems), so it is reasonable for me to reduce the swap by 1/2?
Or does using a virtual machine frequently mean that i should keep the swap at 16 GB? Not sure that there is a way to historically see how much resources I have used and how much swap is necessary.
linux-rox
Level 4
Level 4
Posts: 327
Joined: Sun Jul 19, 2020 9:17 pm

Re: Running out of space on root - Can I resize Partitions?

Post by linux-rox »

Frankly, I think I'm making this more difficult by introducing clever ideas, so I'll explain about swapoff and suggest you go ahead and do this the way you originally intended. So, the reason you have to swapoff is that GParted can't modify a partition which is being used. Happily, it's easy to do, just not something you probably would have thought of (stumped me the first time). Right-click in GParted; swapoff will be one of the options.
trope
Level 4
Level 4
Posts: 279
Joined: Tue Feb 19, 2013 1:10 pm

Re: Running out of space on root - Can I resize Partitions?

Post by trope »

So what I'm thinking at the moment (which might be modified depending on addl responses):

turn off the swap in gparted.
Remove sdb6 and sdb7 and allocate 11 GB of it to sdb5.
Re-create a swap partition of 8 GB.
Combine the remaining free space into sdb8 (if it is possible). and take off 40 GB at the end to make into a new partition where I will install Mint 20.
Leave the 216 GB unallocated in case I decide to put something else there later? B/c I don't need 200 GB for mint 20.

How do I recreate swap (modifying fstab to reflect the new UUID)?
I need to boot off of a USB that has Mint on it to do all of the above? Does Mint come with Gparted?
User avatar
AndyMH
Level 12
Level 12
Posts: 4247
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Running out of space on root - Can I resize Partitions?

Post by AndyMH »

trope wrote:
Sat Aug 01, 2020 2:43 am
How do I recreate swap (modifying fstab to reflect the new UUID)?
I need to boot off of a USB that has Mint on it to do all of the above? Does Mint come with Gparted?
Yes, the install media has a copy of gparted. Do all the following having booted from it.

Run gparted and use it to create a new swap partition (right click in the unallocated space), lets assume you have extended your extended partition (sdb3) and created a new logical partition, say sdb9, as your new swap partition. Make sure you select linux-swap as the file system type and you delete the old swap partition.

Then open a terminal and type blkid to find out its UUID, last line below (yours will be different):

Code: Select all

andy@T432 ~ $ blkid
/dev/sdb1: LABEL="winback" UUID="75A5DEC354E4FD24" TYPE="ntfs" PTTYPE="dos" PARTUUID="720032f0-01"
/dev/sdb2: LABEL="ultrabay" UUID="fb689910-e942-46e1-b03d-e7032e0e36bb" TYPE="ext4" PARTUUID="720032f0-02"
/dev/sdc1: UUID="c073eb56-b3ae-4641-ad35-b2c49bfa74de" TYPE="ext4" PARTUUID="e2b205fe-01"
/dev/sdc2: UUID="95cc8b9f-d95d-4bbb-918e-56f36856b1b6" TYPE="ext4" PARTUUID="e2b205fe-02"
/dev/sdc3: UUID="f049c973-29d4-4c2d-8b4f-82ce86b81c29" TYPE="swap" PARTUUID="e2b205fe-03"
Now edit /etc/fstab. Easiest way is open up the file manager (nemo if cinnamon) and navigate to the / partition on your system (not / on your install media), then to /etc, scroll down to find fstab and double click on it to edit.

Find the line with swap, e.g.

Code: Select all

UUID=f049c973-29d4-4c2d-8b4f-82ce86b81c29 none swap sw 0 0
replace the UUID with the new UUID for the new swap partition you created. Save.

Reboot. If mint hangs for 90 seconds you made a mistake (mint looking for and not finding the swap partition).
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate
linux-rox
Level 4
Level 4
Posts: 327
Joined: Sun Jul 19, 2020 9:17 pm

Re: Running out of space on root - Can I resize Partitions?

Post by linux-rox »

AndyMH wrote:
Sat Aug 01, 2020 5:24 am
Now edit /etc/fstab. Easiest way is open up the file manager (nemo if cinnamon) and navigate to the / partition on your system (not / on your install media), then to /etc, scroll down to find fstab and double click on it to edit.
I'm sure you know this, but of course File Manager has to be opened as Root or Administrator for right-click to open a config file for editing with elevated privileges. Otherwise, it will be opened read-only.
User avatar
AndyMH
Level 12
Level 12
Posts: 4247
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Running out of space on root - Can I resize Partitions?

Post by AndyMH »

Running from a live install usb, I think you are root anyway, could be wrong.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate
linux-rox
Level 4
Level 4
Posts: 327
Joined: Sun Jul 19, 2020 9:17 pm

Re: Running out of space on root - Can I resize Partitions?

Post by linux-rox »

Live session is the same, except don't need to enter a password when select the Open as Root/Admin option.
trope
Level 4
Level 4
Posts: 279
Joined: Tue Feb 19, 2013 1:10 pm

Re: Running out of space on root - Can I resize Partitions?

Post by trope »

AndyMH wrote:
Fri Jul 31, 2020 12:21 pm
The alternative is shrink sdb8 and then move it right along with sdb6/7/8 to create space after sdb5. As sdb8 is +200GB used this will take quite a long time, deleting/moving swap will be a lot quicker.
It took a few hours.
Post Reply

Return to “Newbie Questions”