FOGProject / fos

FOG Operating System
32 stars 34 forks source link

Add space check for mounted share when capturing an image #67

Closed rluzuriaga closed 1 year ago

rluzuriaga commented 1 year ago

Added check for the total size, used space, used space percentage, and available space for the mounted share. Screenshot from 2023-02-21 16-22-30

Added check for the available space in the mounted share when handling the prepareUploadLocation failure Screenshot from 2023-02-21 16-29-29

Resolves #60

rluzuriaga commented 1 year ago

I accidentally synced the fork after the main code commit so there is a commit for the merge. Not sure how to remove it or if it makes any issues.

Neustradamus commented 1 year ago

@rluzuriaga: https://anush-venkatakrishna.medium.com/how-to-remove-undo-a-commit-from-your-pr-65e2e4e195af

rluzuriaga commented 1 year ago

@Neustradamus Thanks but the merge commit doesn't actually appear when I try that

Sebastian-Roth commented 1 year ago

@rluzuriaga said:

I accidentally synced the fork after the main code commit so there is a commit for the merge. Not sure how to remove it or if it makes any issues.

Don't worry. When merging this we'll just do a "Squash and merge" for it to be a single commit in the end.

rluzuriaga commented 1 year ago

@Sebastian-Roth said:

I just figured we have disk space alerting when saving a partition to the server fails as well - but I think having the pre-flight check is great! (https://github.com/FOGProject/fos/blob/master/Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/lib/funcs.sh#L2234 and also line 2260)

That makes sense, I'll add it to the PR later today.

rluzuriaga commented 1 year ago

@Sebastian-Roth I think I understood your comment wrong. I see in line 2234 and line 2260 this code: Server Disk Space Available: $(df -h /images | awk '{print $4}')

That is pretty much what I am checking for, it just displays it differently. My implementation only displays the space. (ex. 0M, 100M, 10G) The code that is already there in those lines prints out this:

Avail
0

It looks like this: Screenshot from 2023-02-23 10-54-03

I can change those 2 lines to look like this instead: Screenshot from 2023-02-23 11-09-23


The difference is not huge but maybe it's a good idea to standardize this. That being said I will change the wording so that it all matches.