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?

4
  • 2
    The first thing that comes to my mind is mount -a; is that something you've considered?
    – Jeff Schaller
    Commented Feb 7, 2022 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
    Commented Feb 8, 2022 at 0: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
    Commented Feb 8, 2022 at 21:57
  • Ah, I can use mount -af, but I am having another weird error there: unix.stackexchange.com/questions/712127/…
    – xeruf
    Commented Aug 2, 2022 at 10:48

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .