-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto Expand Root #152
Comments
I'm definitely missing something here, probably has to do with file systems: ext4 vs. btrfs. I usually use ext4 for all my Linux systems. I consulted https://en.wikipedia.org/wiki/Btrfs and https://linoxide.com/btrfs-vs-ext4/. I recall reading somewhere that btrfs is superior for high capacity storage disks which serves as the disk space for Raspberry Pi and like systems. With that in mind, I tried using the steps in the script autoexpand_root.sh. For posterity, here's what autoexpand_root.sh currently has:
I then identified the values the script is extracting so I could recreate the command in a console:
I inserted SDHC into Hermes (reg. Gentoo system), exposed as sdc, sdc2 is the 59GB partition
Key line No. 59 from script above:
consulted: http://karelzak.blogspot.com/2015/05/resize-by-sfdisk.html where it is stated "it's possible to enalarge as much as possible:" giving this example:
karelzak's example matches the above line No. 59, so we can Try:
Result:
Tested modified disk on Rpi4; result: expansion failed
So I inserted the SDHC into Hermes and performed a check:
I then compared the results above ("corrupr"?) with another SDHC from an image I obtained from Q Engineering with Bullseye 64 just to see what e2fsck tells me:
And the whole Q Engineering disk shows "83 Linux":
Here are some further comparisons: Q Engineering disk:
GenPi64 disk:
|
For the GenPi64 disk:
|
Definitely a difference (aside from size): ext4 vs. btrfs
So, is the file type of btrfs affecting the tool, sfdisk's, ability to alter the partition? I'm thinking I'll have to go deeper and examine cylinders. |
On a RaspberryPi4, these two report are contradicting each other: df says there is a 3.9 GB limit, parted says we have to the end of the disk, e.g. 59GB+.
|
Logged an inquiry on the Gentoo Forum: https://forums.gentoo.org/viewtopic-p-8694549.html#8694549 |
In Discord, @jonesmz pointed out that line 72 of the script does the btrfs change. I have overlooked that and focused on the sfdisk point. The execution of the command line below fixed the problem.
|
|
Is this still a problem? |
sadly it is. |
Should that work even with btrfs? |
can you elaborate on the question? i'm not sure what you're asking. |
Should the resizing work with an btrfs filesystem? |
It's not an issue of the filesystem, it's an issue of the partition that the root filesystem belongs to not being modifable at runtime. if you use parted / fdisk / gdisk whatever to change the partition table, even if you manually run when you reboot, suddenly it sees the new size, and the resize can proceed accordingly. btrfs can do a live resize, but only if the partition has room to grow. Doing the resize inside the initramfs completely avoids this problem because the initramfs can change the partition table before it pivots root to the real rootfs. |
I downloaded the Raspberry Pi 4B, 3B/B+ 64-bit Lite Version alpha9 (576Kb) posted on the project page gentoo-on-rpi-64bit. I installed the extracted image, genpi64-arm64-openrc-lite-alpha9.img (4,349 KB), on a SanDisk 64GB SDHC. I've been working with several Raspberry Pi builds and had become lulled into the expectation that when I burned an image onto a SDHC, the operating system would on the first run expand to consume the extra disk space.
Here's what is on my system:
In my case, fdisk tells me partition 2 is consuming 59.2 GB:
Yet, df tells a different story:
In discussion with @jonesmz on Discord, he indicated /boot/autoexpand_root.sh "needs to be moved into the initramfs"
In my glee about having Gentoo working on the Rapsberry Pi Zero 2 W, I raced towards getting gstreamer compiled only to discover I had a 4 GB memory limitation and my build stopped at task 2587 of the 6226 needed:
The text was updated successfully, but these errors were encountered: