Checking fstab settings AND Automount options?

Hi Everyone,
For years, the fstab file I created for mounting my drives worked perfectly.
But recently I installed a new nvme drive for my system and had to make a new fstab.
Despite checking it carefully, my system failed to boot.

This has left me with two questions:

1. Automount or custom fstab?
Currently I am using Dolphin to mount each drive when I need it, but this is troublesome and interferes with software that requires constant access to drives.

  • a) Can I simply use the “Removable Devices” feature in KDE and select “Automatically mount removable media that has never been mounted before” and use that instead of creating a custom fstab? I had a lot of trouble with that 5 years ago and am wondering if its a better option now than creating a custom fstab.
  • b) would it be better to use system mounts as described here: [root tip] Use systemd to mount ANY device

2. Checking my custom fstab.
I have re-examined my fstab. Before I try to use it, I would like to ask if experienced users could check it for me. fstab settings
I have included the commands used for the each drive, and a question. .

The results from sudo blkid are:

    ~  lsblk -o NAME,SIZE,TYPE,PARTTYPENAME,FSTYPE,MOUNTPOINT                                                                                 PIPE|1 ✘ 
NAME          SIZE TYPE PARTTYPENAME       FSTYPE MOUNTPOINT
sda           3.6T disk                           
└─sda1        3.6T part Linux filesystem   ext4   /run/media/ray/HSdisk2
sdb         465.8G disk                           
└─sdb1      465.8G part Linux filesystem   ext4   
sdc         465.8G disk                           
├─sdc2      127.4G part Linux filesystem   ext4   
└─sdc4        333G part Linux filesystem   ext4   
sdd         931.5G disk                           
└─sdd1      931.5G part Linux filesystem   ext4   /run/media/ray/SSD2
sde         119.2G disk                           
└─sde1      119.2G part Linux              ext4   /run/media/ray/SSD4
sdf           3.6T disk                           
└─sdf1        3.6T part Linux filesystem   ext4   /run/media/ray/HSdisk6
sdg           3.6T disk                    ext4   /run/media/ray/HSdisk5
sdh           3.6T disk                           
├─sdh1        128M part Microsoft reserved        
└─sdh2        3.6T part Linux filesystem   ext4   /run/media/ray/HSdisk4
sdi           3.6T disk                           
├─sdi1        128M part Microsoft reserved        
└─sdi2        3.6T part Linux filesystem   ext4   /run/media/ray/HSdisk3
nvme0n1       1.9T disk                           
├─nvme0n1p1   512M part EFI System         vfat   /boot/efi
├─nvme0n1p2  15.6G part Linux swap         swap   [SWAP]
├─nvme0n1p3 146.5G part Linux filesystem   ext4   /
└─nvme0n1p4   1.7T part Linux filesystem   ext4   /home

The results from sblk -o NAME,SIZE,TYPE,PARTTYPENAME,FSTYPE,MOUNTPOINT are:

NAME          SIZE TYPE PARTTYPENAME       FSTYPE MOUNTPOINT
sda           3.6T disk                           
└─sda1        3.6T part Linux filesystem   ext4   /run/media/ray/HSdisk2
sdb         465.8G disk                           
└─sdb1      465.8G part Linux filesystem   ext4   
sdc         465.8G disk                           
├─sdc2      127.4G part Linux filesystem   ext4   
└─sdc4        333G part Linux filesystem   ext4   
sdd         931.5G disk                           
└─sdd1      931.5G part Linux filesystem   ext4   /run/media/ray/SSD2
sde         119.2G disk                           
└─sde1      119.2G part Linux              ext4   /run/media/ray/SSD4
sdf           3.6T disk                           
└─sdf1        3.6T part Linux filesystem   ext4   /run/media/ray/HSdisk6
sdg           3.6T disk                    ext4   /run/media/ray/HSdisk5
sdh           3.6T disk                           
├─sdh1        128M part Microsoft reserved        
└─sdh2        3.6T part Linux filesystem   ext4   /run/media/ray/HSdisk4
sdi           3.6T disk                           
├─sdi1        128M part Microsoft reserved        
└─sdi2        3.6T part Linux filesystem   ext4   /run/media/ray/HSdisk3
nvme0n1       1.9T disk                           
├─nvme0n1p1   512M part EFI System         vfat   /boot/efi
├─nvme0n1p2  15.6G part Linux swap         swap   [SWAP]
├─nvme0n1p3 146.5G part Linux filesystem   ext4   /
└─nvme0n1p4   1.7T part Linux filesystem   ext4   /home

My planned FSTAB is as follows. I have included questions

This EFI-boot partition on Team nvme0n1p1.

UUID=F8E0-2D49 /boot/efi vfat umask=0077 0 2

Why does MTAB use a very different set of operators for the drive?

/boot/efi vfat rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 0

The root partition on Team NVME0n1p3.

UUID=20f477fc-e057-42fd-ab1b-4e5609669e8f / ext4 defaults,noatime 0 1

Why does MTAB use
/dev/nvme0n1p3 / ext4 rw,noatime 0 0

The home partition on Team NVME0n1p4.

UUID=4c7b91e3-a4e6-4f07-b0d8-13dc016d00fb /home ext4 defaults,noatime 0 2

Why does MTAP use
/dev/nvme0n1p4 /home ext4 rw,noatime 0 0

The swap partition on NVME0n1p2

UUID=f048a1ef-72c0-4e9f-9b10-0ef7d1cedabe none swap sw 0 0

The following mounts are all correct as far as I can ascertain

#HSDisk2.

UUID=b19c4f75-7b75-4738-8af6-b4de9dc440f9 /mnt/HSdisk2 auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=HSdisk2 0 2

Why does MTAB use
/dev/sda1 /run/media/ray/HSdisk2 ext4 rw,nosuid,nodev,relatime,errors=remount-ro 0 0

#HSdisk3
UUID=d6ae7839-1577-44cb-8816-973cc26ffd23 /mnt/HSdisk3 auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=HSdisk3 0 2

#HSdisk4
UUID=e6d88df5-3c6e-4327-afd8-7a0985e1c7bc /mnt/HSdisk4 auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=HSdisk4 0 2

#HSdisk5
UUID=e25ad8e0-b018-4eb8-bb5a-a70d638fb34e /mnt/HSdisk5 auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=HSdisk5 0 2

#HSDisk6
UUID=5b2d0e1b-0032-4783-b562-dea888cd9460 /mnt/HSdisk6 auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=HSdisk6 0 2

#SSD2 Seagate 1tb

UUID=275329e6-8180-4242-ae3b-f2a1544ca163 /mnt/SSD2 auto nosuid,nodev,nofail,noatime,x-gvfs-show,x-gvfs-name=SSD2 0 2

But MTAB shows
SSD2 ext4 rw,nosuid,nodev,relatime,errors=remount-ro 0 0

#SSD3 Samsung 500gb
UUID=92342aa3-b638-4efe-9a2e-c041258344af /mnt/SSD3 auto nosuid,nodev,nofail,noatime,x-gvfs-show,x-gvfs-name=SSD3 0 2

I would greatly appreciate advice on figuring this out!

A final question: why is this still necessary in 2022 for systems with many drives? It seems like a very awkward process that would detract many people from switching to Linux. Surely there is an easier solution. Thanks to all who can provide assistance. :grinning:

You mean you edited your current fstab to add the NVMe… right?


A quick fix for that is to undo the changes you made.


A good way to check whether your fstab is correct is, rather than rebooting and check if the system starts, to ask your system to mount everything right now (based on the content of fstab, the mounts already mounted won’t be tried). Errors should be then shown in the output.

sudo mount -a

If despite that, mounting fails only at boot, it may be an issue of the drive not ready fast enough at startup – though that would be weird for a NVMe. In that, adding the nofail option prevents the system from failing, yet the drive may still be automatically mounted after login.

Hi, yes, that’s what I did, but reinstalled everything because I could not figure out how to undo the changes I made :frowning: I tried using Timeshift, but failed for some reason.

Thank you! I will use that to test my fstab.
It seems that the nofail is a good option. Why is it not used on boot and root drives?

If you’d like help with your fstab
we would require - for more easy overview and understanding:

  • your old /etc/fstab
  • your new /etc/fstab
    each one in one piece … not just single lines of it
  • what errors you get when it fails to boot
  • the output of
    lsblk -f
    as this will list all the drives partitions along with their matching UUID
    this will help you and us
    to figure out what your /etc/fstab should look like vs. what it does now look like

A final question: why is this still necessary in 2022 for systems with many drives? It seems like a very awkward process that would detract many people from switching to Linux.

Well - the system needs to know what drive you want to put where
/etc/fstab is just one option - systemd mount units are another
(even more awkward to you, I presume)
You want the system to “guess” what you want? :wink:

Because these are essential - and cannot fail.
Well, they can - but the system can’t and won’t boot if one of these does … fail.
root and boot are not optional

It doesn’t use anything. /etc/mtab is a symlink to /proc/self/mounts and gives you the parameters for mounted filesystems. Some of those options are defaults and are as such not required to be explicitly set in /etc/fstab.

Wrong way of thinking. You’re trying to think of this with the mindset of a Windows user, while GNU/Linux is a UNIX operating system. Windows was initially conceived as a single-user GUI for DOS, a single-user operating system. UNIX is a multi-user system and makes extensive use of permissions.

The following two tutorials will make everything clear to you. :wink: :arrow_down:

Thanks Nachlese!
My old fstab is gone. I created a new version that I posted earlier. Its complete, though interspersed with questions. I have not yet tried mounting it yet to see if it has errors because I’m not sure if the various operators that I chose are correct.

Indeed, none of this is easy for me. I’d like to learn, but have almost no free time at all.
Are systemmd mount units a better approach?

Hi Aragorn,
Thanks for your reply.

It seems then that the parameters shown in the mtab file can be used to create a custom fstab.
I guess I am wondering if there will be an problems using the mtab default parameters instead of using the custom fstab parameters that I created.

I will examine those tutorials and see if I can understand them. I’m a big supporter of Linux, but lack time to understand the underlying architecture. I am no fan of Windows, but appreciate the fact that users needn’t know much about how it works in order to use it for daily tasks.
Thanks for recommending the tutorials! :grinning:

That is the thing - it is hard to piece together.
Post it as one piece.
And - for your sake as well:
provide the lsblk -f output
so you and we have the UUIDs - which are needed for assembling the /etc/fstab

You can also use the command you used (lsblk -o _list_of_options_) - just add the option to show the UUID as well.

not better (although some would disagree :wink: )
just a different way to do the same thing
If you struggle with fstab, you’ll likely struggle more with those …

My tip: build it progressively.
Start with the bare minimal needed for your system to run…

  • /
  • /boot/efi
  • /home
  • swap

… then add and test the configuration for each extra partition, one by one.

1 Like