Hello,
I DO NOT RECOMMEND THIS - TRY IT ON YOUR OWN RISK
I have increased my / partition from APU2D4 by stopping swap and using the swap partition
- Turn off swap
swapoff -a
- edit fstab and mtab → comment the swap entries.
- Run
fdisk -l
and save the output to a file, copy that file on your laptop/desktop (!!!) → identify the partition number for / (my system used sda3)
4. build Tinycore flash disk and boot the box from it: TinyCore Linux USB installer (pcengines.ch)
- Boot APU from the flash usb with Tiny core and DiskDump the partition identified on point 3 to a file on partition 4 from same internal APU disk (that is faster in case you use in APU and SSD - like I do)
Ex:
umount /dev/sda3
cd /mnt/sda4 #sda4 is the /var partition from IPFIRE
dd if=/dev/sda3 bs=4096 conv=notrunc,noerror,sync of=sda3_mSATA_slash_APU2.img
- Use fdisk pointed to the internal disk from APU and erase the partition that coresponding to / on point 3 (sda3)
ex:
fdisk /dev/sda
-
Show disk partition - there should be a big unused amount of sectors between partition 1 and partition 4. Write down the end of first partition and start of 4th partition
Then erase partition used by / in Ipfire (my case was number 3) -
Create a new Primary partition with SAME NUMBER as the one erased above and use as start sector the end of first partition +1 sector. Fdisk will suggest as end for this partition the previous sector in front of partition 4 (check that with numbers from point above)
Write the new partition table -
Dump back on the new partition the content saved on point 5.
Ex:
dd if=sda3_mSATA_slash_APU2.img of=/dev/sda3 bs=4096 conv=notrunc,noerror,sync
- Mount the partition and check that is readable
Ex:
mound /dev/sda3 /mnt/sda3
ls -l /mnt/sda3
- reboot to IPFIRE and then write /.partresize file
This file will tell IPFIRE to extend the partition to its maximum available size
touch /.partresize
- Reboot and watch how IPFIRE does the resize.
It accomplish that by using /etc/rc.d/init.d/partresize which the developers included in Start (boot) sequence /etc/rc.d/rcsysinit.d/S25partresize
That file will initiate another reboot - be patient - and only at second reboot the resize takes place
here is the output during second reboot:
Mounting remaining file systems... [ OK ]
Activating all swap files/partitions... [ OK ]
Re-sizing root partition...
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/sda3 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/sda3 is now 775913 (4k) blocks long.
Done
My IPFIRE sda3 partition prior to these was 93% used and I had warnings in GUI:
Disk Usage
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.9G 4.0K 1.9G 1% /dev
tmpfs 2.0G 12K 2.0G 1% /dev/shm
tmpfs 2.0G 624K 2.0G 1% /run
/dev/sda3 2.0G 1.7G 144M 93% / -> I was geting warnings in WUI for only 7% free space left
/dev/sda1 59M 35M 21M 63% /boot
/dev/sda4 12G 1.5G 9.6G 14% /var
/var/lock 8.0M 16K 8.0M 1% /var/lock
none 2.0G 504K 2.0G 1% /var/log/vnstat
none 2.0G 48M 1.9G 3% /var/log/rrd
Fdisk (saved at point 3): notice a space between sda1 and sda3 → I have erased the sda2 that was swap
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 133119 131072 64M 83 Linux
/dev/sda3 2146120 6340423 4194304 2G 83 Linux
/dev/sda4 6340424 31275183 24934760 11.9G 83 Linux
After above process
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.9G 4.0K 1.9G 1% /dev
tmpfs 2.0G 12K 2.0G 1% /dev/shm
tmpfs 2.0G 616K 2.0G 1% /run
/dev/sda3 2.9G 1.7G 1.1G 62% / -> This is much better!
/dev/sda1 59M 35M 21M 63% /boot
/dev/sda4 12G 3.6G 7.5G 33% /var
/var/lock 8.0M 16K 8.0M 1% /var/lock
none 2.0G 504K 2.0G 1% /var/log/vnstat
none 2.0G 48M 1.9G 3% /var/log/rrd
New partition table: notice that sda3 is starting immediately after sda1 and expands up to sda4 - 3GB now
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 133119 131072 64M 83 Linux
/dev/sda3 133120 6340423 6207304 3G 83 Linux
/dev/sda4 6340424 31275183 24934760 11.9G 83 Linux