# Partition resize

**URL:** <https://community.ipfire.org/t/partition-resize/5207>\
**Category:** Hardware\
**Created:** [18 April 2021 19:07 UTC](https://community.ipfire.org/t/partition-resize/5207 "2021-04-18T19:07:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hjkl](https://community.ipfire.org/user_avatar/community.ipfire.org/hjkl/32/8574_2.png) [@hjkl](https://community.ipfire.org/u/hjkl)\
**Post date:** [18 April 2021 19:07 UTC](https://community.ipfire.org/t/partition-resize/5207/1 "2021-04-18T19:07:24Z")

</div>

Hello,  
After reading as many topics as I could find (not that many on this forum - old one had more like these) I decided to open a new thread for partition resizing tips and tricks.  
Thing is, many of us (me included) have our machines for years and since then some of the original sizez for partitions become too small: usually /boot, but sometimes other too.

Many years used dd to make copies of the partitions especially when I was running ipfire on SDCards.  
So I am quite familiar with this process, but today challenge is to resize that disk dump…

Today case: / is too small; /lib and /usr have each close to 1GB and whole / is 2GB  
Temporary I have cleaned up /lib/firmware by removing firmware for devices not present on my APU board…

But I need to increase the /dev/sda3 that is mounted as /

Current status:  
Disk /dev/sda: 14.9 GiB, 16013942784 bytes, 31277232 sectors  
Units: sectors of 1 \* 512 = 512 bytes  
Sector size (logical/physical): 512 bytes / 512 bytes  
I/O size (minimum/optimal): 512 bytes / 512 bytes  
Disklabel type: dos  
Disk identifier: 0x000dd6f5

```
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 133119 131072 64M 83 Linux
/dev/sda2 133120 2146119 2013000 982.9M 82 Linux swap / Solaris
/dev/sda3 2146120 6340423 4194304 2G 83 Linux
/dev/sda4 6340424 31275183 24934760 11.9G 83 Linux
[root@silver-x86-64 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 2.0G 4.0K 2.0G 1% /dev
tmpfs 2.0G 12K 2.0G 1% /dev/shm
tmpfs 2.0G 624K 2.0G 1% /run
/dev/sda3 2.0G 1.3G 549M 71% /
/dev/sda1 59M 31M 24M 57% /boot
/dev/sda4 12G 1.9G 9.2G 17% /var
/var/lock 8.0M 16K 8.0M 1% /var/lock
none 2.0G 39M 1.9G 2% /var/log/rrd
none 2.0G 492K 2.0G 1% /var/log/vnstat

```

As you can see I have a swap which I never used (I usually run my machine with swapoff because 4GB RAM are enough)

I can easily merge sda2 and sda3 in one partition while booting from an external drive (SDCard) but the trick what is going happen when I am going to dump content saved previously from sda3 to the newly increased partition:

1. Will the size be reduced back to 2GB?
2. Do I need to edit mtab or fstab to point to the new partition UUID?

Anything else?  
Thank you!  
H&M

---

<div class="post-metadata">

**Author:** ![bonnietwin](https://community.ipfire.org/user_avatar/community.ipfire.org/bonnietwin/32/12350_2.png) [@bonnietwin](https://community.ipfire.org/u/bonnietwin)\
**Post date:** [18 April 2021 20:34 UTC](https://community.ipfire.org/t/partition-resize/5207/2 "2021-04-18T20:34:02Z")

</div>

Hi @hjkl

> [@hjkl](#):
>
> Thing is, many of us (me included) have our machines for years and since then some of the original sizez for partitions become too small: usually /boot, but sometimes other too.

I also had that problem in the past. My solution was to do a backup, including logs, save the backup to a safe location and then do a full install from scratch and then restore my backup.

Result was that / was resized to current standards. As mentioned towards the end of blog post

[https://blog.ipfire.org/post/where-did-core-update-140-go](https://blog.ipfire.org/post/where-did-core-update-140-go)

Re-installation time and restore from backup was about 15 to 20 minutes and no problems having to deal with partition resizing etc. All done for you by the install. I did my re-install around April/May 2020.  
Root is now ~25G with 4G used  
Boot is ~110M of which 35M is used

---

<div class="post-metadata">

**Author:** ![jon](https://community.ipfire.org/user_avatar/community.ipfire.org/jon/32/15363_2.png) [@jon](https://community.ipfire.org/u/jon)\
**Post date:** [18 April 2021 20:47 UTC](https://community.ipfire.org/t/partition-resize/5207/3 "2021-04-18T20:47:59Z")

</div>

> [@bonnietwin](#):
>
> My solution was to do a backup, including logs, save the backup to a safe location and then do a full install from scratch and then restore my backup.

+1 - I did the same. It seemed much easier than expected!

> [@Core 139 - Filesystem full](https://community.ipfire.org/t/core-139-filesystem-full/898/19):
>
> Agreed, I found the same: (see New partition layout near bottom of page) I don’t wanna rebuild… I don’t wanna rebuild… I don’t wanna rebuild… waaaah! angry [composure] Its fairly easy to rebuild but I’ve added a few custom addons that I need to find the notes for… time to find my notes!

---

<div class="post-metadata">

**Author:** ![cybermaze](https://community.ipfire.org/user_avatar/community.ipfire.org/cybermaze/32/7265_2.png) [@cybermaze](https://community.ipfire.org/u/cybermaze)\
**Post date:** [20 April 2021 07:47 UTC](https://community.ipfire.org/t/partition-resize/5207/4 "2021-04-20T07:47:44Z")

</div>

It is certainly possible to resize partitions with the right tools, if you know how to.

You should probably only do it, if you have some expertise in doing so.

The backup and reinstall method is clearly the easy and safe option.
