I have two internal nvme drives. I like to use one for system/home and the other for project files, data, and home folder backups.
The problem is that no matter how i tried to set up the 2nd drive through partition manager gui, I kept losing access to files and having to remount the drive with the authentication pop-up.
I’ve figured out a way around this by adding a mount entry in fstab but it seems a little far for a regular user to have to delve into linux just to keep a drive mounted.
I’m guessing I’ll forget what I did and might lose functionality if there’s a big update or certainly if I decide to reinstall Fedora (KDE) so I thought I’d bring it up here and clever folk might tell me if I’m missing something obvious.
Not really. You’ve done manually (creating a mount entry in fstab), what the installer would do automatically when you configure your devices during installation using the Anaconda installer.
The easiest way is to know your storage hardware and know in advance how you want it/them divvied up. You know you have two drives, you know how you want them to be setup, so doing so first during install will save you having to do it manually later. During disk selection and partitioning, using the Anaconda installer, you select both the disks and select the Custom and/or Custom Blivet option and then put your system/home partitions on one drive and then setup the other disk and partition for your “other” data.
I needed to do a similar process when I installed my home server since I wanted my system/home data to be on a RAID 1 SSD setup, while the 4x16TB disks I have are in a RAID 6 and mounted at /storage. I could have just installed the OS and /home to one disk, but then I would have needed to RAID it and setup the RAID 6 with mdadm manually post-install (including adding mount points), which is just a hassle when the installer can deal with all of that.
I hear you, and thanks, but I tried that on installation (I likely set it up incorrectly). I was greeted with the password prompt to access the disk..
I think we could benefit from an in-OS (GUI) way to set this up. I might upgrade in future or add another drive. I would prefer not to reinstall the system or manually edit fstab.
I appreciate the answer, though. I’m coming from the perspective of a relative n00b and future n00bs. Thanks
I don’t recognise ‘luks’. I didn’t encrypt the drive through the installer, if that’s what you’re referring to.
I just wiped it and set it as a new btrfs drive (nvme2), not as an extension of /home on nvme1.
I would’ve thought partition manager would have an option for this kind of thing but as I said, I’m still quite green with Linux
I mapped my “extra” partitions using the “Edit Mount Point” in KDE Partition Manager and they’ve just stayed mounted with no problems.
However, I’m pretty sure that I chown’d the mount points to myself before I did that. Maybe that makes the difference.
Can you check the ownership of your mount points? ls -dl /mnt/mystoragedrive (replace the path with your actual mountpoint), and see if it’s owned by your account or by root.
In my experience, the permissions and ownership of the mountpoint becomes irrelevant once you have mounted a file system on that mountpoint. The permission is taken from the root of the new file system, or from the mount options in case of vfat or ntfs file systems. On the other hand, it does no harm to change the permission of the mountpoint.
The SELinux permission may be an issue, however. That can be checked if there are any AVC messages in the journal.
I had similar issues on gnome but I prefer to stick with KDE, personally.
I’ve made an entry in fstab and have my system set up as I like but It’s plain, to me at least, that this kind of multiple drive setup could be a lot simpler to implement for regular users.
I don’t know where I could log the feature request, though.
I’m the owner, now. I can’t say how it was being set before I made the fstab changes but I did spend time trying to figure it out. If i’d seen a way to change ownership, I would’ve set it to my user account. I installed fedora vanilla, just ‘reclaiming’ space on disk1 and creating an empty btrfs disk of disk2.
I’ve spent lots of time today filling it up with data from my (sloooow) cloud storage so it’s impractical to test it right now but I’ll inevitably need to make changes soon.
In the past I have seen the mount point ownership override the file system ownership for the top level of that file system. Thus I always modify the mount point to the ownership I intend to use on the file system.
With some additional testing it appears that as long as the root of the file system being mounted belongs to the user then the ownership of the mount point changes to that user. If the ownership of the file sytem root being mounted is root then the mount point remains with root ownership.
$ ls -ld /mnt
drwxr-xr-x. 2 root root 4096 Jul 16 10:17 /mnt
$ sudo mount -o bind /home/USER /mnt
$ ls -ld /mnt
drwxr-xr-x. 98 USER USER 12288 Jul 15 10:40 /mnt
$ sudo umount /mnt
$ sudo chown USER /mnt
$ ls -ld /mnt
drwxr-xr-x. 2 USER root 4096 Jul 16 10:17 /mnt
$ sudo mount /dev/sdb1 /mnt
$ ls -ld /mnt
drwxr-xr-x. 4 root root 4096 Jul 20 2023 /mnt
$ ls -ld /mnt/*
drwxr-xr-x. 98 USER USER 12288 Jan 8 2025 /mnt/USER
drwx------ 2 root root 4096 Nov 28 2023 /mnt/lost+found
$ sudo umount /mnt
This shows, as you stated, that the ownership of the root directory of the file system being mounted is inherited by the mount point when the mount occurs.
It does, however, require that the user change that ownership immediately after it is first mounted. By default a file system is always owned by root when it is first formatted on the device so if the user wishes access without authentication ownership must be changed.
I have seen similar when a usb device is auto-mounted at /run/media/USER/ where the device is still owned by root and may require authentication to access even if /run/media/USER is owned by the user.
I don’t see that. Before mount: owner USER. After mount: owner root. Thus, the owner comes from the directory entry of the root of the mounted file system.
[root@newbox ~]# ls -dl /tmp/testing
dr-xr-xr-x. 2 nobody nobody 40 Jul 16 18:21 /tmp/testing
[root@newbox ~]# mount /dev/sda3 /tmp/testing
[root@newbox ~]# ls -dl /tmp/testing
drwxr-xr-x 3 bin bin 4096 Jul 16 18:26 /tmp/testing
[root@newbox ~]# ls -al /tmp/testing
total 20
drwxr-xr-x 3 bin bin 4096 Jul 16 18:26 .
drwxrwxrwt. 18 root root 400 Jul 16 18:40 ..
drwx------ 2 root root 16384 Jul 16 18:26 lost+found
[root@newbox ~]#
PS. Can you move this sub-discussion to a new thread, as this is not really relevant to the topic of this thread?
Very informative. Thanks for clearly explaining this. I wasn’t aware that it was even possible to mount hardware at different points of the file system.
My point still stands with regards to regular users and ease of use. For those of us less technically proficient, a (disk utils) toggle switch that sets ownership and mount point wouldn’t go amiss!!
It can all be done through Gnome Disks, for example “Take Ownership” change the owner of the root of a file system to the current user. It also allows you set the fstab entry.