View previous topic :: View next topic |
Author |
Message |
EliasJonsson n00b


Joined: 18 Oct 2017 Posts: 53
|
Posted: Mon Sep 07, 2020 2:56 am Post subject: Resize root partition upon first boot |
|
|
Dear Gentoo community,
I have created a Raspberry Pi 4 image of an 8 GB SDcard.
Now how does one make the system resize its root partition upon first boot to use all available storage capacity on the storage medium that the image was written to? |
|
Back to top |
|
 |
alamahant Advocate

Joined: 23 Mar 2019 Posts: 3961
|
Posted: Mon Sep 07, 2020 9:07 am Post subject: |
|
|
Can you boot the pi with any livecd?
Is this something you can do with pi?
If yes do this.
Or remove the sd card and plug it in to your laptop.
Then run
Code: |
lsblk ####find the name of the partition your Gentoo image is in.
e2fsck /dev/sdxx
resize2fs /dev/sdxx
|
Then reboot.
 |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55186 Location: 56N 3W
|
Posted: Mon Sep 07, 2020 10:14 am Post subject: |
|
|
EliasJonsson,
Most of the Pi distros do this as they don't know what size SD card they will end up on.
The root partition must be the last partition on the SD card, with all the unallocated space after it.
The partition can then be 'grown' into the unallocated space, then the filesystem can be grown to fill the enlarged partition.
Not all filesystems support online resizing. extX is OK.
Have a look at Sakakis 64 bit distro. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55186 Location: 56N 3W
|
Posted: Mon Sep 07, 2020 10:15 am Post subject: |
|
|
Moved from Other Things Gentoo to Gentoo on ARM.
Its one of these _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
Sakaki Guru


Joined: 21 May 2014 Posts: 409
|
Posted: Mon Sep 07, 2020 12:00 pm Post subject: |
|
|
EliasJonsson,
the autoexpand_root OpenRC service from gentoo-on-rpi-64bit is installed by this ebuild, the service script itself may be reviewed here. _________________ Regards,
sakaki |
|
Back to top |
|
 |
EliasJonsson n00b


Joined: 18 Oct 2017 Posts: 53
|
Posted: Mon Sep 07, 2020 1:15 pm Post subject: |
|
|
Sakaki,
Thank you very much, that was exactly what I was searching for. |
|
Back to top |
|
 |
ShorTie Tux's lil' helper

Joined: 12 Feb 2006 Posts: 101
|
Posted: Fri Dec 04, 2020 1:25 pm Post subject: |
|
|
Twas wondering this myself .. :/~
Having done it in Debian and Devuan, all I had to do twas port it to Gentoo.
Which was not more then making up a Gentoo init for it.
It will do either mmcblk0 or sda depending on fstab.
Usage is as simply as copy some files.
growpart to /usr/bin/growpart
growpart.init to /etc/init.d/growpart
Note: Both must be executable !
And a, rc-update add growpart boot
All though it doesn't really matter, the last thing it does is a rc-update -v del growpart.
So it is only run once.
https://github.com/ShorTie8/Gentoo-imager/tree/master/growpart |
|
Back to top |
|
 |
|