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.
that is what the
/srv
mount point is for. I mount all my external HDDs from there.That is for “Site-specific data served by this system” like /srv/www. Can mount anything anywhere of course.
/srv
contains site-specific data which is served by this system.https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html#srvDataForServicesProvidedBySystem
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
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.
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.Linux doesn’t care where you mount your drives, they can be mounted anywhere you want.
Thank You
/C:
You mean that you create folder in
/
namedC:
?or a joke maybe?
I mean, wine does that with symlinks. But not on /, don’t run wine as root.
don’t run wine as root.
why? windows virus?
Yeah. And it’s a wrapper, stuff can happen. Not sure if it even works as root.
Thanks for heads up man
Seems like a joke. 🙂
As far as I’m concerned, everything goes under /mnt , and has for the past 18+ years.
I use multiple subdirectories under /mnt for my fstab/systemd-mount managed disks. That includes local and network locations.
But isn’t anything under /mnt is defaulted to
root
as owner?Yeah, but you need root anyways to mount disks (most of the time), so doing a quick
chown
isn’t that much effort.Edit:
chown
>chmod
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.
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.
Good idea bro.
Basically if I add it to my fstab it goes to /mnt. I let the system handle /media for usb etc
/[UUID or PART-UUID].[partition number/letter]
I’m an OpenBSD user, but it shouldn’t be hard to translate this to Linux:
If the partition I want to mount is
/dev/sd0i
, and sd0’s UID is3c6905d2260afe09
, I mount/dev/sd0i
at/3c6905d2260afe09.i
. fstab entry looks like3c6905d2260afe09.i /3c6905d2260afe09.i ffs rw,whatever_flags 0 0
Ik bro, but having whole bunch of random numbers as mount point seems less intuitive to me.
well diskletters/numbers can change between boots and hardware configurations, and unless you have a good label for the partition, this is the only way I can think of to name your permanent mount points that isn’t problematic/incorrect in some other way. This will always work correctly with any amount of partitions with any amount of disks; and it’s not exactly hard to get the DUID of a disk, at least on OpenBSD. It’s also highly scriptable as such.
I think tooling only cares for partitions. So /home and / are usually runtime-critical (can be on different disks or network storage), while internal data disks count as removable, since you can unmount their partitions.
My simple brain can’t understand it bro. 🥲
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.
Thank You.
/mydrive
That’s what I do, /music
Thanks you, /oldfart
Idk, I mount my disks in /mnt/whatever, though I don’t think it matters where you mount them.
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.
Isn’t
/srv/
is for files from network or something ?container volume storage
What’s that ? 😅 Is that like LVM ?