Sunday, January 5, 2020

/etc/fstab

I am going deeper than I have done in a very long time.  (Since I was a Unix sys admin on a herd of Sun workstations in the 1980s.)  I want to read a USB drive on my CNC Linux box.  Setup was not too bad:

mkdir usb-drive
mount /dev/sdb1 usb-drive

But trying to set up /etc/fstab has bit me.  When I run mount-a I get "line 14 in /etc/fstab is bad"

Line 14:

/dev/sdb0    /media/usb-drive    vfat  rw,user  0  0

It does not appear that tabs are used as separators.  Any suggestions?




5 comments:

Heh said...

1. if your need isn't permanent, no need to add it to fstab. the mount command will mount it and you should be good to go.
2. the output of a simple "mount" will show what the line should show (need to add the '0 0' to the end of that.
3. you might have some other control character or whatnot. 'cat -A /etc/fstab' (depending on what distro you're using) should show all characters .

Hopefully, that will be enough. :)

John said...

Try this:
Line 14: /dev/sdb1 (1 not 0)

Tabs are good to use as separators just for convenience and legibility, but not required.

Paul Sand said...

Either tabs or spaces should work as separators in /etc/fstab.

I worry a bit about that final '0'. My fstab man page suggests '2' for non-root filesystems.

What does 'findmnt --verify --verbose' say?

rgr said...

Not an expert. But you have sdb1 in one line and sdb0 in the other

Sigivald said...

Garbage invisible characters on previous line, or following the last zero?

The zeros are defaults and can be removed; try that?