Multiple internal drives

I’m not sure if there’s a simpler way but…

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.

Thank you!

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.

1 Like

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

Did you encrypt both drives with luks during install?

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.

I don’t think the installer has an option to set ownership of drives as they are configured. Everything except /home/USER are probably owned by root.

The problem with having to authenticate sounds like the mount point and file system on the drive are likely owned by root.

To me it seems like a few simple commands may fix that.

  1. dismount that file system. sudo umount <mount point>
  2. change ownership of the mount point. sudo chown USER:USER <mount point>
  3. remount the file system. sudo mount -a
  4. change ownership of everything on the file system. sudo chown -R USER:USER <mount point>

After these steps the file system should be accessible without requiring authentication.

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.

1 Like

If your are using gnome you can also check out gnome-disks and pretty much set everything you need up.

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.

Cheers for all the advice

The feature does exist - right-click on “Edit Mount Point” in KDE Partition Manager.

So if that isn’t doing the right thing (e.g. you still get permission requests after doing that), it’s more of a bug than a feature request.

1 Like

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.

Let’s try

[root@newbox ~]# ls -dl /tmp/testing
d---------. 2 root root 40 Jul 16 06:22 /tmp/testing
[root@newbox ~]# mount /dev/sda5 /tmp/testing
[root@newbox ~]# ls -dl /tmp/testing
dr-xr-xr-x. 20 root root 4096 Jun 28 11:13 /tmp/testing
[root@newbox ~]# umount /tmp/testing
[root@newbox ~]# 

I have in the past used that to prevent accessing to this directory before the file system is mounted.

You can certainly continue doing that, if you wish.

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.

1 Like

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!! :wink:

Which is exactly what I said

Rephrased
The mount point inherits the ownership of the root directory of the file system being mounted.

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.