Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Resize root partition upon first boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
EliasJonsson
n00b
n00b


Joined: 18 Oct 2017
Posts: 53

PostPosted: Mon Sep 07, 2020 2:56 am    Post subject: Resize root partition upon first boot Reply with quote

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
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3961

PostPosted: Mon Sep 07, 2020 9:07 am    Post subject: Reply with quote

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.
:D
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55186
Location: 56N 3W

PostPosted: Mon Sep 07, 2020 10:14 am    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55186
Location: 56N 3W

PostPosted: Mon Sep 07, 2020 10:15 am    Post subject: Reply with quote

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
View user's profile Send private message
Sakaki
Guru
Guru


Joined: 21 May 2014
Posts: 409

PostPosted: Mon Sep 07, 2020 12:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
EliasJonsson
n00b
n00b


Joined: 18 Oct 2017
Posts: 53

PostPosted: Mon Sep 07, 2020 1:15 pm    Post subject: Reply with quote

Sakaki,
Thank you very much, that was exactly what I was searching for.
Back to top
View user's profile Send private message
ShorTie
Tux's lil' helper
Tux's lil' helper


Joined: 12 Feb 2006
Posts: 101

PostPosted: Fri Dec 04, 2020 1:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum