Partitions Resize

General questions.
wquatan
Posts: 52
Joined: August 26th, 2011, 4:33 pm

Partitions Resize

Post by wquatan » February 14th, 2018, 1:52 pm

Hi,

I'm in the need of resizing my IPFIRE partitions.

I know how to repartition Windows-disks, but have never done it on (for) Linux / IPFIRE.
  • Is it mandatory to use gparted or can I use another (Windows-)partitioning tool (which I know/have), such as PartitionGuru ?
  • I have more than enough (overkill) SDA4 space, so can move some to SDA1/SDA3, what sizes are best and futureproof for SDA1/SDA3?
  • Do I need to do / modify something else once the partitions are resized
As said I never did it on / for Linux and don't want to kill my IPFIRE, so any information is welcomed !

rodneyp
Posts: 146
Joined: October 4th, 2010, 2:17 am
Location: Australia

Re: Partitions Resize

Post by rodneyp » February 14th, 2018, 8:28 pm

This generally should not be necessary. sda1/3 don't use much additional space over time. The partitioning paradigm used by IPFire installer simply allocates "the remainder" to sda4, so there is no need to be concerned about unused space there.

Is your sda somewhere close to the minimum 2 GiB size for IPFire ?

fredym
Posts: 512
Joined: November 14th, 2016, 2:45 pm

Re: Partitions Resize

Post by fredym » February 14th, 2018, 8:42 pm

wquatan wrote:
February 14th, 2018, 1:52 pm
[*]I have more than enough (overkill) SDA4 space, so can move some to SDA1/SDA3,
best size for sda1/sda3 are existing .... it is only (intended) for programmes !
sda4 takes all variable content !
Never move variables to "fixed reserved spaces" !
Data only put into variable spaces ( like: /var or additional partitions )


Patitionmangers: if it can handle the partition types, it is o.k. ...

Fred

wquatan
Posts: 52
Joined: August 26th, 2011, 4:33 pm

Re: Partitions Resize

Post by wquatan » February 14th, 2018, 8:46 pm

@rodneyp:

The actual figures :
SDA1: 24mb (81% used)
SDA3: 2gb (46% used)
SDA4: 140gb (1% used)

I had in mind :
SDA1: 64mb
SDA3: 6gb
SDA4: 80gb
unallocated: remaining

What about the questions I asked in the OP ?

Thanks

GrueMaster
Posts: 29
Joined: December 28th, 2017, 2:46 pm

Re: Partitions Resize

Post by GrueMaster » February 15th, 2018, 2:50 am

The 'easiest' solution is to repartition in-place. You can boot to a live Linux image (like Ubuntu Desktop) and use it to resize the partition. The size you listed should be adequate. For the most part, most Linux systems can live in ~32G or less depending on logfile data retention needs (IPFire generates a lot of logs).

The real question is why? It sounds like you have a 1600G drive. What do you want to do with the extra space? If you want to share that space, I'd recommend just adding another drive and sharing it. 60G is not much to share. If you had a much larger drive, that would make more sense. Also, you won't be able to use the extra space with your existing partition scheme. Legacy MBR partitioning only allows for 4 primary partition records. To expand it, you create an extended partition which is simply a pointer to another partition table, but that requires 1 primary partition entry, so you would end up with having to move sda4 to sda5 for this to work (sda4 would become the extended partition table pointer). This is a lot of work for 60G of space, especially when spinning drives run for ~$0.17(US) per Gig (1TB Western Digital 3.5" - $57). Cheaper for smaller drives (if you can find them still).

fredym
Posts: 512
Joined: November 14th, 2016, 2:45 pm

Re: Partitions Resize

Post by fredym » February 15th, 2018, 7:36 am

wquatan wrote:
February 14th, 2018, 8:46 pm
@rodneyp:

The actual figures :
SDA1: 24mb (81% used)
SDA3: 2gb (46% used)
SDA4: 140gb (1% used)

I had in mind :
SDA1: 64mb
SDA3: 6gb
SDA4: 80gb
unallocated: remaining

What about the questions I asked in the OP ?

Thanks
hmm and what content you will add in sda1 and sda 3 ?



Fred

wquatan
Posts: 52
Joined: August 26th, 2011, 4:33 pm

Re: Partitions Resize

Post by wquatan » February 15th, 2018, 8:34 am

I have no plans of sharing the remaining space, that space would remain unallocated. But that's optional and not really a concern. I would leave "some" unallocated space because it makes resizing/repartitioning easier.

Neither do I have plans to add content to SDA1 and SDA3, except probably addons which I assume go into SDA3.
I understood the IPFIRE default for SDA1 is now 64mb, no idea what the actual default for SDA3 is.

The point is I don't like the %-used of SDA1 and SDA3 and having an almost unused SDA4 with a lot of space.

fredym
Posts: 512
Joined: November 14th, 2016, 2:45 pm

Re: Partitions Resize

Post by fredym » February 15th, 2018, 9:51 am

wquatan wrote:
February 15th, 2018, 8:34 am
The point is I don't like the %-used of SDA1 and SDA3
sda3 only will be needed for addons to be installed
a bit look what partition were mounted

and having an almost unused SDA4 with a lot of space.
yes - sda4 con grow quickly - depending on yout log levels.
On the other hand - add a logical partition.... if you want more data (mails?).

(earlier) I thought ..ipfire is a firewall ... but does not seem so...
a real firewall does only run a minimum of needed software - best protected against attacks.
so it should stable, you need only growing data for logging ( = sda4)

Fred

wquatan
Posts: 52
Joined: August 26th, 2011, 4:33 pm

Re: Partitions Resize

Post by wquatan » August 7th, 2018, 6:23 pm

So larger partitions are at least needed for one thing : upgrading to the latest 121-release
No way to do the install due to lack of space.

Meaning resizing became more urgent.

The sequence of the partitions is SDA1-SDA2-SDA3-SDA4, SDA2 being the swap-partition
I managed to resize/move the SDA3 and SDA4 partitions (with PartitionGuru)

But now I'm stuck, no way to move the SDA2 swap-partition (with PartitionGuru), so I can't resize SDA1
Why is that swap-partition not created as last partition at the end of disk-space ?

What can I do without breaking everything ?
Is the sequence (second partition) important ?
Can I delete the swap-partition ?
Recreate a new one at the end of disk-space ?
Should it be the same size and have the same criteria ?
Or is the content important and should I create an image of it ?

fredym
Posts: 512
Joined: November 14th, 2016, 2:45 pm

Re: Partitions Resize

Post by fredym » August 7th, 2018, 8:01 pm

wquatan wrote:
August 7th, 2018, 6:23 pm


But now I'm stuck, no way to move the SDA2 swap-partition (with PartitionGuru), so I can't resize SDA1
swap?? delete it and if needed ceate a new one (later)
swap delete, create with fdisk etc. on CLI (i prefer)

better choice - gparted (even on a live-cd)
Fred

wquatan
Posts: 52
Joined: August 26th, 2011, 4:33 pm

Re: Partitions Resize

Post by wquatan » August 7th, 2018, 8:07 pm

Can I delete it with a PartitionManager (like PartitionGuru) without breaking IPFIRE ?
Aren't there any links in IPFIRE to that partition ?
I don't have a lot of Linux-experience :-(

Thanks

rodneyp
Posts: 146
Joined: October 4th, 2010, 2:17 am
Location: Australia

Re: Partitions Resize

Post by rodneyp » August 8th, 2018, 12:39 am

It appears that wquatan has a very old installation having only 24 MB /boot whereas current installers create 64 MB /boot.
The solution was given in viewtopic.php?f=51&t=21156. Those not acquianted with utility CD such as gparted might be better off creating a backup from IPFire home page and saving the backup to a workstation, then fresh installing core 122.

I did find that with a PAE kernel in core 120 it was more reliable to firstly delete the non-PAE kernel & initramfs, to leave /boot less than half full, before doing the upgrade to core 122. Perhaps this has now been taken care of in the installer ?

wquatan
Posts: 52
Joined: August 26th, 2011, 4:33 pm

Re: Partitions Resize

Post by wquatan » August 8th, 2018, 4:05 pm

Is this a pain !
Really no transition path !?

Problem 1:

I deleted the Swap-Partition and recreated a new one (with Minitool Partition Wizard) : Primary / Linux-swap
The old Swap-partition was too small (256mb) and I have 1gb memory. So I created a larger one and left some unallocated space before the swap-partition.

Result : IPFIRE doesn't see the Swap-partition (if I look at the size specified under "Memory")

Problem 2:

Despite there is unallocated space after SDA1 (Boot) I cannot resize the partition.
Moving seems to work but no way to alter the size.
I wonder if this has something to do with the Partition Type ID 0x83 (Ext2)

Meaning I'm still stuck, and have now an additional Swap-problem >:(

And for every action I have to stop IPFIRE, remove the HDD, connect it to another PC ...............

ITechPro
Posts: 34
Joined: October 11th, 2011, 11:15 am

Re: Partitions Resize

Post by ITechPro » August 8th, 2018, 8:54 pm

Hi,

by creating a new swap partition you'll probably need to format it and modify /etc/fstab.

Before changing anything, I'll advice you to create AND download at least an Ipfire backup file through the web interface under System -> Backup, which enables you to get most of your settings back, when a new installation should become necessary.

If you have access via ssh or are able to login to the console, you can achieve this:

Code: Select all

fdisk -l /dev/sda | grep swap
(shows you the device which holds the swap partition eg. /dev/sda2)

Code: Select all

mkswap /dev/sdaX
(replace X with the partition nr., eg. 2)
note and/or copy the UUID nr. (eg. 62a5088e-1484-4e2f-9eed-e0ffaea9a063), which gets displayed

Code: Select all

vi /etc/fstab
press i to change to INSERT mode
replace the UUID nr. with the new one in front of swap
press ESC key, to leave INSERT mode, and type :wq to write the changes to disk and leave the editor, then

Code: Select all

swapon -a
to load the swap partition

Maybe this helps you...

Regards

rodneyp
Posts: 146
Joined: October 4th, 2010, 2:17 am
Location: Australia

Re: Partitions Resize

Post by rodneyp » August 8th, 2018, 9:42 pm

For wquatan

You should not need to remove the HDD from your IPFire box for any of these operations. A small utility such as http://gparted.sourceforge.net/download.php is capable of booting from a USB flash memory device and being used to modify partitions.

Resizing of partitions and filesystems thereon are actually distinct operations. GParted will do those sequentially and transparently for you. It will also take care of the partition type numbers (swap needs to be 0x82 not 0x83). IPFire runs all primary partitions. If mini-tool created a logical swap partition that might not work in the longer term.

As others have also pointed out it is likely to be much more reliable, as well as quicker, to simply boot IPFire core 122 install from USB stick and later restore your settings from backup.

You don't say which architecture of IPFire you are running nor what HDD size, making it difficult to provide suitable guidance

Post Reply