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.
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.
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'
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.
Why ? that's what I'm asking. Can't you just put in the same folder and call it a day?
I put my fixed disk in /mnt
My Files, which are inside the partition mounted in /mnt/something has root as Owner. So When I try to move something to Trash, it's not allowing me to do, Only perma delete. When saw properties it said owner is root.
Is it because mounted at /mnt?
Files under /media seems fine. files under /media says it's owner is 'me'
If you try to mount 2 drives to the same location, like /media/drive, the last one that you mounted will just replace the first one. You could put one at /media/drive1 and the other at /media/drive2 though.
It doesn't matter where you mount stuff, like it won't break anything, as long as you're not replacing an existing directory like I mentioned.
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).
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.
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.
Otherwise you can just create a custom folder in root like someone else
suggested
My Files, which are inside the partition mounted in /mnt/something has root as Owner. So When I try to move something to Trash, it's not allowing me to do, Only perma delete. When saw properties it said owner is root.
Is it because mounted at /mnt?
Files under /media seems fine. files under /media says it's owner is 'me'
/mnt/something has root as Owner. So When I try to move something to Trash, it's not allowing me to do
You have to change permissions or owner of that folder (not /mnt itself but the subfolder "something").
If I'm not wrong changing permissions is enough to use gui "move to trash", you can use chmod thru cli (man chmod) o your gui file manager with root privileges.
If you want only your user be able to read/write to that disk, then change the owner using chown thru cli (man chown) or again your gui file manager.
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.
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.
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.
/srv is for “site-specific data which is served by this system.”
How to interpret that is up to for debate, but it seems clearly to be “user files” as opposed to “system files”. “Served” is a bit ambiguous but I don’t think it really requires that it be made accessible with a network service.
Basically I’d treat this as a location to mount/store your non-personal data such as music, videos, etc that should be accessible to anyone using your system. It could be network-exported as well but doesn’t have to be.
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...
chmod is the command to change user permissions. The numbers mean user, group, and others and the value allows read, write, execute. So, 000 means no one has permissions to get rid of the mount point. 777 means everyone has all permissions. (4 is read, 2 is write, and 1 is execute and the numbers are added. So, 644 would mean you can read/write, the group and other users have read only access.)
You don’t have to use the numbers but eventually, almost every Linux admin does because it’s faster, a bit like a keyboard shortcut. But, for instance, you can add Execute permission with chmod +x /some/file/location.
I use chown 000 so that regular users fail to access a directory when no filesystem is mounted on it; in practice it never happens, because "regular users" = { me }, but I like being pedantic.
As for /mnt, it is supposed to be a single temp. mountpoint, but I use it as the parent directory of multiple mountpoints some of which are just for temporary use.
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
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).
My Files, which are inside the partition mounted in /mnt/something has root as Owner. So When I try to move something to Trash, it's not allowing me to do, Only perma delete. When saw properties it said owner is root.
Is it because mounted at /mnt?
Files under /media seems fine. and says it's owner is 'me'
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.
This is from times where Unix & co only ran on a corporate server and cubicle slaves accesed it via thin client. There was /home/alice-abbey /home/bert-branson on one disk of the server, '/' root on another, with less storage and more performance. And often /usr on a third. While /-root has to be locally, everything else can be managed however you're funny, even nfs shares. But historically, /mnt was for temporary mounts. I think the /run/user/usernane/diskname came up with xdg, it's where graphical filemanagers find disks.
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.
Yep, LVM is basically a software raid 0, I used it when setting up Linux server VMs for years at my last job, as far as I know they are still running fine.
The VM system backed up all VMs regularly, so I used LVMs as it made increasing the storage on a server easier for me.
Since it is just a raid 0 that can span several disks and one disk failiure can bring it down I don't want any irriplacable data on it, so games from Steam seems like an excellwnt idea.
That also means that being able to just have a volume spanning several disks would be an easy and simple way to increase storage when space is running tight.
I am an avid hobby photographer and I would never trust an LVM without some kind of added protection, I am looking to get a Synology NAS with minimum of four drives raided in raid 5.
I have a very old Intel NAS with used drives that I used for many years, but I don't trust it anymore, I keep it powered off as a cold backup.
I used to mount network attached storage in /mnt until I had problems accessing it from a Snap. In searching for a solution it was pointed out that snaps are correct in being sandboxed from these types of folders, and users like myself are making things difficult for ourselves by using those system folders.
They said the best practice would be to mount them in a folder in your home directory. I've switched to doing that and it works great.
IMO you should use LVM2 or one of the high level filesystems that have similar features, and then dynamically create partitions and mount them as needed. E.g. Suddenly need 50G for a new VM image? Make a partition and mount it where you need the space.
You are correct, LVM combines 1 or more disks into 1 or more storage pools that can then be allocated out to logical volumes as needed.
If you just up and pull a disk from a pool (volume group), you're gonna have a bad time. You can, however, migrate the "extents" allocated to that physical disk to another in order to replace the disk, and your logical volumes can be set up with RAID-like redundancy. There's a lot of options on how to manage it.
My Files, which are inside the partition mounted in /mnt/something has root as Owner. So When I try to move something to Trash, it's not allowing me to do, Only perma delete. When saw properties it said owner is root.
Is it because mounted at /mnt?
Files under /media seems fine. and says it's owner is 'me'
/mnt is not for everything, it is a temporary mount point. For fixed drives that are constantly mounted you should use another location (that could be anywhere in the filesystem tree).
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/DUID is 3c6905d2260afe09, I mount /dev/sd0i at /3c6905d2260afe09.i. fstab entry looks like
Mount them where you need. Not /mnt and not /media. Maybe /var or its subdirectory, or /srv, or /opt depending on what kind of data you want to store on that partition.
The filesystem is organized to store data by its type, not by the physical storage. In DOS/Windows you stick to separate "disks", but not in Unix-like OSes. This approach is inconvenient in case of removable media, that's why /media exists. And /mnt is not suited for any particular purpose, just for the case when you need to manually mount some filesystem to perform occasional actions, that normally never happens.
Just media files, downloads, images , music kinda stuff.
That's what usually goes to /home/<username>. Maybe mount that device directly to /home? Or, if you want to extend your existent /home partition, use LVM or btrfs to join partitions from various drives. Or mount the partition to some subdirectory of /home/<username>, or even split it and mount its parts to /home/<username>/Downloads, /home/<username>/Movies etc. So you keep the logic of filesystem layout and don't need to remember where you saved some file (in /home/<username>/Downloads or in /whatever-mountpoint-you-use/downloads).