i remember i did some really deep sed hackery some time ago and i’m trying to remember where i left the file

ughhhhhhh i don’t wanna have to figure out that shit again

okay looking through my firefox history it was something to do with xfs… was i maybe doing this on my thinkpad?

i have narrowed it down to something i was working on 10/06/2022, ~10am, maybe XFS related??

i found it!! this wonderful, awful piece of scripting:

# Check desk fragmentation levels echo '-> checking disk fragmentation...' _ROOT=/dev/mapper/cryptroot _PERC=$(/bin/xfs_db -c frag -r "$_ROOT" | \ /bin/sed -n -E '/fragmentation factor [0-9\.]+%/{ s/^.*fragmentation factor //; s/%.*$//; s/\> && { echo "--> fragmentation: ${_PERC} / 10000"; [ $_PERC -gt 5000 ] 2> /dev/null; } && { # Only drop here on success, otherwise supressing non-0 exit code echo '-> fragmentation beyond threshold 5.0%, starting 300s defrag' xfs_fsr -t 300 "$_ROOT" }; unset _ROOT _PERC

@kim let your disks be a bit fragmented as a treat imo

Sign in to participate in the conversation
Pixietown

Small server part of the pixie.town infrastructure. Registration is closed.