I bet you have a bunch of stale mount points in /mnt, right?
Posted: Sat 25 Jan 2020, 23:05
Did you ever notice that sometimes you create work in /mnt/sd?1 and it vanishes for no reason? Wanna know why?
Stale mount points. As far as Linux is concerned they are still a legit file directory even if no devices are mounted on them. What to do? Simple. Get rid of stale mount points and you won't put stuff there.
I use a link to this tasty snock* in my Startup directory to clear the essential computing surfaces when I first boot:
delete-stale-mnts:
*I am NOT responsible if this wipes out your crochet videos or homework! Use this at your own risk!
Stale mount points. As far as Linux is concerned they are still a legit file directory even if no devices are mounted on them. What to do? Simple. Get rid of stale mount points and you won't put stuff there.
I use a link to this tasty snock* in my Startup directory to clear the essential computing surfaces when I first boot:
delete-stale-mnts:
Code: Select all
#! /bin/bash
#
# Remove stale mount points in '/mnt' - jafadmin
#
RAW=$(ls -d /mnt/*)
for Line in $RAW
do
if [ ! -z "$(mountpoint $Line | grep not)" ]; then rm -R $Line; fi
done