LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 01-20-2010, 08:25 AM   #1
gjemmott
LQ Newbie
 
Registered: Jan 2010
Distribution: SimplyMEPIS 8.0, Debian Stable 5.0 (Lenny)
Posts: 8

Rep: Reputation: 0
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!)

Last edited by gjemmott; 01-20-2010 at 08:27 AM.
 
Old 01-20-2010, 08:34 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
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.
 
1 members found this post helpful.
Old 01-20-2010, 08:54 AM   #3
gjemmott
LQ Newbie
 
Registered: Jan 2010
Distribution: SimplyMEPIS 8.0, Debian Stable 5.0 (Lenny)
Posts: 8

Original Poster
Rep: Reputation: 0
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!)
 
Old 01-20-2010, 09:10 AM   #4
slacker_et
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 138

Rep: Reputation: 27
You might want to read up on FHS.
Filesystem_Hierarchy_Standard
http://www.pathname.com/fhs/

--ET
 
1 members found this post helpful.
Old 01-20-2010, 09:34 AM   #5
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
Quote:
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.
 
1 members found this post helpful.
Old 01-20-2010, 12:09 PM   #6
gjemmott
LQ Newbie
 
Registered: Jan 2010
Distribution: SimplyMEPIS 8.0, Debian Stable 5.0 (Lenny)
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks!

Thanks ET and Neon!

Great information here.

Quote:
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.

Thanks again!
 
Old 01-20-2010, 12:28 PM   #7
slacker_et
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 138

Rep: Reputation: 27
Are you sure you ran "df home' and not "df /home" ?
Could home be a symbolic link to /home ?

--ET
 
Old 01-20-2010, 12:43 PM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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.
 
Old 01-20-2010, 12:55 PM   #9
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by gjemmott View Post
A sysadmin at work told me *only* to mount drives to sub-folders of the /mnt directory.
Don't forget that he is a sysadmin at work. It's his responsibility to see that the system works, so it's best to just accept his rules.

As to who is right: the sysadmin is always right, even when he's wrong.
 
Old 01-21-2010, 04:46 AM   #10
gjemmott
LQ Newbie
 
Registered: Jan 2010
Distribution: SimplyMEPIS 8.0, Debian Stable 5.0 (Lenny)
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
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.

Thanks again, all!

Last edited by gjemmott; 01-21-2010 at 04:52 AM.
 
Old 01-21-2010, 08:22 AM   #11
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by gjemmott View Post
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.

Last edited by pixellany; 01-21-2010 at 08:26 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"mount (as root) iso to /mnt/tmp" newbiesforever Linux - General 4 11-14-2009 11:58 AM
why only "mount /dev/sda /mnt/usb" works and not "mount /dev/sda1..." ? gromot Linux - General 7 05-19-2009 10:18 AM
Mount "already mounted or /mnt busy" problems with dmraid, Promise FastTrak, 2.6.12 Iainuki Linux - Hardware 1 12-01-2006 08:33 AM
Slack 10 keeps installing "/" under "/mnt". Why ? tuanito Slackware - Installation 5 08-04-2004 08:34 AM
Pengy practices the martial art of "GNU" foo caleb star Linux - Hardware 2 01-28-2004 01:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration