this post was submitted on 04 Jul 2024
124 points (97.7% liked)

Linux

48634 readers
1571 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Where should I mount my internal drive partitions?

As far as I searched on the internet, I came to know that

/Media = mount point for removable media that system do it itself ( usb drive , CD )

/Mnt = temporarily mounting anything manually

I can most probably mount anything wherever I want, but if that's the case what's the point of /mnt? Just to be organised I suppose.

TLDR

If /mnt is for temporary and /media is for removable where should permanent non-removable devices/partitions be mounted. i.e. an internal HDD which is formatted as NTFS but needs to be automounted at startup?

Asking with the sole reason to know that, what's the practice of user who know Linux well, unlike me.

I know this is a silly question but I asked anyway.

top 50 comments
sorted by: hot top controversial new old
[–] atzanteol 43 points 5 months ago* (last edited 5 months ago) (2 children)

With Linux filesystem hierarchies you're going to run into a lot of history, conventions, quasi-standards and simply deprecated implementations.

It's a problem of "there's no bad way to do it so all options are equally fine". From this arose some "guidelines" about /bin and /usr/bin, /var, etc. but few strict rules.

For a long time there was no /media. In the '90s/2000's you would mount your CD-ROM and floppies in /mnt (e.g. /mnt/cdrom, /mnt/floppy). That was awkward as we started wanting auto-mounted things and wanted to do it from user-space. So /media/username was created to allow you to mount things with your ownership.

If it's something you want permanently mounted but not part of a pool you can put it under any location you like really. I like locations under /var as historically /var is used for things that "vary". You could just mount it in your $HOME if it's something you're going to use as a user rather than with a service.

I have a "/exports" dir for NFS mounts (e.g. /export/media, /export/storage, etc.). Just keeps it tidy and in one location.

The important thing is to use a standard that works for you and makes sense. There's not a lot of bad places to mount things. If "/mnt" makes sense for you then go for it.

[–] [email protected] 7 points 5 months ago
[–] [email protected] 5 points 5 months ago (1 children)

To piggy-back off of this, it's not entirely uncommon to create another directory at root in enterprise environments, using /data or /application That said, I only do that for enterprise, for my personal computer, my distro defaulted to auto-mounting to a directory for each drive inside of /mnt, and I rather like that and intend to stick with it.

load more comments (1 replies)
[–] [email protected] 30 points 5 months ago (1 children)

Anything I add to fstab gets mounted in /mnt and removable drives get auto mounted to /media. Linux doesn't care where you mount your drives, they can be mounted anywhere you want.

[–] [email protected] 9 points 5 months ago

Linux doesn't care where you mount your drives, they can be mounted anywhere you want.

Thank You

[–] [email protected] 22 points 5 months ago (1 children)

Mount your internal disks to /D:, /E:, /F:, etc.

[–] [email protected] 6 points 5 months ago
[–] [email protected] 16 points 5 months ago (1 children)

Idk, I mount my disks in /mnt/whatever, though I don't think it matters where you mount them.

load more comments (1 replies)
[–] [email protected] 15 points 5 months ago (9 children)

It ultimately doesn't actually matter because in many cases these things are convention and there is no real system-based effect. So while it would be especially weird if your distro installed packages into those directories, it ultimately doesn't matter. Someone already linked the filesystem hirearchy. See how tiny the /media and /mnt sections are?

I put my fixed disks into subdirectories under /mnt and I mount my NAS shares (I keep it offline most of the time) in subdirectories in /media.

load more comments (9 replies)
[–] [email protected] 14 points 5 months ago* (last edited 5 months ago) (1 children)

Mounting locations are a convention, not a standard, mount whatever you like wherever you like. In your case, I'd mount it under /mnt/ntfs, /mnt/windows if it a windows main partition you want visible, or by drive letter if it's a secondary drive on a dual-boot system.

Or however you want. I would keep it under /mnt, but you don't have to.

Do maybe sure you have user permissions set up properly if this is a multiuser machine though

Edit: also I would interpret

If /mnt is for temporary

'temporary' as in 'may become unmounted without seriously fucking the system'

/ and /home aren't temporary. Everywhere else is

[–] [email protected] 3 points 5 months ago

'temporary' as in 'may become unmounted without seriously fucking the system'

Thanks bro. Now it make sense.

[–] [email protected] 14 points 5 months ago (1 children)

Use any you want. I've been mounting my internal secondary hard drive on /mnt for well over a year now and haven't had any problems. Previously, I mounted it on ~/Storage and it also worked fine (though only because I'm the only user in my computer; dual-user systems would result in the other user being unable to access the hard drive).

load more comments (1 replies)
[–] [email protected] 14 points 5 months ago (1 children)
[–] [email protected] 4 points 5 months ago (2 children)

You mean that you create folder in / named C:?

or a joke maybe?

[–] atzanteol 10 points 5 months ago

Seems like a joke. 🙂

[–] [email protected] 6 points 5 months ago* (last edited 5 months ago) (4 children)

I mean, wine does that with symlinks. But not on /, don't run wine as root.

load more comments (4 replies)
[–] wargreymon 13 points 5 months ago* (last edited 5 months ago) (1 children)

The best mounting position is /booty.

[–] [email protected] 8 points 5 months ago

Thank You for suggestion. Gonna try that Tonight and have fun mounting loads of data.

[–] [email protected] 8 points 5 months ago (1 children)

Basically if I add it to my fstab it goes to /mnt. I let the system handle /media for usb etc

load more comments (1 replies)
[–] [email protected] 8 points 5 months ago (2 children)

I create /data and mount my 2nd drive there using fstab.

I then mount /data/downloads under my user downloads folder so everything goes to my 2nd drive. That way I dont have to redownload anything if I redo my main drive.

[–] [email protected] 4 points 5 months ago (7 children)

I do a similar thing with ~/Pictures and ~/Music, which are symlinked to my NextCloud Sync folder on my much larger second drive. It's good for saving space on my main drive, too, as those two folders contain a lot of data.

load more comments (7 replies)
[–] [email protected] 4 points 5 months ago

Good idea bro.

[–] [email protected] 7 points 5 months ago* (last edited 5 months ago) (5 children)

The Linux FHS does not address this, so it's up to you where to mount it. There is no correct choice, but if you want to follow standards just mount it inside /mnt which is the nearest use-case (/media could be automatically used by your DE, so avoid it). Otherwise you can just create a custom folder in root like someone else suggested.

Take a look at FHS spec.

Edit:
On arch forum someone suggests /mnt/data

load more comments (5 replies)
[–] Pika 6 points 5 months ago* (last edited 5 months ago) (1 children)

Actually since their permanent non-removable drives, I would say wherever you want to place them, if they're meant primarily for storing user-based data you can do like what I used to do which was store them in within the home directory just as specific names. Like my old setup before I went proxmox was /backups was my backup drive, /home was my home drive that stored most of my users /home/steam held all my game server drive and /home/storage held my long term cold storage drive.

load more comments (1 replies)
[–] [email protected] 6 points 5 months ago (1 children)

Permanent drives should be put wherever you want them to, for example I have mine mounted in /ld1 for Large Disk 1. /media is supposed to be used by systems to mount things you plug, but some systems move that to /var/run/media or other places. /mnt is there so you don't have to create a folder in case you want to mount something really quick.

[–] [email protected] 4 points 5 months ago

Thanks man.

[–] [email protected] 6 points 5 months ago (1 children)

Not a pro by any means, but I mount my internal drives at /mnt. Its also where I mount my NAS

AFAIK mount point doesn't matter

load more comments (1 replies)
[–] [email protected] 6 points 5 months ago (1 children)

There's also /run/media/[username]/. Don't know if it's an OpenSUSE thing or Plasma but everything I mount through KDE's file manager Dolphin ends up there. Including stuff I set up to mount automatically.

load more comments (1 replies)
[–] [email protected] 4 points 5 months ago (6 children)

In the past I've tended towards /srv/* as most mounts end up being application specific storage.

Though now it is all mounted as container volume storage.

load more comments (6 replies)
[–] nyan 4 points 5 months ago

As far as I'm concerned, everything goes under /mnt , and has for the past 18+ years.

[–] [email protected] 3 points 5 months ago (1 children)

Unless dictated by the particular data in the disks, /mnt is generally used for system managed volumes and /media is used for user managed volumes.

If you do something else, stick with it so you don’t get confused.

load more comments (1 replies)
[–] [email protected] 3 points 5 months ago (3 children)

I use multiple subdirectories under /mnt for my fstab/systemd-mount managed disks. That includes local and network locations.

load more comments (3 replies)
[–] [email protected] 3 points 5 months ago (4 children)

If I remember correctly mnt is for static media that you expect to always be present and media is for removable media which may come and go.

load more comments (4 replies)
[–] [email protected] 3 points 5 months ago (1 children)

I myself have separate /Disks folder where I mount all my internal disks on boot. Not sure how "standard" such setup is, but it helped me keep my NTFS and Linux disks tidy and out of my way. For what I know you can mount your drives anywhere you like

load more comments (1 replies)
load more comments
view more: next ›