What happens to a mount dir when not in use?

TBSN

Senior member
Nov 12, 2006
925
0
76
I've been fiddling around with mount points for my external HDD and apparently a mountpoint is nothing other than a directory.

My questions is this: When the drive is mounted, the files get read and written to and from the drive. When the drive is unmounted, it acts as a directory under the root file system.

/media might be filled with music when my external drive is mounted, but when its not, /media can be filled with files that live, physically, on the primary system drive.

Is this how it is supposed to work?!
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
Essentially,

When you mount a filesystem on a directory, you can no longer access files under that directory. They still exist, but the directory now refers to the root of the mounted filesystem, not to the directory that served as the mount point.
 

TBSN

Senior member
Nov 12, 2006
925
0
76
OK, I guess I never observed it happening until I had to mount something manually myself.

Is there a convention or way that I should mount an external HDD, or some special way to make the directory it is mounted in, or should I just make a regular directory for the drive?
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
Typically you mount removable media in /mnt/something or /media/something.

Things that will be mounted permanently can be mounted anywhere. For example, I have a spare HD I want to use for my /home directory. I could mount that drive as /mnt/tmp, copy over everything in /home, unmount /mnt/temp, erase /home, mount the new drive at /home and finally adjust my fstab so the new drive gets mounted as /home

Or I have a iso I need to mount. I would mount it at /mnt/iso and unmount it when I was done (I leave the folder there because I mount iso's a lot).
 

TBSN

Senior member
Nov 12, 2006
925
0
76
Is there a way to have a mount directory that disappears when the drive isn't attached? It isn't really necessary to me but I'm just curious. I'm working on a bare-bones system without a DE but on a desktop distribution there's gotta be a way for the user to tell easily if the files they're saving to the directory are actually going to the external drive.
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
Desktop distributions typically take care of mounting for you. I've never bothered to actually look at see if the folder is left there after you remove a usb stick. I'd assume it cleans up after itself as typically (at least in ubuntu) the usb stick is mounted as the volume name.
 

TBSN

Senior member
Nov 12, 2006
925
0
76
Thanks for the info. I guess I'll mount my drives under /mnt/ to avoid confusion.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Is there a way to have a mount directory that disappears when the drive isn't attached? It isn't really necessary to me but I'm just curious. I'm working on a bare-bones system without a DE but on a desktop distribution there's gotta be a way for the user to tell easily if the files they're saving to the directory are actually going to the external drive.

In general, no, because it's meant to be transparent. You have to dig a little to see if a specific directory is a mount point, symlink or just regular directory and that's by design. Users will most likely be selecting the destination via the GUI file selector which shows volumes separately, similar to OS X so it shouldn't be a problem from that perspective either.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |