Skip to content
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

dangling files after build eat diskspace. #203

Closed
umlaeute opened this issue Sep 14, 2023 · 1 comment · Fixed by #204
Closed

dangling files after build eat diskspace. #203

umlaeute opened this issue Sep 14, 2023 · 1 comment · Fixed by #204

Comments

@umlaeute
Copy link
Contributor

i noticed that when running consecutive builds, my harddisk fills up.

i'm starting with 62GB of free space, and after the build there are only 49GB.
This is not very exciting, as my workspace/ now contains a 14GB image file.

it's getting interesting, when rebuilding:

sudo rm -rf workspace
sudo ./build_dist

after a successful build, i now only have 36GB of free space. and so on.
i'm doing this on a separate partition where nothing else (to my knowledge) could possibly be eating diskspace.

after a reboot, my diskspace is happily reclaimed and available again.

this strongly hints at some dangling image file, which - although deleted - still needs space allocated, e.g. because some process is still accessing it.

and indeed, after the build i see:

$ sudo losetup -l -a
NAME       SIZELIMIT    OFFSET AUTOCLEAR RO BACK-FILE                                                                                                  DIO LOG-SEC
/dev/loop0         0 272629760         0  0 /media/DATA/CustomPiOS/test/src/workspace/test.img   0     512

after running losetup -d /dev/loop0 the space is properly reclaimed.

so i conclude that the script does not properly detach all disk images

umlaeute added a commit to umlaeute/CustomPiOS that referenced this issue Sep 14, 2023
a /dev/loop* is not a *file*, hence 'test -f' does not work.
it is a block-device, so use 'test -b'

for compat, we leave the 'test -f' intact

Closes: guysoft#203
@guysoft
Copy link
Owner

guysoft commented Sep 14, 2023

Hey,
It can happen, I am not sure of a way to fully fix it tightly.
What I suggest is using the docker method, because after stopping+starting the container all volumes are detached, and the space will be claimed without a reboot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants