# Supermount Installation and Setup

## wolvenwraith

I have seen Supermount mentioned several times on these forums, but never saw a complete how-to on setting it up, so here I am submitting it myself. For a quick background, suppermount is a way of automatically mounting removable disk drives (floppys, cd-roms, dvd-roms, etc) without having to manually mount them or using some sort of kde/gnome on-the-fly (u)mount magic. Because of the nature of supermount, it allows you to eject the drive while it is mounted (if it's reading it blocks it) and will automatically handle the appropriate mounting/unmounting.

The first step is to acquire a kernel which has the appropriate kernel patch on it. I just went ahead and grabbed the gentoo-dev-sources which has supermount/bootsplash and a few other things. You could also use the vanilla sources and the patch from http://supermount-ng.sourceforge.net (also has more information on the supermount-ng).

If you want to patch the kernel yourself, first make sure that /usr/src/linux is the kernel you wish to patch. Copy the patch to /usr/src/linux and apply using the following commands.

```

cp supermount-2.0.3-2.6.0.patch.gz /usr/src/linux

cd /usr/src/linux

gzcat supermount-2.0.3-2.6.0.patch.gz | patch -p1

```

You will get a listing of the files that were patched and if there were any errors it'll tell you. Keep in mind that the patch will not work on all pre-patched kernels as another patch could break this patch.

Next step is to be sure to enable the appropriate option in the kernel. It is sorta hidden and I couldn't find it without looking through the .config file. 

```

File systems  --->

    Pseudo filesystems  --->

        <*> Supermount removable media support

```

I have mine built in to the kernel, but it might also be a good idea to build it as a module so that if it crashes it doesn't take your kernel down with it.

Before you reboot with your new kernel, make the directories for your mount points

```

mkdir /mnt/dvd

mkdir /mnt/cdrw

mkdir /mnt/floppy

```

and edit your /etc/fstab file to include the following entries. Make sure the mount points here go along with the mount points we just created above.

```

none                    /mnt/dvd        supermount      fs=auto,dev=/dev/cdroms/cdrom1  0 0

none                    /mnt/cdrw       supermount      fs=auto,dev=/dev/cdroms/cdrom0  0 0

none                    /mnt/floppy     supermount      fs=auto,dev=/dev/fd0,--,user,rw    0 0

```

Now you can reboot.

The layout for this should be fairly self explanatory. I've never had to use anything but "auto" for the fstype and of course your device point to the device of your drive. The second option is your mount point. Make sure that the first field is "none" as having the device name in this field may cause things to be slow.

Well that's it. Knowing me I probably left a lot out, leave me some feedback on whether or not it works and/or anything you would add. I will be editing this as feedback comes in (or if I think of something as I made this up from memory).Last edited by wolvenwraith on Sat Jan 03, 2004 7:45 am; edited 4 times in total

----------

## Krigare

This seems like a good idea to try..

----------

## at6

hey wolvenwraith,

thx for this great tutorial. now watching dvd's or listening to cd's is much more comfortable. 

go home "mount /mnt/dvd"  :Wink: 

marc

----------

## darkcoder

thanks for the tutorial, but I have one question.  For the floppy I use a similar configuration and it works, but readonly.

This is my fstab

```
/dev/hda1                       /mnt/windows    ntfs user,rw,exec,uid=1000,gid=100,umask=700 0 0

/dev/hda2                       /boot                  ext3                  noauto,noatime    1 2

/dev/hda3                       /                           reiserfs          noatime,notail        0 1

/dev/hda4                       none                   swap               sw                             0 0

/dev/cdroms/cdrom0   /mnt/cdrom      supermount      user,ro,fs=auto,exec,dev=/dev/cdroms/cdrom0     0 0

/dev/fd0                          /mnt/floppy        supermount      user,rw,fs=auto,dev=/dev/fd0    0 0

proc                                 /proc                      proc            defaults      0 0

usbdevfs                        /proc/bus/usb     usbdevfs        auto,user,devmode=0666,devgid=85        0 0

none                                 /dev/pts               devpts          defaults

0 0

none                                 /dev/shm            tmpfs           defaults

0 0

```

----------

## wolvenwraith

Try This

```

/dev/fd0                          /mnt/floppy        supermount      fs=auto,dev=/dev/fd0,--,user,rw    0 0 

```

I believe supermount needs the filesystem options and the supermount options to be separated in fstab. Give this a shot, and if it works, let me know and I'll toss it in the how-to.

Believe it or not, I don't have a floppy on this system I can try it with.

--edit

see next post belowLast edited by wolvenwraith on Sat Jan 03, 2004 12:35 am; edited 1 time in total

----------

## wolvenwraith

oh and I almost forgot. Thanks for all the feedback guys  :Smile: 

----------

## FreeFly42

 *darkcoder wrote:*   

> thanks for the tutorial, but I have one question.  For the floppy I use a similar configuration and it works, but readonly.

 

You really should avoid double posting, or at the very least warn people when you do.

----------

## FreeFly42

 *wolvenwraith wrote:*   

> Try This
> 
> ```
> 
> /dev/fd0                          /mnt/floppy        supermount      fs=auto,dev=/dev/fd0,--,user,rw    0 0 
> ...

 

You will run into problems if you specify an actual device on a supermount drive.  The first entry should be "none" rather than "/dev/fd0".  

 */usr/src/linux/Documentation/filesystems/supermount.txt wrote:*   

> WARNING: in the above description `none' is literal word. While device
> 
> is ignored by supermount itself, using real files in this place (real
> 
> device name or mount point directory name) is known to cause problems.
> ...

 

----------

## wolvenwraith

woops I didn't catch that, I copy/pasted that over from his original line. but you're right, it should be like this.

```

none                          /mnt/floppy        supermount      fs=auto,dev=/dev/fd0,--,user,rw    0 0

```

----------

## searcher

If you don't want to use the gentoo-dev-sources, but rather your own kernel/patchset, you can download the patch from here.

Make sure your `/usr/src/linux' symlink is pointing to the right sources, and copy the patch to this directory (# being a root prompt).

```
# cp supermount-2.0.3-2.6.0.patch.gz /usr/src/linux
```

next, gunzip the patch:

```
# gunzip supermount-2.0.3-2.6.0.patch.gz
```

Now you will need to patch the kernel sources, by typing:

```
# patch -p1 < supermount-2.0.3-2.6.0.patch
```

You will get some output saying which files are patched. From here you can pick up again on the original poster's howto.

~searcher

----------

## OneOfOne

 *searcher wrote:*   

> If you don't want to use the gentoo-dev-sources, but rather your own kernel/patchset, you can download the patch from here.
> 
> Make sure your `/usr/src/linux' symlink is pointing to the right sources, and copy the patch to this directory (# being a root prompt).
> 
> ```
> ...

 

just a tip, you can do : gzcat supermount-2.0.3-2.6.0.patch.gz | patch -p1

peace

----------

## wolvenwraith

There we go, updated the how-to with information on patching your own kernel and the floppy line. Thanks for all this feedback, in due time we could have a pretty comprehensive how-to here. Also, if you notice anything that doesn't make sense or typos/etc let me know too, cause this will always be improved.

----------

## FreeFly42

Looking back at the edits (and trying to view with a n00b's eye) it occurs to me that some will not clue in to the fact that each entry needs to be on a single line.  Maybe some of the spaces should be deleted so it fits on one line.

----------

## wolvenwraith

Added the spaces in and the reminder that you need to create your mount points. Noticed some people thought that supermount created the mount points automatically somewhere else on the forums.

----------

## dgrant

I use KDE and I remember a long time ago I used Mandrake with KDE and somehow it made icons pop up on the desktop as soon as they were mounted, or if something like a USB driver was plugged in.  I know Mandrake uses supermount, so how is this done?  I'm getting a compact flash reader in a few days, and I think it would be pretty cool if I could plug it in, have it mounted automatically, and see an icon pop up on my desktop....

I just thought info about this would be a great addition to the HOWTO in progress.

----------

## wolvenwraith

The problem with this I've noticed is that the DE thinks that it is ALWAYS mounted, since, in a way, it is. So the problem is that in gnome the icons are always on your desktop, and if there's something in there, they just show up. KDE didn't give me any icons for them for some reason, but I'm sure it would be the same way. I just made static links to the directory for KDE.

However, if someone does have a solution to this, I would be interested as well. Would be a nice thing to have on top of all the supermount-niceness.

----------

## dgrant

why is rebooting necessary?  It is isn't necessary for other fstab changes...

----------

## FreeFly42

Rebooting is required if you recompiled your kernel with supermount support.  It wouldn't be needed only to change the fstab.

----------

## dgrant

Hmm, I'm pretty sure supermount is in my kernel, and I know I rebooted.  Let me look at my fstab again and make sure the syntax is all good

----------

## dgrant

I think I probably do have to reboot, so supermount knows what /mnt/ points to watch for activity.

----------

## FreeFly42

No, you can just mount the points.  For example, if you edited your fstab to include a new supermount point:

```
none /mnt/foo supermount dev=/dev/foo
```

rather than rebooting you just call:

```
mount /mnt/foo
```

and the kernel will appropriately update supermount.  :Smile: 

Edit:

Just a note, since I've seen people who said they had problems with games etc. with supermount enabled on certain drives.  You can temporarily disable supermount for a particular mountpoint using a similar method:

```
umount /mnt/foo
```

temporarily disables supermount for /dev/foo.  You can then mount it and unmount it manually all you want.  When you want supermount to resume automatic operation on /dev/foo make sure it is unmounted and remount it with supermount:

```
umount /dev/foo

mount /mnt/foo
```

supermount will be back in business.

----------

## dgrant

oh boy, now I'm getting this:

```
root@sidicpc22 mnt # mount cdrom

Segmentation fault

```

----------

## dgrant

This is what I have in fstab

```

none                    /mnt/cdrom      supermount      fs=auto,dev=/dev/cdroms/cdrom0,--,ro,user       0 0

none                    /mnt/floppy     supermount      fs=auto,dev=/dev/fd0,--,rw,user 0 0

```

----------

## wolvenwraith

```

phil@banshee phil $ cat /proc/filesystems

nodev   sysfs

nodev   rootfs

nodev   bdev

nodev   proc

nodev   sockfs

nodev   usbfs

nodev   usbdevfs

nodev   futexfs

nodev   tmpfs

nodev   pipefs

nodev   eventpollfs

nodev   binfmt_misc

nodev   devpts

        ext3

        ext2

nodev   ramfs

        iso9660

nodev   devfs

nodev   nfs

        udf

nodev   supermount

nodev   rpc_pipefs

        vfat

        msdos

```

check for the supermount line, that'll tell you if you have supermount support in the kernel.

Also, for debugging purposes, you might want to just try building supermount as a module. Also check your dmesg for other errors.

----------

## dgrant

It looks like supermount is there.  I'll try to re-build the kernel.

----------

## dgrant

Anyone else here using supermount-2.0.3-2.6.0.patch.gz and development-sources-2.6.0?

----------

## taskara

 *dgrant wrote:*   

> oh boy, now I'm getting this:
> 
> ```
> root@sidicpc22 mnt # mount cdrom
> 
> ...

 

shoudn't you be calling 

```
mount /mnt/cdrom
```

  :Question: 

----------

## dgrant

 *taskara wrote:*   

>  *dgrant wrote:*   oh boy, now I'm getting this:
> 
> ```
> root@sidicpc22 mnt # mount cdrom
> 
> ...

 

If one always had to use absolute pathnames I would kill myself.

----------

## dgrant

I'm an idiot.  I was using development-sources, not gentoo-dev-sources.  Maybe that's my problem.  Perhaps the gentoo patches for supermount will work better.

----------

## taskara

 *dgrant wrote:*   

>  *taskara wrote:*    *dgrant wrote:*   oh boy, now I'm getting this:
> 
> ```
> root@sidicpc22 mnt # mount cdrom
> 
> ...

 

LOL I always do  :Confused: 

----------

## searcher

 *wolvenwraith wrote:*   

> KDE didn't give me any icons for them for some reason, but I'm sure it would be the same way. I just made static links to the directory for KDE.
> 
> However, if someone does have a solution to this, I would be interested as well. Would be a nice thing to have on top of all the supermount-niceness.

 

You can create these icons yourself, like this (i'm using a localized version of KDE, so i translated the menu entries back to english. They might differ on your version).

Just right-click on your desktop to bring the desktop menu up. From this menu, choose `Create New' and select CD/DVD-romplayer. It will popup a new dialog window asking you to give the shortcut a name and select a station (third page). Hit oké, and you'll be all set. KDE will keep track of mounting and unmounting, although for me personally i still prefer the supermount way.

~searcher

----------

## RikBlankestijn

If you're using the MM sources of the kernel and you want to apply the patch, please see this thread: https://forums.gentoo.org/viewtopic.php?p=775884

That worked for me!!   :Very Happy: 

----------

## MighMoS

my fstab is as follows:

```

/dev/hdb1      /boot      ext2      noauto,noatime,nodev   1 1

/dev/hdb3      /      reiserfs   noatime,notail      0 0

/dev/hdb5      /usr      reiserfs   noatime,notail,nodev   0 0

/dev/hdb6      /home      reiserfs   noatime,notail,nosuid,nodev 0 0

/dev/hdb7      /var      reiserfs   noatime,notail,nodev   0 0

/dev/hdb8      /var/cache/distfiles      reiserfs   noatime,notail,nodev,nosuid   0 0

/dev/hdb2      none      swap      sw         0 0

#/dev/fd0      /mnt/floppy   auto      noauto,users      0 0

#/dev/cdroms/cdrom0   /mnt/cdrom   iso9660      noauto,ro,user,gid=19   0 0

#/dev/cdroms/cdrom1   /mnt/cdrw   iso9660      noauto,ro,user,gid=19   0 0

# Load Windows Partitions

/dev/hda1      /mnt/C      vfat      defaults,rw,gid=411,umask=002 0 0

/dev/hda5      /opt      reiserfs   noatime,notail,nodev   0 0

# NOTE: The next line is critical for boot!

none         /proc      proc      defaults      0 0

none         /sys      sysfs      defaults      0 0

none         /dev/pts   devpts      defaults      0 0

# Supermount stuff

none         /mnt/cdrom   supermount   fs=auto,dev=/dev/cdroms/cdrom0,user,gid=19   0 0

none         /mnt/cdrw   supermount   fs=auto,dev=/dev/cdroms/cdrom1,user,gid=19   0 0

none         /mnt/floppy   supermount   fs=auto,dev=/dev/fd0,user,rw,user,gid=11    0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for

# POSIX shared memory (shm_open, shm_unlink). 

# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will

#  use almost no memory if not populated with files)

# Adding the following line to /etc/fstab should take care of this:

none         /dev/shm   tmpfs      defaults      0 0

none         /tmp      tmpfs      defaults,umask=000   0 0
```

supermount shows up as red in vi, and whenever I try to mount it, I get: "mount: wrong fs type, bad option, bad superblock on none,

       or too many mounted file systems."

----------

## FreeFly42

 *MighMoS wrote:*   

> # Supermount stuff
> 
> none			/mnt/cdrom	supermount	fs=auto,dev=/dev/cdroms/cdrom0,user,gid=19	0 0
> 
> none			/mnt/cdrw	supermount	fs=auto,dev=/dev/cdroms/cdrom1,user,gid=19	0 0
> ...

 

You aren't passing the options correctly.  You need to read /usr/src/linux/Documentation/filesystems/supermount.txt

You don't want these to be user, since they should all be automatically mounted.  Any options to be passed to "mount" need to be after an option "--", so you should have something like:

```
# Supermount stuff

none         /mnt/cdrom   supermount   dev=/dev/cdroms/cdrom0,--,gid=19   0 0

none         /mnt/cdrw   supermount   dev=/dev/cdroms/cdrom1,--,gid=19   0 0

none         /mnt/floppy   supermount   dev=/dev/fd0,--,sync,rw,gid=11    0 0
```

sync is always a good idea to include on a floppy.

----------

## MighMoS

Oh, thanks.  Doing it right seemed to work...

----------

## FreeFly42

 *MighMoS wrote:*   

> Oh, thanks.  Doing it right seemed to work...

 

Amazing!!   :Razz: 

----------

## abracadaver

Just wanted to note that supermount  did some weird things (like claiming the cdrom was mounted but showing nothing with ls)  with  fs=auto  changing it to  fs=iso9660 solved this problem though.

I was using supermount-2.0.3b-2.6.1  and an unpatched  2.6.1 kernel

Nice guide, supermount rocks  :Wink: 

----------

## jo_vermeulen

Hi,

I compiled supermount in the kernel, and adjusted my /etc/fstab just like you said, but nothing happens when I go for example inside the /mnt/cdrom directory. If I umount and mount it again, the same problem occurs. The directory is empty and my device is not reading. 

Do you know what's wrong here?

I' m using gentoo-dev-sources 2.6.1-r1

Kind regards,

----------

## FreeFly42

Can you post your /etc/fstab?

----------

## jo_vermeulen

 *FreeFly42 wrote:*   

> Can you post your /etc/fstab?

 

Here it is:

```

# /etc/fstab: static file system information.

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.12 2003/03/11 02:50:53 azarah Exp $

#

# noatime turns of atimes for increased performance (atimes normally aren't

# needed; notail increases performance of ReiserFS (at the expense of storage

# efficiency).  It's safe to drop the noatime options if you want and to

# switch between notail and tail freely.

# <fs>                  <mountpoint>    <type>          <opts>                                  <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/hdc2               /boot           ext3            noauto,noatime                          1 1

/dev/hdc4               /               reiserfs        noatime                                 0 0

/dev/hdc3               none            swap            sw                                      0 0

none                    /mnt/cdrom      supermount      fs=auto,dev=/dev/cdroms/cdrom0          0 0

none                    /mnt/cdrw       supermount      fs=auto,dev=/dev/cdroms/cdrom1          0 0

none                    /mnt/floppy     supermount      fs=auto,dev=/dev/fd0,--,user,rw         0 0

# NOTE: The next line is critical for boot!

none                    /proc           proc            defaults                0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for

# POSIX shared memory (shm_open, shm_unlink).

# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will

#  use almost no memory if not populated with files)

# Adding the following line to /etc/fstab should take care of this:

none                    /dev/shm        tmpfs           defaults                0 0

```

Thanks for your time!

Kind regards,

----------

## FreeFly42

This looks fine, other than you should probably replace the "user" option for the floppy with "sync".

After you edited /etc/fstab did you mount the partitions?  (You have to mount it to tell the kernel to use supermount to watch that partition.)  In the future this will be taken care of for you automatically when you reboot.

So the procedure to initially start it working is:

include /mnt/cdrom supermount entery in /etc/fstab

mount /mnt/cdrom (as root)

Then the cdrom will be automatically mounted and unmounted as accessed/ejected.

----------

## jo_vermeulen

 *FreeFly42 wrote:*   

> 
> 
> So the procedure to initially start it working is:
> 
> include /mnt/cdrom supermount entery in /etc/fstab
> ...

 

The entry is correct in /etc/fstab as you said.

I tried to mount it as root but then I get this:

providence / # mount /mnt/cdrom/

mount: permission denied

Why is this?

Kind regards,

----------

## snakattak3

I too had to use "fs=iso9660" in my /etc/fstab, instead of "fs=auto". But works after that. If its not working for you, i know this sucks...but you should try rebooting. I only say that because you are modifying kernel modules, or builtin parts. Supermount will then get the right information from fstab when its loaded on bootup. Thanks.

----------

## jo_vermeulen

 *snakattak3 wrote:*   

> I too had to use "fs=iso9660" in my /etc/fstab, instead of "fs=auto". But works after that.

 

I changed the filesystems of the floppy and cdrom devices to vfat and iso9660 respectively, and it works like a charm now! 

Thanks for your advice!

Kind regards,

----------

## gary

First of all, many thanks to wolvenwraith for posting this how-to, and to all of the other folks who have contributed to the thread. 

Following the how-to, I found that my just compiled 2.4.22 kernel has supermount support patched in and activated already, so I just edited the fstab to add the following - 

```
   

# Removables ************************************************************* 

#/dev/cdroms/cdrom0        /mnt/cdrom     iso9660        noauto,ro,user 0 0 

none                       /mnt/cdrom     supermount     fs=auto,dev=/dev/cdroms/cdrom0,ro,--,iocharset=iso8859-1,codepage=850,umask=0 0 0 

#/dev/fd0                  /mnt/floppy    auto           noauto,user,noatime 0 0 

none                       /mnt/floppy    supermount     fs=auto,dev=/dev/fd0,--,user,rw 0 0   

```

What I find is that supermount works perfectly from a shell, but I cannot access it from any of KDE's GUI file managers. KDE dosen't seem to know the drives are mounted. From within Konqueror, for instance, if I select the /mnt directory, Konqueror freezes forever, and once froze KDE compleatly, such that I could not cntrl-alt-bkspc or cntrl-alt-f2 to another vterm. 

The machine is a ThinkPad T20 with a superbay, or whatever they call it, which accepts either the DVD-ROM reader or a 3.5" diskette drive. The behaviour is the same for both drives. 

I have tried changing the file system on the cdrom to ISO9660, and also (as you can see) tried adding options to the cdrom line which came from the previous LM9.1 setup on this machine, on which supermount worked like a champ. None of the changes made any difference. 

So, is there anything suspicious looking about my fstab, or does anyone know how to let KDE know about the supermount? 

Thanks again for this thread, and thanks in advance for any thoughts on my situation.   :Very Happy: 

Gary

----------

## wolvenwraith

Well the only thing I noticed was the placement of the ro option, should be like this. I don't think this will make a difference, but my as well give it a shot. Anyways I'm in a hurry, so see ya

```
none                       /mnt/cdrom     supermount  fs=auto,dev=/dev/cdroms/cdrom0,--,ro,iocharset=iso8859-1,codepage=850,umask=0 0 0
```

----------

## gary

Thanks for the reply, wolvenraith. 

With the ro in the proper place, it now works sometimes. Sort of.  Very slowly. That is, if I click on the /mnt  dir, it will do nothing apparent for 2 to 5 minutes, then show me the subdirectories (cdrom and floppy). It I click on a subidrectory, it freezes forever.

Wierd.

BTW, this is a locally compiled 3.1.5 KDE, if that matters (compile options?). 

Gary

----------

## dalek

I have a interesting problem.  Everything works fine as far as accessing and changing the CD or floppy, but the light stays on on the floppy drive.  Why it do that?

If I eject the floppy, it goes off.  It does not sound like it is turning the floppy, just the light is on.

Kernel version:  2.6.1-rc1  Somebodies got to test the thing.

Anybody else have this little problem?  It works, just curious.

Great how to.  First time I ever got a patch to work right.

Later

 :Confused:   :Confused:   :Very Happy:   :Very Happy:   :Very Happy: 

----------

## taskara

well writing to a mounted floppy (/mnt/floppy) does not actually write to the floppy then and there.

Linux doesn't actually write to the disk until you unmount it (smart) - so that's prob why it's still got the light on.. 

not sure how that works with supermount, because if you manually unmount a floppy, it will write the data first, then unmount... but then supermount won't work next time..

and if u just eject the floppy, then it won't get to write the data ??

----------

## FreeFly42

This is why I strongly suggest using the "sync" option for floppy mounts,

----------

## taskara

 *FreeFly42 wrote:*   

> This is why I strongly suggest using the "sync" option for floppy mounts,

 

that just an option in fstab?

----------

## FreeFly42

Pass it as an option on your floppy entry in fstab as in:

```
none /mnt/floppy supermount dev=/dev/fd0,--,sync 0 0
```

----------

## taskara

thought so, cheers  :Smile: 

----------

## kitchen

using stock gentoo-dev-sources (should I be using supermount-ng, perhaps instead?) version 2.6.1

I have a 128MB Attache` USB memory stick.  Works fine, I can mount it etc.

When I use it with supermount with the following /etc/fstab entry:

none                    /mnt/stick      supermount      fs=vfat,dev=/dev/sda1   0 0

.... it also works.. until I unplug it.

After unplugging it, /dev/sda1 no longer exists, nor does /dev/sda for that matter.

Plugging it back in gives me the following in dmesg:

```
scsi2 : SCSI emulation for USB Mass Storage devices

  Vendor:           Model: USB DISK 2.0      Rev: 1.15

  Type:   Direct-Access                      ANSI SCSI revision: 02

SCSI device sdb: 253952 512-byte hdwr sectors (130 MB)

sdb: assuming Write Enabled

sdb: assuming drive cache: write through

 /dev/scsi/host2/bus0/target0/lun0: p1

Attached scsi removable disk sdb at scsi2, channel 0, id 0, lun 0
```

It's loading it as /dev/sdb ........ also in /var/log/everything/current I see:

```
Feb  2 02:15:36 [kernel] scsi0 (0:0): rejecting I/O to dead device

                - Last output repeated 5 times -

Feb  2 02:15:53 [kernel] FAT: Directory bread(block 513) failed

Feb  2 02:16:07 [kernel] scsi0 (0:0): rejecting I/O to dead device

```

has anyone gotten this type of setup to work properly?

Thanks in advance...

-kitchen

----------

## taskara

not sure, but try adding "sync" to your options in fstab.

usb devices have a write delay, so if you yank it out, it won't have actually finished writing the data.

it's safer to manually unmount, so then linux can finish writing and you can remove it saefly (like stopping the device under windows)

but this then stops it from being automounted next time I believe.

----------

## FreeFly42

for kitchen:

The real problem is that supermount is designed to work with removable media devices not removable devices.  When you insert/remove a memory stick the kernel treats that like adding a hard drive to the system--it loads the module for the device and will try to remove the module after you eject the device.  If you try to run a device like this with supermount, the supermount driver will prevent the kernel from removing the driver properly (supermount will appear to the kernel to be using the device since the device is actually in supermount's control), so it won't work properly the next time you insert it.  For these types of devices you would be better off making them automount in the fstab and setting the sync option (or call sync manually before you eject it) to ensure the data is actually written to the device before ejecting.

----------

## koenvl

When trying to access a supermounted device I always get "No such device". I don't know how come. Supermount is loaded as a module. My fstab line looks like this:

```
none                    /mnt/dvd        supermount      fs=auto,dev=/dev/hdc    0 0
```

Then I do:

```
root@system koen # mount /mnt/dvd

root@system koen # cd /mnt/dvd
```

And I always get "No such device".

What did I forget?

- supermount is loaded (I can see it when I do "cat /proc/filesystems")

- "mount /dev/hdc /mnt/dvd" works

- using latest gaming-sources as kernel

- I don't beleive in a super being

Help would be appreciated!

Thanks

Koen

----------

## dalek

Do you need to add "hdc=ide-scsi" to your bootloader maybe?  You may need to add that for it to work.

Worth a try.

Later

 :Confused:   :Very Happy:   :Very Happy:   :Very Happy:   :Very Happy: 

----------

## taskara

Koen,

you could try the following:

```
none         /mnt/dvd   supermount   dev=/dev/cdroms/cdrom1,fs=iso9660   0 0
```

----------

## koenvl

 *taskara wrote:*   

> Koen,
> 
> you could try the following:
> 
> ```
> ...

 

Ok, at first it seemed to work. I just needed to add "ro" and the CD was supermounted as expected. But now we've got another problem. The CD is mounted automaticly but when I press the button to release the CD nothing happens. I have to do "umount /mnt/dvd" manually as root.

Oh yes, adding "hdc=ide-scsi" to the bootloader didn't make a difference so far. I had heard something like it for CD-writers 'though.

Thank you very much for getting me so far already!!   :Smile: 

----------

## taskara

no worries.. hmm.. u can try emerging "eject" and typing that.

I have actually never used supermount, so I'm not sure how things are supposed to eject.

I assume you press the eject button and it will auto unmount and eject.. but I have never actually tried.. I do everything manually  :Confused: 

----------

## dalek

Make sure you don't have anything in the directory when you try to eject.  If a console is in /mnt/cdrom/anywhere, it will not unmount because you are in there.  If you have Konqueror open and have went into the CD files, you may have to close Konqueror to get it to unmount.  It sort of keeps those files open in case you go back I guess.

That is the same problem I had in Mandrake.  You go in and then leave the CD, but it still thinks you are in there.  If you close Konqueror or type in cd / it will then eject.

That is my experience anyway.  May want to try it.

Later

 :Very Happy:   :Very Happy:   :Very Happy:   :Very Happy: 

edit:  somebody beat me till I can type.  <sighs>    :Rolling Eyes: 

----------

## S. Traaken

Got it working, but only by setting fs=iso9660.  Might be worth adding this option to the guide.

I'm using gentoo-dev-sources-2.6.1-r1 if that helps anyone work out what's causing auto to fail for some of us.

----------

## koenvl

 *taskara wrote:*   

> no worries.. hmm.. u can try emerging "eject" and typing that.
> 
> I have actually never used supermount, so I'm not sure how things are supposed to eject.
> 
> I assume you press the eject button and it will auto unmount and eject.. but I have never actually tried.. I do everything manually 

 

 *dalek wrote:*   

> Make sure you don't have anything in the directory when you try to eject.  If a console is in /mnt/cdrom/anywhere, it will not unmount because you are in there.  If you have Konqueror open and have went into the CD files, you may have to close Konqueror to get it to unmount.  It sort of keeps those files open in case you go back I guess.
> 
> That is the same problem I had in Mandrake.  You go in and then leave the CD, but it still thinks you are in there.  If you close Konqueror or type in cd / it will then eject.
> 
> That is my experience anyway.  May want to try it.
> ...

 

Nope, I hadn't anything open or no console at the mountpoint neither. The command "eject" didn't work until I manually did "umount /mnt/dvd" and then "eject /dev/hdc".

Maybe it has something to do with my drive. It's a NEC DV-5800A, ATAPI CD/DVD-ROM drive. 

Thanks !!!

----------

## Egil.B

thanks for the guide. Supermount is great  :Very Happy: 

----------

## taskara

 *koenvl wrote:*   

>  *taskara wrote:*   no worries.. hmm.. u can try emerging "eject" and typing that.
> 
> I have actually never used supermount, so I'm not sure how things are supposed to eject.
> 
> I assume you press the eject button and it will auto unmount and eject.. but I have never actually tried.. I do everything manually  
> ...

 

eject /mnt/dvd should work.

----------

## mOjO_420

 *dalek wrote:*   

> Make sure you don't have anything in the directory when you try to eject.  If a console is in /mnt/cdrom/anywhere, it will not unmount because you are in there.  If you have Konqueror open and have went into the CD files, you may have to close Konqueror to get it to unmount.  It sort of keeps those files open in case you go back I guess.
> 
> That is the same problem I had in Mandrake.  You go in and then leave the CD, but it still thinks you are in there.  If you close Konqueror or type in cd / it will then eject. 

 

that is a constant frustration for me... but i found that doing a lazy unmount usually works... do this with the "-l" option.

```
# umount -l /mnt/yourdrive
```

of course you definitely need to make sure you are not accessing the drive in anyway... but try that command instead.  The standard kde context menu umount command doesnt do that so right clicking and umounting the drive was failing with device busy, so I wrote a tiny script (using lazy unmounts) and linked to it from the desktop so my wife could figure out how to eject the cdrom.  

```
#!/bin/bash

 umount -l /mnt/cdrom

 eject -r /dev/cdrom
```

make a file called "ejectcd" in /bin, chmod 755 it, and put a link on the desktop.  you may need to emerge the eject program first. 

Anyway, i'm hoping supermount will make this not necessary. I'm about to find out!   Also i will try to use it for my usb flash reader which it seems some have had problems with... if i learn anything useful i'll post it here.

----------

## mOjO_420

 *dgrant wrote:*   

> I use KDE and I remember a long time ago I used Mandrake with KDE and somehow it made icons pop up on the desktop as soon as they were mounted, or if something like a USB driver was plugged in.  I know Mandrake uses supermount, so how is this done?  I'm getting a compact flash reader in a few days, and I think it would be pretty cool if I could plug it in, have it mounted automatically, and see an icon pop up on my desktop....
> 
> I just thought info about this would be a great addition to the HOWTO in progress.

 

you can do this in KDE... 

1.) Right click on the desktop and goto "Configure Desktop"

2.) Click behavior on the left. 

3.) Check "Display Devices on desktop"  and choose from the box below which ones.

all kinds available... samba shares, cdroms, etc, etc...

----------

## tristure

I just wanted to add my "thumbs up" to all the people who have put valuable information in this thread (and especially to the original poster of course!!)

I successfully installed supermount on my system in 10 minutes, and I like that.

Such howtos are really much help for noobs like me!

Thanks!

----------

## get sirius

Ditto to the supportive comments of several others who gave an unconditional thumbs-up to the originator and contributors of/to this thread.

I first installed Gentoo and began playing with it in April '02; for some reason I could never get devfs to work and properly identify/enable my removeable-media devices (obviously the problem was me and not devfs, but that didn't matter when I couldn't figure out how to get it working).  So I would always fall back on SuSE.  After a while I'd come back to Gentoo and tackle it again but run into the same problem.  With supermount everything works, and I don't even have to jump through any hoops!  :Very Happy: 

Thank you!

----------

## mOjO_420

hmm... in follow up... 

supermount works well on the cdrom... love it.

tried it on the 6 in 1 USB card reader and it worked at first but then didnt work... further investigation revealed that the problem had nothing to do with supermount really. It seems that devfs isnt getting updated everytime the flash disks are inserted.  In other words, sometimes i stick it in and  /dev/sda1 pops up and i can mount it and life is good.  Other times I insert it and nothing pops up.  Same with the second slot (/dev/sdb1)  this has nothing to do with supermount really but does anyone know what might be causing this or have any suggetions?

----------

## S. Traaken

hotplug is in charge of that kind of thing (I think...)

Is it installed/running at startup  (rc-update show)

----------

## mOjO_420

 *S. Traaken wrote:*   

> hotplug is in charge of that kind of thing (I think...)
> 
> Is it installed/running at startup  (rc-update show)

 

yup.. latest version even... starts on boot... hotplug seems to be working because it works for my usb joysticks and other things.  I can do a tail on my kernel log and watch it detect things and load driver modules.

----------

## get sirius

Arrgh!  Supermount was working great with gnome: icons even installed on desktop and worked.  So I installed kde (because I like its configurability), and I can't get it working now.  I could always go back to using gnome, I guess, but ....

Anybody else have a similar experience? or able to point me in a direction that may help me fix it?  :Smile: 

----------

## Selecter

Please tell me how to format floppies when supermount is ON?

----------

## FreeFly42

```
umount /mnt/floppy   (turn supermount off)

mkfs /dev/fd0        (format the floppy)

mount /mnt/floppy    (turn supermount back on
```

)

----------

## Biggles

This howto is wonderful.  :Smile:  I already had the supermount module built from my last kernel build, and I managed to get supermount going perfectly with a dvd-rom, a floppy and a usb key drive thing in 10 minutes.

Here's my fstab for the curious:

```
# <fs>                  <mountpoint>    <type>          <opts>                  <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/hda6               /boot           ext3            noauto,noatime          1 2

/dev/hda8               /               reiserfs        noatime                 0 1

/dev/hda9               /home           reiserfs        noatime                 0 1

/dev/hda7               none            swap            sw                      0 0

/dev/hda1               /mnt/win_c      ntfs            ro,user,umask=000       0 0

/dev/hda5               /mnt/win_d      vfat            user,umask=000          0 0

#/dev/cdroms/cdrom0     /mnt/cdrom      iso9660         noauto,ro,user          0 0

#/dev/sda1              /mnt/usbdrive   vfat            user,umask=000,noauto   0 0

# Supermount mounts

none                    /mnt/dvdrom     supermount      fs=auto,dev=/dev/cdroms/cdrom0  0 0

none                    /mnt/floppy     supermount      fs=auto,dev=/dev/fd0,--,user,rw 0 0

none                    /mnt/usbdrive   supermount      fs=auto,dev=/dev/sda1   0 0

# NOTE: The next line is critical for boot!

none                    /proc           proc            defaults                0 0

none                    /sys            sysfs           defaults                0 0
```

----------

## EliasP

Had anyone success in getting Redhat's autorun working??

It's available on their FTP (ftp://ftp.tu-chemnitz.de/pub/linux/fedora-core/development/SRPMS/autorun-3.13-1.src.rpm).

Convert the RPM via "alien" to a tgz.

Looks like it should support supermount, but had no success at all.

Greetings

Elias P.

----------

## EliasP

If you're experiencing problems when ejecting the CD, add this line to /etc/sysctl.conf

dev.cdrom.autoclose=0

Greetings

Elias P.

----------

## thechosen0ne

Thanks, worked nicely for my 128mb usb key... kept me from having to mount/unmount the damned thing. Also works on my dvd drive. Thanks!

----------

## Eagad

There was a question exactly like mine at the beginning of this thread that was never answered:

In Gnome, the cdrom icon is always there with supermount, even when there is no disc in the cd drive. Is there any way to make nautilus know when the drive is actually empty so that it won't show the cdrom icon?

Thanks,

-Chris

----------

## EliasP

 *Eagad wrote:*   

> 
> 
> In Gnome, the cdrom icon is always there with supermount, even when there is no disc in the cd drive. Is there any way to make nautilus know when the drive is actually empty so that it won't show the cdrom icon?
> 
> 

 

I don't think that it is possible to change this behaviour, because the device is mounted all the time, the real mounting/umounting is done by Supermount on a lower level.

Greetings

Elias P.

----------

## AugustineF

OK, this is my entry in fstab.

 *Quote:*   

> none            /mnt/dvd        supermount      fs=iso9660,dev=/dev/cdroms/cdrom0,--,ro,user,umask=0,gid=19  0 0
> 
> 

 

And Following is my listing in /dev

 *Quote:*   

> ls -l hdc cdroms/cdrom0
> 
> lrwxrwxrwx    1 root     root            6 Mar 26 21:14 cdroms/cdrom0 -> ../hdc
> 
> brw-rw----    1 root     cdrom     22,   0 Mar 26 21:14 hdc
> ...

 

And hdc is indeed my dvd drive. But when ever I try to mount /mnt/dvd, I get permission denied message. Even If I try  *Quote:*   

>  mount -t iso9660 -o ro /dev/hdc /mnt/dvd

 

I still get permission denied. 

Btw I am using udev , and its working perfectly.

----------

## FreeFly42

Even though you are specifying the "user" option in your fstab, you can't mount it as an ordinary user for supermount.  The idea of supermount is that the driver is mounted all the time, but the actual device is mounted and unmounted automatically by the supermount driver.  Thus you mount the cdrom once as root when the machine boots (make it auto) and when any user inserts/ejects a cd the mount point will be automatically mounted/unmounted as needed.

I am just assuming you are tryng to do this as an ordinary user due to the "user" option, which for super mount is not needed.

----------

## AugustineF

no I am actually trying to mount it as root.

----------

## t_2199

It works! It works! It works   :Rolling Eyes: 

----------

## snakattak3

I updated the patches for the 2.6.5 kernels. HERE for stock vanilla kernels, and HERE for patching if you use the latest love-sources. They dropped supermount support, and I'm sure all of us in this thread would still lke it  :Smile: 

*** USE AT YOUR OWN RISK ***

They are on a work-for me basis, and right now, they work for me.

All they are is the supermount code 2.0.4, and I just fixed the patches so they patch without any errors for the 2.6.5 kernel.

----------

## forever

Ok but if I want to use only 2.4x version of the gentoo (I mean gentoo-sources) is there any patch to use supermount?? (i tried original one but obviously it fails...)

----------

## snakattak3

 *forever wrote:*   

> Ok but if I want to use only 2.4x version of the gentoo (I mean gentoo-sources) is there any patch to use supermount?? (i tried original one but obviously it fails...)

 

[EDIT]

supermount should already be in the 2.4.x gentoo-sources

[/EDIT]

----------

## miqorz

I'm using Vanilla 2.4.25 from kernel.org and Im looking at http://supermount-ng.sourceforge.net/ and I don't see a patch for 2.4.25..

Anyone have an idea how to get it working?   :Crying or Very sad: 

EDIT:

Sweet I found a nice patch here; http://www.plumlocosoft.com/kernel/#patches

----------

## miqorz

Weird..  I can't seem to use the commands the author says to use because the patch came in a .bz2 and once extracted it has a .diff file..

How do i patch my kernel with this?

"020-supermount-1.2.11a.diff"

----------

## FreeFly42

RTFM (man patch).  Probably wind up with:

```
cd /usr/src/linux

patch -p1 < 020-supermount-1.2.11a.diff
```

----------

## MooktaKiNG

Can you auto mount samba shares using supermount?

What about other network based file systems?

----------

## routerguy

I would just like to sincerly thank wolvenwraith and everybody who contributed to this how-to.  It really helped me with a problem I've been having for a long time!

Keep up the good work!  :Very Happy: 

----------

## snakattak3

 *MooktaKiNG wrote:*   

> Can you auto mount samba shares using supermount?
> 
> What about other network based file systems?

 

I'm not sure. Probably not. I think its only intended for removable media. But maybe you could file a bug report for supermount, and get it in on the next version.

----------

## FreeFly42

I tried getting it to work with Compact Flashes, but in the end I was happier with manually mounting and unmounting them.  You can get it to mount other media, but it doesn't work well becuase supermount is designed to work with eject and eject blocking methods which don't exist for other media types (like network folders).

Seems like there should be a nice method for on-access mounting of anything in /etc/fstab, and auto unmounting based on idle timeout.  But I haven't seen it.

----------

## MooktaKiNG

 *FreeFly42 wrote:*   

> I tried getting it to work with Compact Flashes, but in the end I was happier with manually mounting and unmounting them.  You can get it to mount other media, but it doesn't work well becuase supermount is designed to work with eject and eject blocking methods which don't exist for other media types (like network folders).
> 
> Seems like there should be a nice method for on-access mounting of anything in /etc/fstab, and auto unmounting based on idle timeout.  But I haven't seen it.

 

try to look into autofs

I think autofs can do network mounts. not sure  :Smile: 

sorry, no links  :Razz: 

----------

## Siraris

```
  CC      fs/pipe.o

  CC      fs/namei.o

  CC      fs/fcntl.o

  CC      fs/ioctl.o

  CC      fs/readdir.o

  CC      fs/select.o

  CC      fs/fifo.o

  CC      fs/locks.o

  CC      fs/dcache.o

  CC      fs/inode.o

  CC      fs/attr.o

  CC      fs/bad_inode.o

  CC      fs/file.o

  CC      fs/dnotify.o

  CC      fs/filesystems.o

  CC      fs/namespace.o

fs/namespace.c: In function `do_mount':

fs/namespace.c:796: error: `FS_NO_SUBMNT' undeclared (first use in this function)

fs/namespace.c:796: error: (Each undeclared identifier is reported only once

fs/namespace.c:796: error: for each function it appears in.)

make[1]: *** [fs/namespace.o] Error 1

make: *** [fs] Error 2

```

I get this when I apply the patch to my kernel and try and re-compile it.

What is going onnnn?!?!?!?

----------

## gringotts

 *wolvenwraith wrote:*   

> I have seen Supermount mentioned several times on these forums, but never saw a complete how-to on setting it up, so here I am submitting it myself. [...]
> 
> 

 

Your how-to is just what I needed to let supermount work. Thank you.

The comments have their place too: could not have sort out the proper use of '--'.

----------

## gringotts

 *snakattak3 wrote:*   

>  *MooktaKiNG wrote:*   Can you auto mount samba shares using supermount?
> 
> What about other network based file systems? 
> 
> I'm not sure.

 

In the kernel 2.6 config menu there is another option for remote FS: automount, which have to be used with the autofs tools.

Maybe could it help  :Question: 

----------

## Rince77

Very well done, i managed doing it inbetween 5 mins:)

greetz 

Rince77

----------

## stillman

is this possible for kernel sources > 2.6.5, in my case mm-sources 2.6.6-r1?

----------

## MooktaKiNG

 *stillman wrote:*   

> is this possible for kernel sources > 2.6.5, in my case mm-sources 2.6.6-r1?

 

yes it is.

----------

## stillman

 *MooktaKiNG wrote:*   

>  *stillman wrote:*   is this possible for kernel sources > 2.6.5, in my case mm-sources 2.6.6-r1? 
> 
> yes it is.

 

if i try to patch with the file from supermount-ng.sf.net for kernel 2.6.2 it doesn't work(resp. asks for files to patch), may you give me a bit more information? thx in advance   :Smile: 

[edit]i just discovered this submount-wiki, did the job for me without a hassle and without patching the kernel in 5 minutes - however i'd still be interested in a supermount-solution for 2.6.5 to see if there's a difference[/edit]

----------

## MooktaKiNG

 *stillman wrote:*   

>  *MooktaKiNG wrote:*    *stillman wrote:*   is this possible for kernel sources > 2.6.5, in my case mm-sources 2.6.6-r1? 
> 
> yes it is. 
> 
> if i try to patch with the file from supermount-ng.sf.net for kernel 2.6.2 it doesn't work(resp. asks for files to patch), may you give me a bit more information? thx in advance  
> ...

 

Well if you install the gentoo-dev-sources the supermount patch will be there already. I think thats also true for mm, and other sources. But i don't think the vannila kernel has the patch.

----------

## stillman

nope, mm sources don't have the patch(at least 2.6.6-r1 hasn't)

----------

## fvant

I have supermount in the kernel, it line shows up under dmesg but it doesn't mount anything, and if i try to mount something manually as root, i got permission denied.

Btw this is kernel 2.6.7-r5

----------

## PARENA

I'm puzzled, my supermount sort of works, but not the way it should. I have this in my fstab:

```
none                    /mnt/cdrom      supermount      dev=/dev/cdroms/cdrom0,fs=auto  0 0
```

Now, when I have rebooted, with a cdrom loaded and I do 'ls /mnt/cdrom' as a regular user, it's empty. But check this out:

```
parena@thor ~ > ls /mnt/cdrom

parena@thor ~ > su -

Password:

root@thor ~ > ls /mnt/cdrom

20040420-20040604

root@thor ~ > logout

parena@thor ~ > ls /mnt/cdrom

20040420-20040604

parena@thor ~ >
```

Someone explain this to me; I try as a user, but the cdrom looks empty, then I su -, ls /mnt/cdrom and something appears, I then do ls /mnt/cdrom as user and it's all there. Freaky, how to solve this one?  :Sad: 

----------

## Aynjell

Why is it that you have the first space as none? 

I understand that it speeds things up, but why? I do not know and this would be a nice feature to have but I am more interested because it is one of the few issues one of my besat freinds is having with linux he raved on it for about 5 minutes.... he wantys things to auto mount so I wil try this.

Thanx in advance...

----------

## Ateo

 *Siraris wrote:*   

> 
> 
> ```
>   CC      fs/pipe.o
> 
> ...

 

Same happened here. In fact, the gentoo-dev-sources (newest as of this writing) didn't have supermount support. I had to patch it. Either way, I suspect it's an incompatible patch.... Is there a new supermount patch for newer kernels floating around?

This error happens no matter which kernel I apply the patch too...

----------

## the brave

 *Ateo wrote:*   

>  *Siraris wrote:*   
> 
> ```
>   CC      fs/pipe.o
> 
> ...

 

Same error here with gentoo-dev-sources 2.6.10-r6.

----------

## gkmac

 *Ateo wrote:*   

> Is there a new supermount patch for newer kernels floating around?

 

I use gentoo-dev-sources and lately I've been getting my supermount patches from the ck-sources homepage, which if you delve deep enough you can find the individual patches separated out.

I last updated my gentoo-dev-sources to 2.6.10-r4 and used the supermount patch found here...

http://ck.kolivas.org/patches/2.6/2.6.10/2.6.10-ck1/patches/supermount-ng208-10ck1.diff

...and it works for me.

----------

