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

Linux

48328 readers
540 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@sh.itjust.works 42 points 4 months ago* (last edited 4 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.

[–] gpstarman@lemmy.today 7 points 4 months ago
[–] Nyanix@lemmy.ca 5 points 4 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)
[–] cmnybo@discuss.tchncs.de 34 points 4 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.

[–] gpstarman@lemmy.today 11 points 4 months ago

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

Thank You

[–] odc@lemmy.sdf.org 28 points 4 months ago (1 children)

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

[–] gpstarman@lemmy.today 6 points 4 months ago
[–] Revan343@lemmy.ca 16 points 4 months ago* (last edited 4 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

load more comments (1 replies)
[–] Presi300@lemmy.world 16 points 4 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)
[–] GnuLinuxDude@lemmy.ml 16 points 4 months ago (13 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 (13 replies)
[–] rotopenguin@infosec.pub 15 points 4 months ago (1 children)
[–] gpstarman@lemmy.today 6 points 4 months ago (2 children)

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

or a joke maybe?

[–] atzanteol@sh.itjust.works 10 points 4 months ago

Seems like a joke. 🙂

[–] MonkderDritte@feddit.de 6 points 4 months ago* (last edited 4 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)
[–] SimplyTadpole@lemmy.dbzer0.com 14 points 4 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)
[–] wargreymon@sh.itjust.works 13 points 4 months ago* (last edited 4 months ago) (1 children)

The best mounting position is /booty.

[–] gpstarman@lemmy.today 8 points 4 months ago

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

[–] CMDR_Horn@lemmy.world 8 points 4 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)
[–] lazylion_ca@lemmy.ca 8 points 4 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.

[–] gpstarman@lemmy.today 4 points 4 months ago

Good idea bro.

[–] Darohan@lemmy.zip 4 points 4 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)
[–] MrSoup@lemmy.zip 7 points 4 months ago* (last edited 4 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)
[–] Nibodhika@lemmy.world 6 points 4 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.

[–] gpstarman@lemmy.today 4 points 4 months ago

Thanks man.

[–] Pika@sh.itjust.works 6 points 4 months ago* (last edited 4 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)
[–] bjoern_tantau@swg-empire.de 6 points 4 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)
[–] Rudee@lemmy.ml 6 points 4 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)
[–] deadbeef79000@lemmy.nz 5 points 4 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)
[–] bloodfart@lemmy.ml 4 points 4 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)
[–] nyan@sh.itjust.works 4 points 4 months ago

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

[–] exu@feditown.com 4 points 4 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)
[–] Sonotsugipaa@lemmy.dbzer0.com 3 points 4 months ago (11 children)

I decided to simply create directories within /mnt, chmod 000 them and use them as fixed mountpoints;
for manual temporary mounts I have /mnt/a, /mnt/b, ... /mnt/f, but I never needed to use more than two of them at once.

While this setup doesn't really respect the filesystem hierarchy, I wouldn't have used /mnt at all if I were constrained by its standard purpose since having one available manual mountpoint seems pretty limiting to me.
Then again, I have 3 physical drives with ~ 10 partitions, plus one removable drive with its own dedicated mountpoint...

load more comments (11 replies)
[–] Kelo@lemmy.world 3 points 4 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 ›