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.
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.
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.
I know it is kinda frowned on but I like to use new directories at root to cut down on confusion as to where things are. Video storage for the NVR goes in /video, user data for Nextcloud goes in /data, etc. But I also keep everything in it’s own LXC so I don’t have one machine with 30 extra directories cluttering up the root.
Thank You.
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.Mount your internal disks to
/D:
,/E:
,/F:
, etc.🥇
That depends on your usecase.
I have setup servers where I mounted extra drives on /srv/nfs
When/If I switch to Linux I will probably mount my secondary drives to folders like
/home/stoy/videos
/home/stoy/music
/home/stoy/photos
/home/stoy/documents
/home/stoy/games
The ~/games will probably be an LVM since it contains little critical data and may absolutely need to be expanded to span several drives, though I would also be able to reduce the size of it and remove a drive from the LVM if needed.
I’d make a simple conky config to keep track of the drive space used
I’d just keep using the default automount spot for automounting drives.
My /home is also on a separate filesystem, so in principle I don’t like to mounting data under there, because then I cannot unmount /home (e.g. for fsck purposes) unless I unmount also all the other filesystems there. I keep all my filesystems on LVM.
So I just mount to /mnt and use symlinks.
Exception: sshfs I often mount to home.
So you suggest not to mount like the guy above said
/home/stoy/videos
?And suggest symlinks instead?
Yes, just mount to
/mnt/videos
and symlink that as needed.I guess there are some benefits in mounting directly to
$HOME
, though, such asfind
/fd
work “as expected”, and also permissions will be limited automatically per the$HOME
permissions (but those can be adjusted manually).For finding files I use
plocate
, though, so I wouldn’t get that marginal benefit from mounting below$HOME
.