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.
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/dataThank You.
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.So, if I use
chmod
, I get the access and other users (if any) are free to do so.In case of
chown
, I get the full access and others can’t gain access unless I permit.Right?
On Linux files and folders have permissions info for owner, group and everyone else. So you can set individual permissions for these.
By setting the owner to root, if you want to make your user able to read/write that folder, you must either give permissions to everyone to read/write OR assign a group to the folder, give the group permissions to read/write and add your user to that group.
If you instead set your user as the owner of the folder, you can make only your user able to read/write without other fuss.
If you are a newbie, stick to gui file manager. Can you please tell me what file manager are you using? Most of the time you can change permissions thru right click > propriety > permissions.
If you instead set your user as the owner of the folder, you can make only your user able to read/write without other fuss.
Thanks for the tip.
Can you please tell me what file manager are you using?
I’m using Nemo. As it’s the default one on Mint Cinnamon.
deleted by creator
Even if I switch my drives or folder names
You don’t mean changing name of ‘Videos’ right?
entire drive is mounted to /media first, and then all subdirectories are mounted where I need them.
So you mount directories accordind to your need not drives and partitions? Seems flexible.
then your cannot boot into your system anymore.
Why? Are you talking about removing the drive that contains
/
?Oh, I deleted my reply a while ago. But you seem to be able to see it still.
The Videos name change is meant, if I mount the folder on my drive to /home/name/Videos, then next time I mount anything to that place when replacing the drive, then /home/name/Videos will stay the same. That means any application using that path won’t change. That’s the majority how I use my multiple internal drives. I just mount them to fixed positions I use for decades, like in my home.
I prefer directories over partitions, because I can easily rename directories and place them to other places without ever partitioning or resizing again.
Why? Are you talking about removing the drive that contains /?
About the not being able to boot, no I don’t mean the drive that contains the root /. When I mount drives with the /etc/fstab file, then the system tries to mount them on boot time. If the directory that is mounted or the drive is no longer available or I unplug it (lets say when I replace my Documents drive), then at boot time the system tries to mount something that does no longer exist in their view, according to the fstab file.
By default (at least on my current system EndevaourOS, based on Arch) the system stops booting. It gives me the option to ignore that mount entry, so I can boot again. But if I had not this option to ignore, then one has to edit the /etc/fstab file to outcomment those sections; in example with a boot cd or usb drive. Normally not a problem, but just telling it here, so in case you know what to do (if you ever go that route).
Adding the nofail option to the fstab entry will continue boot if the drive isn’t present.
That’s great! I didn’t know this (obviously). I will read into this option more, before making changes. It’s not something I need much often (really only happened a few times in a decade). But its good to know!
Thanks.
Thank You.
for some reason Photon UI still shows the deleted comment with just trash can symbol.
That’s because federated content is probably copied, rather than linked.
I don’t understand the need to caching the content instead just accessing it on the go.
Caching should be quicker and less dependent on all sources. Can’t say if that is the actual reason here, but those are typical reasons to cache or copy stuff. That also means it is still operational (to a degree) if the other servers are down or slow. Realtime operation makes sense if everything is from one source and is under 100% control. At least in my opinion.
There are also problems like the above case.
Also let’s say some instance have i//egal content on it, it would take only one user from your instance to see that content, and now you are hosting the i/lega/ content.
/mnt is for anything and everything. /media doesn’t even exist on Arch based distros and maybe others.
/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)./mnt
is not for everything, it is a temporary mount point.Even if I mount fixed drives on
/mnt
, there won’t be any problems, right ?Technically, no. Until you want to mount something but find
/mnt
is busy or simply forget about this and mount something there, losing access to previously mounted stuff. The only problem is that you have to remember which mountpoint you use for particular filesystem, while the FHS is designed to avoid this and abstract from physical devices as much as possible.Thanks. I guess I’ll make something like
/Disks
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’
IDK if I’m doing anything wrong.
You can adjust ownership and permissions for
/mnt/something
usingchown
andchmod
.Thank You.
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.
If I’m not wrong LVM is a method which joins all your disk into single storage pool.
Let’s say I stored data all across my LVM, now I remove one of the disks. What happen now?
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.
Thank you for explaining.
No problem! To expand further, I am 99% certain it would be perfectly viable to have a single disk volume group and just take advantage of LVM’s ability to create, resize and delete virtual partitions on the fly. I think you could also put all your disks into a single volume group, then ask it to not spread your logical volumes across multiple disks, if you wanted to. Could get a bit fiddly though.
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.
Thanks man. I think I’ll stick to this.
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
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.
fixed disks under /mnt
NAS 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’
The answer to your question why is because I arbitrarily decided on that years ago. That’s basically all there is to it.
The answer to your file ownership problems I can’t answer, because I don’t have that happening. My files are mounted like so:
LABEL=BigHD /mnt/BigHD btrfs nosuid,nodev,nofail,noatime,x-gvfs-show,compress-force=zstd:1 0 0
The answer to your question why is because I arbitrarily decided on that years ago. That’s basically all there is to it.
Thanks for clarifying bro
Mounting to a specific location should not affect the permissions of the drive. But in the case of NTFS and some other filesystems, Linux is not compatible with their permission model, so it is simplified by e.g. making all files be only accessible by root.
You can override this default with mount options, or change the permissions to sensible values with chmod and chown, but I’m not sure if changing them will have negative side effects on the windows side so the latter may not be a good idea.Thank you bro. I think I’ll stick into making new folder for my disks in
/
.I would recommend to put them inside /mnt for internal disks. It’s a bit more organized that way, and by looking at the path is easier to know that it’s in an internal drive.
Thank you for the recommendation.
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.
Thank You.
I also just saw your edit. Look into Linux ownership and permissions.
chmod
andchown
are important commands to know how to use as a Linux system administrator.Running
sudo chown -R user:user ./drive
in/mnt
will give your user account ownership of that directory and all folders inside of it.Make sure you replace
user
with your username anddrive
with the name of the mount point for the drive.sudo chown -R user:user ./*
Not afraid of terminal or anything, but can’t I do it in GUI?
EDIT: I think I can do it by going to file properties on an elevated file manager.
Hm, you probably can, but I personally don’t and I’m not sure which file manager you’re using. I like the terminal for this because it’s quicker and easier to do (or undo if you fuck up).
I also gave you the wrong command earlier,
sudo chown -R user:user ./*
doesn’t affect the top-level folder (e.g.,/mnt/drive
). My mistake.Thank You.
I’m using Nemo. Because Mint.
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.Not
/mnt
and not/media
Why though?
what kind of data
Just media files, downloads, images , music kinda stuff.
Why though?
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
).mount the partition to some subdirectory of
/home/<username>
, or even split it and mount its parts to/home/<username>/Downloads
,/home/<username>/Movies
etcThanks bro. I think that’s what I’m gonna do.
Basically if I add it to my fstab it goes to /mnt. I let the system handle /media for usb etc
Thank You.
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.Thanks man.
Mount your internal disks to
/D:
,/E:
,/F:
, etc.🥇
Idk, I mount my disks in /mnt/whatever, though I don’t think it matters where you mount them.
Thanks.
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.
But what about cases where you wish to mount and share with multiple users?
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.
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
deleted by creator
Seems like a joke. 🙂