[SOLVED] Why use /mnt/? (or, "Best practices - why not mount to / ?")
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Why use /mnt/? (or, "Best practices - why not mount to / ?")
A sysadmin at work told me *only* to mount drives to sub-folders of the /mnt directory. http://www.linfo.org/mnt.html states that "Major filesystems on non-root partitions (i.e., logically independent sections) of the hard disk drive (HDD) are typically mounted in the root directory". That would imply (I think) that my windows logical partition (on the same drive) would "typically," and therefore acceptably, be mounted to the root directory.
Am I confused? If not, who is right and why?
Thanks,
~George J.
(I'm new to Linux, so, as with any language, please correct me if I've made a mistake in word choice or syntax. Thanks!)
The /mnt directory is for filesystems that are in some sense 'extra' to the standard file system (and usually mounted only temporarily), such as flash memory or an external hard drive.
Sometimes permanently mounted parts of the normal filesystem (such as /home) are kept on separate partitions of the main drive(s). This is what the linfo.org page is referring to.
There's nothing wrong with mounting temporary drives elsewhere, but in a multiuser system it is a lot easier to administer (eg controlling access security) if all are mounted in a consistent place (such as /mnt or /media).
Last edited by neonsignal; 01-20-2010 at 08:36 AM.
a clarification question, and how about automatic mounting
Thanks, Neonsignal.
You mention 'extra' filesystems (e.g. flash memory, external hard drives) and 'permanently mounted parts of the normal filesystem.' (e.g. /home)
A clarification question:
Under which of those would you group a Windows logical partition on the same drive, which I access fairly regularly (hence my inclination to mount it to /) ? It's not 'permanently mounted' (yet), but it's not removable. Or does it matter? I'm curious about best-practices here, so your mention of security is helpful; while my system is not currently multi-user, I might as well get in the habit of best practices.
On that note, I am also considering modifying fstab to auto-mount the windows partition (on boot-up). Since, by default in MEPIS, any user can already mount the drive, is there any reason not to auto-mount it, if I use it frequently?
Thanks again!
~George J.
(I'm new to Linux, so, as with any language, please correct me if I've made a mistake in word choice or syntax. Thanks!)
I am also considering modifying fstab to auto-mount the windows partition
It is helpful to automount using fstab (on a desktop machine), because it simplifies user access to the Windows partition.
The Windows partition would typically be mounted in /mnt, since it is not part of the normal set of root directories.
On some systems (especially servers) the root file system is on a separate (and small) system partition. Supposing you added an extra mount point, then if the disk failed to mount, writes to that mount point would end up being stored in the root partition, and could potentially fill it up.
The filesystem is flexible; really, there is nothing to stop you mounting it anywhere you like. The standards (see above post) are to help manage software interactions with the system, and people's expectations of where to find directories and files.
Supposing you added an extra mount point, then if the disk failed to mount, writes to that mount point would end up being stored in the root partition, and could potentially fill it up.
Fantastic example, thanks. That solidified things in my head a bit; MEPIS puts the root partition in the same place as almost everything else (except the swap and, optionally, /home), but now I know how to think in the future.
Now I'm curious why, even though I told the MEPIS installer to put my /home directory on /dev/hda8, when I run
Code:
/$ df home
I get
Code:
/dev/hda4 4127108 2222256 1695204 57% /
... but now I'm getting off-topic for this thread.
You can mount any filesystem** to any mount point you wish......The issue comes when you consider what else is already mounted there. If your system is all setup with /dev/sda1 mounted to /, then you can certainly mount something else there also----but you will hide your existing system. (In this extreme example, you might logically expect the system to crash).
Think of mount points as phone lines: Before connecting a device, consider who else is using the line....
**This is a nit: You do not mount drives or partitions---you can only mount (connect) a filesystem.
Are you sure you ran "df home' and not "df /home" ?
it seems both "/$ df home" and "$ df /home" yield the same result. Also, when I make sure /dev/hda8 (the supposed location of /home, according to the install options I set), /home and all its contents are still accessible. It seems /home is not where I told it to be... Not a big deal for now. I'll poke at this one later. Maybe it's already answered in another thread or forum.
Quote:
(hence my inclination to mount the windows partiton to /)
Oops! Thanks pixellany, I meant *to a new sub-directory* of / , for example /win. No problems with that, right? (Except perhaps neonsignals earlier mentioned filling-up-the-root-partition and making-it-harder-to-make-security-policies concerns)
Quote:
the sysadmin is always right, even when he's wrong.
So true! ... at work. I forgot to mention that this question (and his advice) is about my personal Dell D600, which comes nowhere near work.
Oops! Thanks pixellany, I meant *to a new sub-directory* of / , for example /win. No problems with that, right?
Right---you can mount a filesystem to ANY mountpoint. If something was already there, it will be hidden until you unmount the most recent addition.
Do some experiments....
PS:
"mount" comes from the days of mainframes and tape drives. When your program requested some data, a lackey would go in the back room, fetch a reel of tape, and **mount** it on a drive.
On modern systems, I prefer to think of mounting as connecting. For example, you can connect several devices to a mountpoint--but it will only see the last one connected.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.