Re: sysupdate and space check
Luke A. Call writes: > On 2022-10-26 11:57:23-, Stuart Henderson > wrote: > > On 2022-10-24, Peter Fraser wrote: > > > I make a stupid mistake; I didn't check partition sizes before doing a > > > sysupgrade. > > > sysupgrade ran out of space or /usr in the middle of the upgrade. > > > I know I should have checked first but it would be nice if sysupgrade did > > > warn me. > > > The site was a 20-minute drive away, and their down time was a lot longer > > > then I expected. > > > > It would be nice, but it's tough to reliably test this without actually > > extracting the files (and a warning with many false triggers wouldn't be > > all that much use either ..) > > Thanks for that info, it is interesting. > > I'm just me, but would definitely prefer a warning that > suggests a potential problem and says what to "Might be too small" isn't very helpful without context. And where's the unnecessary, complicated and fragile pipeline? How about this: # Find the length of the string encoding the size of the smallest # physical partition (just using /usr and/or / would be boring): smallest=$(df | awk '/^\// {print $2}' | sort -n | head -n1 | wc -c) # Complain if it's too small: if (( $smallest < 10 )); then echo "Your storage is partitioned like it's the 20th century." fi For the real modern touch you can make the test abort unconditionally. if (( $smallest < 10 )); then echo "You should not be thinking about partitions." echo "Aborting in case you hurt yourself." exit 0 ## Return 0 because errors are scary. fi Matthew
Re: sysupdate and space check
Luke A. Call wrote: > On 2022-10-26 11:57:23-, Stuart Henderson > wrote: > > On 2022-10-24, Peter Fraser wrote: > > > I make a stupid mistake; I didn't check partition sizes before doing a > > > sysupgrade. > > > sysupgrade ran out of space or /usr in the middle of the upgrade. > > > I know I should have checked first but it would be nice if sysupgrade did > > > warn me. > > > The site was a 20-minute drive away, and their down time was a lot longer > > > then I expected. > > > > It would be nice, but it's tough to reliably test this without actually > > extracting the files (and a warning with many false triggers wouldn't be > > all that much use either ..) > > Thanks for that info, it is interesting. > > I'm just me, but would definitely prefer a warning that > suggests a potential problem and says what to > check to be sure, over having to do a recovery. I do follow the > instructions and check it (so far, barring mistakes), but I imagine that > the program can still, without extracting the files, check it as well as > I would (df -h...), but more reliably. here you go, you can use this diff. Index: sysupgrade.sh === RCS file: /cvs/src/usr.sbin/sysupgrade/sysupgrade.sh,v retrieving revision 1.48 diff -u -p -u -r1.48 sysupgrade.sh --- sysupgrade.sh 8 Jun 2022 09:03:11 - 1.48 +++ sysupgrade.sh 26 Oct 2022 17:02:35 - @@ -92,6 +92,8 @@ done (($(id -u) != 0)) && err "need root privileges" +echo your /usr might be too small + if $RELEASE && $SNAP; then usage fi
Re: sysupdate and space check
On 2022/10/26 10:48, Luke A. Call wrote: > On 2022-10-26 11:57:23-, Stuart Henderson > wrote: > > On 2022-10-24, Peter Fraser wrote: > > > I make a stupid mistake; I didn't check partition sizes before doing a > > > sysupgrade. > > > sysupgrade ran out of space or /usr in the middle of the upgrade. > > > I know I should have checked first but it would be nice if sysupgrade did > > > warn me. > > > The site was a 20-minute drive away, and their down time was a lot longer > > > then I expected. > > > > It would be nice, but it's tough to reliably test this without actually > > extracting the files (and a warning with many false triggers wouldn't be > > all that much use either ..) > > Thanks for that info, it is interesting. > > I'm just me, but would definitely prefer a warning that > suggests a potential problem and says what to > check to be sure, over having to do a recovery. I do follow the > instructions and check it (so far, barring mistakes), but I imagine that > the program can still, without extracting the files, check it as well as > I would (df -h...), but more reliably. Trouble is, it's highly likely that people who installed with disklabel auto defaults from any version before 7.2-current 2022/06/25 when the default size for /usr was greatly increased will trip a simplistic free space check, though in many of those cases there actually will be enough space to update ok. The "what to check to be sure" is, er, trying to update ...
Re: sysupdate and space check
On 2022-10-26 11:57:23-, Stuart Henderson wrote: > On 2022-10-24, Peter Fraser wrote: > > I make a stupid mistake; I didn't check partition sizes before doing a > > sysupgrade. > > sysupgrade ran out of space or /usr in the middle of the upgrade. > > I know I should have checked first but it would be nice if sysupgrade did > > warn me. > > The site was a 20-minute drive away, and their down time was a lot longer > > then I expected. > > It would be nice, but it's tough to reliably test this without actually > extracting the files (and a warning with many false triggers wouldn't be > all that much use either ..) Thanks for that info, it is interesting. I'm just me, but would definitely prefer a warning that suggests a potential problem and says what to check to be sure, over having to do a recovery. I do follow the instructions and check it (so far, barring mistakes), but I imagine that the program can still, without extracting the files, check it as well as I would (df -h...), but more reliably.
Re: sysupdate and space check
On 2022-10-24, Peter Fraser wrote: > I make a stupid mistake; I didn't check partition sizes before doing a > sysupgrade. > sysupgrade ran out of space or /usr in the middle of the upgrade. > I know I should have checked first but it would be nice if sysupgrade did > warn me. > The site was a 20-minute drive away, and their down time was a lot longer > then I expected. It would be nice, but it's tough to reliably test this without actually extracting the files (and a warning with many false triggers wouldn't be all that much use either ..)
sysupdate and space check
I make a stupid mistake; I didn't check partition sizes before doing a sysupgrade. sysupgrade ran out of space or /usr in the middle of the upgrade. I know I should have checked first but it would be nice if sysupgrade did warn me. The site was a 20-minute drive away, and their down time was a lot longer then I expected.