126
submitted 4 months ago* (last edited 4 months ago) by gpstarman@lemmy.today to c/linux@lemmy.ml

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 43 points 4 months ago* (last edited 4 months ago)

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

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 35 points 4 months ago

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 29 points 4 months ago

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

[-] gpstarman@lemmy.today 6 points 4 months ago
[-] GnuLinuxDude@lemmy.ml 16 points 4 months ago

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

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

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

load more comments (1 replies)
[-] rotopenguin@infosec.pub 15 points 4 months ago
[-] gpstarman@lemmy.today 6 points 4 months ago

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

or a joke maybe?

[-] atzanteol@sh.itjust.works 11 points 4 months ago

Seems like a joke. 🙂

[-] MonkderDritte@feddit.de 6 points 4 months ago* (last edited 4 months ago)

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

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)

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.

[-] lazylion_ca@lemmy.ca 8 points 4 months ago

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.

[-] Darohan@lemmy.zip 4 points 4 months ago

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)
[-] gpstarman@lemmy.today 4 points 4 months ago

Good idea bro.

[-] CMDR_Horn@lemmy.world 8 points 4 months ago

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

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

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.

[-] Rudee@lemmy.ml 6 points 4 months ago

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)
[-] Pika@sh.itjust.works 6 points 4 months ago* (last edited 4 months ago)

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

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)
[-] deadbeef79000@lemmy.nz 5 points 4 months ago

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

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)
[-] exu@feditown.com 4 points 4 months ago

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

load more comments (3 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.

[-] GuyNoIRQ@infosec.pub 3 points 4 months ago

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)
[-] prettybunnys@sh.itjust.works 3 points 4 months ago* (last edited 4 months ago)

If they’re internal drives then you choose.

I like to mount drives at root, their parent directory being the logical purpose of the drive.

Got a drive you added that’s gonna be for games?

/games

Is it for movies?

/movies

Or maybe it’s just general data storage?

/data

No need to make it more complicated than it has to be.

This is standard across the industry, unless you are mounting disks that would conform to another strategy (say it’s a drive of repos, it might mounted under /usr/local/src/ as that’s where one would expect user provided source code).

[-] somethingsomethingidk@lemmy.world 4 points 4 months ago

I like to put mine in /var/local/movies etc. to keep the root standard and uncluttered.

Of course it's just personal preference

load more comments (1 replies)
load more comments
view more: next ›
this post was submitted on 04 Jul 2024
126 points (97.7% liked)

Linux

48376 readers
989 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