1

I'm trying to create an fstab entry for /dev/fd0 so that user can mount a floppy formatted either with VFAT or ext32. The simple fstab entry

/dev/fd0 /mnt/floppy auto noauto,user,sync,gid=users,umask=000 0 2 

can only mount DOS floppies. If I change the entry to

/dev/fd0 /mnt/floppy ext2 noauto,user,sync 0 2 

then I can only mount a floppy with ext2 filesystem. Obviously, I can issue a root mount command with appropriate -t option and mount either floppies. Is there a way to mount floppy as user with the simple command

mount /mnt/floppy 

for floppies with either VFAT or ext2 filesystem?

0

1 Answer 1

0

From man 8 mount on Linux:

If no -t option is given, or if the auto type is specified, mount will try to guess the desired type. Mount uses the blkid library for guessing the filesystem type; if that does not turn up anything that looks familiar, mount will try to read the file /etc/filesystems, or, if that does not exist, /proc/filesystems. All of the filesystem types listed there will be tried, except for those that are labeled nodev (e.g. devpts, proc and nfs). If /etc/filesystems ends in a line with a single *, mount will read /proc/filesystems afterwards. While trying, all filesystem types will be mounted with the mount option silent.

So just create a file /etc/filesystems containing something like this:

ext4 ext3 ext2 vfat msdos ntfs iso9660 ufs xfs 

Add more filetypes if you need. Then you can use type auto in fstab.

3
  • @Sato Katsura - thanks for your interest in responding to my question. I do have the /etc/filesystems file that contains ext2 and vfat entries, yet fstab with auto entry gives error suach as "bad superblock..." if using mount command without -t option. The cat /proc/filesystem shows only filesystems currently used by mounted devices. This problem happens only with /dev/fd0; I can mount auto sda devices (usb sticks formatted either vfat or ext2). Strange behavior for fd0? Commented Oct 18, 2017 at 15:19
  • @Janos The order is important, the entries are tried in order. If msdos comes before vfat and you try to mount a vfat filesystem you'll get an error, because the filesystems are similar enough for msdos to match. Commented Oct 18, 2017 at 15:31
  • @sato Katsura - it works now! Thanks again, Janos Commented Oct 20, 2017 at 2:14

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.