(OLD) (ARCHIVED) Puppy Linux Discussion Forum Forum Index (OLD) (ARCHIVED) Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info

This forum can also be accessed as http://oldforum.puppylinux.com
It is now read-only and serves only as archives.

Please register over the NEW forum
https://forum.puppylinux.com
and continue your work there. Thank you.

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 30 Nov 2020, 03:47
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
I bet you have a bunch of stale mount points in /mnt, right?
Moderators: Flash, Ian, JohnMurga
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Page 1 of 1 [7 Posts]  
Author Message
jafadmin

Joined: 19 Mar 2009
Posts: 1258

PostPosted: Sat 25 Jan 2020, 19:05    Post subject:  I bet you have a bunch of stale mount points in /mnt, right?
Subject description: Here's how to clean them out
 

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:
Code:
#! /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


*I am NOT responsible if this wipes out your crochet videos or homework! Use this at your own risk!
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 2626

PostPosted: Sat 25 Jan 2020, 21:26    Post subject: Re: I bet you have a bunch of stale mount points in /mnt, right?
Subject description: Gettin' messy in there ..
 

jafadmin wrote:

*I am NOT responsible if this wipes out your crochet videos or homework! Use this at your own risk!


This is actually a good warning. I once deleted a mount point that looked empty when viewed from the file manager but wasn't and actually pointed to a good chunk of my system!

_________________
Find me on minds and on pearltrees.
Back to top
View user's profile Send private message Visit poster's website 
enrique

Joined: 09 Nov 2019
Posts: 601
Location: Planet Earth

PostPosted: Sat 25 Jan 2020, 23:12    Post subject:  

Interesting concept. If the folder does not exist we can not save in wrong place. Thanks

Wink This reminds me that I have to repair my BusterDog. I did put extra libraries. fredx181 did in fact explained it to me how not to do it. Point is that I have duplicate libraries in charge of my volume mounting. One mount on /media the other on /mnt. I know been lazy to build my self another Busterdog.
Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 1258

PostPosted: Sun 26 Jan 2020, 03:24    Post subject:  

The script will not remove active mounts.

Puppy is the only Linux I have seen so far that doesn't automatically clean up '/mnt' on shutdown.
Back to top
View user's profile Send private message 
elephante_of_randomness


Joined: 24 Mar 2020
Posts: 5
Location: GTA, ONTARIO, CANADA

PostPosted: Wed 25 Mar 2020, 01:04    Post subject: *snock  

i need to look into this. i've already encountered the issue. and i prefer to keep a clean system.
Back to top
View user's profile Send private message 
elephante_of_randomness


Joined: 24 Mar 2020
Posts: 5
Location: GTA, ONTARIO, CANADA

PostPosted: Wed 25 Mar 2020, 01:06    Post subject: #etc
Subject description: so this is a language
 

/*
what language?
*/


#! /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
dones
Back to top
View user's profile Send private message 
Keef


Joined: 20 Dec 2007
Posts: 1001
Location: Staffordshire

PostPosted: Wed 25 Mar 2020, 14:12    Post subject:  

That would be Bash, that would. It's a shell script, just a text file to run in a terminal.
Open a terminal where ever the file is, then type:
Code:
./whatever-you-have-named-the-file

...then watch your crochet videos disappear.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [7 Posts]  
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1015s ][ Queries: 12 (0.0679s) ][ GZIP on ]