2

I have been using the following command so far to verify my /etc/fstab:

sudo findmnt --verify

Unfortunately, it spills out warnings for each unreachable disk (which I don't care about) and I have not found a flag to change that. Any clever tip to get rid of these warnings or an alternative standard tool?

xeruf
  • 499
  • 4
  • 16
  • 2
    The first thing that comes to my mind is `mount -a`; is that something you've considered? – Jeff Schaller Feb 07 '22 at 19:35
  • If you don't care about unreachable disks, why are you adding them to `fstab`? There are various ways to handle removable disks without adding them to `fstab`; many of them would be features or extensions of your desktop environment of choice. If you are modifying your `fstab` so often that you need an automated syntax checker for it, for example `vim` will highlight incorrect `fstab` entries with red background if you just activate its syntax highlighting features. – telcoM Feb 08 '22 at 00:29
  • I want something that does not change anything (a sort of dry-run) and is independent of the editor used. I prefer to work text-based, so binding it to the desktop environment is also not appropriate. I like to configure mounting locations of a few regularly-used external disks statically, though. – xeruf Feb 08 '22 at 21:57
  • Ah, I can use `mount -af`, but I am having another weird error there: https://unix.stackexchange.com/questions/712127/mount-unexpectedly-calling-espanso – xeruf Aug 02 '22 at 10:48

1 Answers1

2

You can use sudo findmnt -T /mnt/foo or sudo findmnt -S UUID=insertuuidhere to limit devices you want to verify, though you can only specify one device at a time (run the command for each device)

or you can specify a separate fstab file and use sudo findmnt -F /path/to/alt/fstab --verify and remove entries you don't need in the latter.

jogerj
  • 21
  • 3