Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am relatively new to Linux and I apologise if this is a silly question. I read the Linux FS Hierarchy document but it didn't answer my question.

I would like to know if there is a typical drive mounting scheme for general-use internal HDDs in Linux. I ask because I have two HDDs that were mounted as "E:" and "F:" in Windows, but since they hold various types of files (movies, music, personal documentation, source code) I'm not sure where they fit in the Linux filesystem hierarchy.

My instinct was to mount the HDDs in /mnt/hdd{1 | 2} or /media/hdd{1 | 2}, but that goes against what LFSH suggests is the purpose of these two directories. I think mounting in /home would be the most sensible. Thank you.

share|improve this question
1  
I mount my stuff in /vol. This seems like a preference question. –  Tim Jul 12 '12 at 13:40
    
Would it better if I replaced "Preferred" with "Best practice" or "Standard"? I am not familiar enough with Linux to know if there is a formal/informal standard for in the Linux community. The only document I've been advised to read (LFSH) was not helpful. –  ItsOnlyOneLineOfCode Jul 12 '12 at 13:57
    
I mount my stuff in directories created at / (for example, /data). Like @Tim, I think it's a matter of preference. It would be nice to know if there is some "best practice", though. –  phunehehe Jul 12 '12 at 14:43
    
/media seems to be a standard location. I mount everything there and make symbolic links to it for convenience. –  jw013 Sep 28 '12 at 18:40
add comment

4 Answers 4

up vote 1 down vote accepted

Is this permanent or temporary?

A hard drive that wasn't a part of my filesystem table (i.e. wouldn't get auto-mounted) I typically have ~/mnt/hd1 or ~/mnt/usb - not terribly imaginative, but the use case is something I'm not going to keep in the machine permanently.

For something I'm adding for good, I like create a directory off root and name its mount point based on its intended use.

For instance, I have a /pers (as in personal) directory which contains /pers/photos and /pers/videos. This is where I pull in stuff off our cameras. I chown the directory to me, so I don't have to fiddle with sudo. I do this because it's a little easier to get at, rsync, tell the wife where it is, quick tab completion, etc. I also have a /d (data) where I put my music, isos, downloads and whatnot.

I would expect it's more "best practicey" to put it under home somewhere. I encourage you to try a bunch of methods. That's what I did until I found something I liked/worked well for me.

share|improve this answer
    
They will be automounted internal hard disks.I didn't consider chown'ing the mount points for my user account. It seems that there is no convention or best practice, so I will mount the drives under / similar to what you have done here. –  ItsOnlyOneLineOfCode Jul 17 '12 at 14:34
add comment

Since this sounds like it's just your personal system, you can mount it anywhere you want to. Mounting under /mnt or /media is just fine. I've seen people use /data, and some people follow the Mac OS X convention and mount it under /Volumes (or /vol as one commenter mentioned). If you want it to appear under your home directory, then /home/major/vol might be a good place.

The reason that the FSH doesn't mention it is because there really are no rules about users mounting data from other operating systems. The LSB and FSH are written for distribution makers to follow so that they will collectively create a system that users are familiar with. End users (i.e., you) are free to do it however you wish.

share|improve this answer
    
I didn't know that about the LFSH. I have come up with a convention to mount the internal drives under /. Thanks. –  ItsOnlyOneLineOfCode Jul 17 '12 at 14:33
add comment

You can mount it pretty much wherever you'd like.

Traditionally, permanently-mounted disks (like internal drives) are mounted wherever the stuff they contain would go in the filesystem tree. For example, if you decided to put all of Bob's data on its own disk, you'd mount it at /home/bob. If you were going to store mail on its own disk, you'd mount it at /var/mail. Many of the top-level directories can be on their own filesystems. /usr and /var are reasonably common.

DOS and Windows (and Mac OS, too) took a different approach: All file paths start with a (sometimes implicit) drive. The drive something is on is a fundamental part of where a file is (logically) located.

/media is supposed to be used for removable drives, and desktop environments auto-mount stuff there. Sometimes they get confused if you manually put stuff there. So I'd avoid it.

It sounds like you want to mount them under /home/roger/ somewhere (or whatever your home directory is). /mnt/ is fine too; its for the system administrator (that'd be you) to decide how to use. You can also create additional directories under /, that's reasonably common as well.

Are you sure you want multiple filesystems?

If you want to treat multiple disks as one larger disk, you can. This may be what you want. You can do this with either RAID or LVM, though it'll be much harder to use these disks in a dual-boot environment. Your choices are:

  • RAID1 (mirror). Will have space of the smaller of the two disks (minus epsilon), but puts the data on both disks. Safeguards against disk failure.
  • LVM (spanning, though it can actually do more). Will give additional space (sum of both disk, minus epsilon), but no performance boost. Losing a disk will lose the content on that disk, but the stuff on the other disk may still be recoverable.
  • RAID0 (stripe). Will give additional space (sum of both disks, minus epsilon). Potentially doubles both read and write throughput. Loss of either disk will lose all data.

If you have more disks, you have some more choices (RAID5/6 [parity] and RAID10 [combines RAID0 and RAID1]). LVM actually gives you a lot of things besides spanning disks—e.g., you can hot add and remove disks, resize "partitions" (logical volumes), take snapshots, etc. It can be usefully be stacked on top of any of the RAID levels.

Personally, my desktops run LVM over RAID1 or RAID10, and my servers LVM over RAID10 or RAID5/6.

share|improve this answer
add comment

If /mnt/ is used for temporary volumes, maybe /vol/volumename like in Mac OS X for stable volume mounts would be best.

I think that the FHS should give more guidelines.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.