OverView
About this
This document is introduction for supermount patch which treats removable media very easily.
Now, this patch is the best way to treat removable media, and is suitable for users who have few UNIX knowledge (like school?).
What can you do with supermount?
- You can get rid of mount/umount. To read/write on media, just access a designated directory.
- You can eject and change media without any command. Media change shall be detected automatically.
Technical overview and term
- supermount is pseudo-filesystem which detects accesses to files/dirs under mount point and mount real device automatically.
- real filesystem was named as "subfs"
preparation: kernel patch
Currently, supermount is provided as kernel patch. Download it from Official page Linux removable media support and apply it to your kernel.
Thereupon, a new config item named Supermount removable media support has appeared in Filesystems. Mark it as built-in or module and compile kernel.
Test
If you could finish updating kernel, try using supermount.
Test FD for First. Execute following command with the root authority.
# mount -t supermount -o dev=/dev/fd0,fs=vfat floppy /mnt
point:
- specify supermount as vfs type.
- can specify any string as device. (choose name which is easy to understand.)
- specify real device name as dev= option.
If you encounter no errors, supermount should works. Then, insert FD, return normal user and exec following command;
$ ls /mnt
You would get a file list. Then change FD and execute ls again. If you get a correct file list of new FD, supermount works well.
If it works, test other commands(e.g. df). You can get information of subfs mounted actually by checking /proc/fs/supermount/subf.
Modify /etc/fstab
When you finish the test, umount /mnt. Modify /etc/fstab to use supermount by default.
Add following entry to /etc/fstab. If similar entries with noauto,user already exist, modify them.
enter the following information into /etc/fstab
floppy /floppy supermount fs=vfat,dev=/dev/fd0,--,codepage=437,iocharset=iso8859-1 0 0 cdrom /cdrom supermount fs=iso9660,dev=/dev/cdrom,--,ro,iocharset=iso8859-1 0 0
If you have replaced entry that already exists, you may specify subfs option after --. The sample above shows some options to convert the file name. You can omit them, if not needed.
Make setting effective
become the root and type the following command for new /etc/fstab you modified.
# mount -a
And, check the mount list as follows;
check the current mount status
floppy on /floppy type supermount (rw,fs=vfat,dev=/dev/fd0,--,codepage=437,iocharset=iso8859-1) cdrom on /cdrom type supermount (ro,fs=iso9660,dev=/dev/cdrom,--,iocharset=iso8859-1)
If you get a result like the sample above, supermount works. Now, you can treat media through a specified directory.
Problem and Future task
Currently, supermount works with IDE CD-ROM Drive and normal FDD. (Probably with SCSI CD-ROM, but I have not tested yet.)
Unfortunately, this does not work with USB CF/MMC reader. Kernel can't detect media change, obsolete cache will remain after media is ejected.
Resources
- supermount Project HomePage
- Documentation/filesystems/supermount.txt (in patched kernel tree)
- supermount has been included in Con Kolivas's patch collection