Intended approach for mounting secondary drives on boot with Fedora KDE Plasma

Hi there folks!

New here swapping off msft.

I’m having a challenge with mounting a second nvme drive consistently on boot/login.

So far I have tried to stick with using KDE Partition Manager, but it seems the drive is inconsistently mounted when starting up. I haven’t been able to diagnose what particularly is going wrong. If it isn’t mounted after boot, going into KDE Partition Manager and mounting it manually always succeeds. It tends to suggest timing and/or permissions issues to me but I’m unclear how to diagnose it. Any help here would be appreciated!

I’ve done some basic searching out there and tried gnome disks as well as using the System Settings for Device Auto-Mount. Gnome Disks errors and tells me there is an issue with the drive, which seems suspect. The System Settings doesn’t appear to give me any options for where it should be mounted to and does seem to work, but doesn’t put it at the path I need. One of the challenges I hit setting up the machine is some of the software I’m relying on. For now, I’m trying to stick with using Dropbox which doesn’t seem to want to support sync’ing with paths that aren’t under /home, so I had to setup a custom mount path under that.

If anyone has suggestions for diagnosing exactly why I’m getting this inconsistently, I’d appreciate it.

Thanks!

Hi Bert,
Welcome to Fedora :slight_smile:

Not knowing precisely what you have set up, I’ll just give you how I do it :slight_smile:
Ok, let’s put your second drive at /u02 – so, as root create /u02 right off the root (mkdir /u02)
Next, make certain your disk is partioned and has a filesystem on it (probably already done and I am going to assume the FS is ext4 and that the partition and device is /dev/nvme0n2p1
Now as root let’s make an entry in /etc/fstab that looks like this:
/dev/nvme0n1p1 /u02 ext4 defaults 1 2

Note: you will need to verify the correct disk/partition to mount as mine may not be the same. Also make certain that in the /etc/fstab that there are space chars between the entries on the line.
-----------------------------------

If everything looks about correct, as root do:
mount /u02

The disk should mount pretty much instantly in the correct location. Next, reboot and double check that the mount is still correct. If it is, you are done :slight_smile:

Now, others will most likely chime in with alternate ways of doing the same thing so … :slight_smile:

On Linux systems, mounting things is traditionally handled by the file /etc/fstab (or a .mount unit with systemd, which Fedora uses, but its documentation states that /etc/fstab is preferred for human configuration).

You can edit fstab as root like this:

$ sudo nano /etc/fstab

In mine, I have added a line to mount a LUKS-encrypted partition from an older 4TB SATA SSD (automatically unlocked with a keyfile on my also encrypted /):

UUID=2a[redacted]99 /volumes/CT4000MX500SSD1    btrfs   nofail,compress=zstd:1,x-systemd.device-timeout=0 0 0

Lets break this line down:

  • The UUID at the beginning is what you want to mount. You can get the UUID with lsblk -f
    $ lsblk -f
    NAME                     FSTYPE      FSVER LABEL           UUID           FSAVAIL FSUSE% MOUNTPOINTS
    sda
    └─sda1                   crypto_LUKS 2                     cc[redacted]37                
      └─luks-CT4000MX500SSD1 btrfs             CT4000MX500SSD1 2a[redacted]99  526,9G    86% /volumes/CT4000MX500SSD1
    
  • /volumes/CT4000MX500SSD1 is the mountpoint I have chosen, can be created with sudo mkdir -p /volumes/CT4000MX500SSD1 ← adjust for your chosen mountpoint.
  • btrfs is the filesystem. Change to whatever lsblk -f showed in the FSTYPE column.
  • nofail,compress=zstd:1,x-systemd.device-timeout=0 are the options to mount. I copied the options from my / filesystem, removed subvol (this partition only uses the default subvol) and added nofail. Without nofail, your system would stop its boot process if this partition could not be mounted. That is probably not what you want.
  • Finally, 0 0 determine dumping and checking of filesystems. 0 means “don’t dump” and “don’t check”, respectively.

I always recommend to add nofail to any mount that is not essential to your system. This way, if mounting it fails, your system still boots and you can investigate and fix it.

Without nofail, your system stops booting and drops you into a recovery environment, since it considered the failed mount to be essential (you didn’t tell it otherwise). Debugging and fixing stuff like this in a recovery environment is not much fun.

Thanks there Lars this got me there!

I appreciate all the details. I think at some point KDE Partition Manager or Disks wrote some invalid lines to /etc/fstab. I found a seemingly invalid line at the top of the file before the comments, and then found two lines attempting to mount the drive; one by device path and another by UUID. Wiping the first bunk line and the redundant device path line and mounting seems to have it working after 5 reboots!

Appreciate the comparison to the / drive path. Mine were matching sans the compression option which shouldn’t have caused the issue from what I can tell. Was great to confirm the settings were valid (mine has nofail,users). I believe KDE Partition Manager added the nofail as a default choice which I’d noticed and makes sense to prefer.

For completeness, I’m mounting by UUID to /home/b1080/_data so that its under /home that Dropbox will play nice with.

This was good validation info, thanks!