Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: bobl on June 25, 2016, 12:42:46 AM

Title: resizing partitions on piCore 7.0
Post by: bobl on June 25, 2016, 12:42:46 AM
I want to reduce the size of the package partition mmcblk0p2 in my case but that requires mmcblk0p2 to be unmounted. Doing that though kills ssh. so best I put the resize2fs command into a startup script that runs before mmcblk0p2 gets mounted.  Where should that go?

Title: Re: resizing partitions on piCore 7.0
Post by: bmarkus on June 25, 2016, 02:54:22 AM
Depending on available RAM and installed TCZ packages the easiest way is to copy all used extensions to RAM. Than you can safely umount mmcblk2 and do what you want.
Title: Re: resizing partitions on piCore 7.0
Post by: bobl on June 25, 2016, 05:35:28 AM
do you have a magic incantation for that
Title: Re: resizing partitions on piCore 7.0
Post by: bobl on June 25, 2016, 09:43:09 AM
I managed to do it in the shutdown script by changing the script to

umount /dev/mmcblk0p2
/resize2fs /dev/mmcblk0p2 <size>
umount -afr

...


and copying resize2fs into the root directory, the beauty is that once executed the scripts are wiped clean across the reboot because / is in ram.

After the reboot I reduced the partition size to match in fdisk.