guysoft / CustomPiOS

A Raspberry Pi and other ARM devices distribution builder
GNU General Public License v3.0
516 stars 150 forks source link

Bug /dev/loop0 Partition don't follow the config to resize #199

Closed Neko-vecter closed 1 year ago

Neko-vecter commented 1 year ago

After commit d8c63803c17a3bcab6eb61c14280c5a9a4c16711. Cannot create a larger partition for img and and system /dev/loop0 always the size of original img. In my case I use raspbian (64bit). So, the root partition around 1.7G.

The df -h look like below /dev/loop0 1.7G mount on workspace/mount /dev/loop1 256M mount on workspace/mount/root

in config file I set BASE_IMAGE_RESIZEROOT=4500

This issue starting at 06d9bdbb7077a792c7a5057e9a44cc384dfc87c3 it is not possible to use the configuration to create a larger disk partition.

I think it might be related to the modification of common.sh. Based on the commit logs, support for Btfs was added in 06d9bdbb7077a792c7a5057e9a44cc384dfc87c3 version.

System info. Screenshot-test-system-info


Update 2023/08/01

Things I try.

What change in 06d9bdbb7077a792c7a5057e9a44cc384dfc87c3

-Neko.vecter

guysoft commented 1 year ago

Hey, what image are you building? Could you provide a build log so I can determine if there some edge case where it detects what filesystem its resizing? That code does stuff to resize BTRFS systems, but its likely you are using EXT4

Neko-vecter commented 1 year ago

Hey, what image are you building? Could you provide a build log so I can determine if there some edge case where it detects what filesystem its resizing? That code does stuff to resize BTRFS systems, but its likely you are using EXT4


The image I am trying to building is mainsailos. The img I am using is Raspbian 64bit ver. (It seems to be a EXT4 img)


I think it's the if statement in common.sh that's causing the problem.

The code below is the screenshot of common.sh. The line 300 if statement it was skipped for unknown reasons. (not sure if I miss some dependencies to cause this issue).

Screenshot 2023-08-20 221618

The code below is skipped code in this if statement. (The code EXT4 filesystem need)

e2fsck -fy $LODEV
resize2fs -p $LODEV

Then I swap the function function enlarge_ext() to previous version that work. The partition resize normality.

It seems this issue can be solved by adding a fallback. Like add else at the end? and run the code that EXT4 need?


Also, what dependence I need? The dependence I install "aria2, coreutils, jq. p7zip-full, qemu-user-static, zip". Or? Do this is somethings only in GitHub Action?

-Neko.vecter

guysoft commented 1 year ago

Ok, pushed an echo that should print the filesystem line result if it can't determine, could you build and paste that result? That way we can figure why its failing.

Neko-vecter commented 1 year ago

Ok, pushed an echo that should print the filesystem line result if it can't determine, could you build and paste that result? That way we can figure why its failing.

image

I know why! I am missing dependence file. It can solve by using sudo apt install file. This may be due to my system installation. (Ubuntu minimal)

I think we need add docs. list what dependence need? Also, add a script to install the dependence that CustomPiOS need.

-Neko.vecter

Neko-vecter commented 1 year ago

Since problem solved... I think we can close this issue?

Conclusion: This issue cause by missing dependence that common.sh need. The dependence file is missing by system installation way (Ubuntu minimal).

-Neko.vecter