<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN">

<Article>

<ArtHeader>
<title>Supermount Frequently Asked Questions</title>
<Copyright>
  <Year>2003</Year>
  <Holder>Andrey Borzenkov</Holder>
</Copyright>
<ReleaseInfo>$Id: FAQ.sgml,v 1.4 2003/11/23 13:45:33 bor Exp $</ReleaseInfo>
</ArtHeader>

<QandASet defaultlabel='QandA'>

<QandADiv>
<title>Getting and installing supermount</title>

<QandAEntry>
<Question>
<Para>

Top level directory in supermount patch is linux-2.4 but I do not have this - I have linux-2.4.20

</Para>
</Question>

<Answer>
<Para>

Just use <UserInput>patch -p1</UserInput> in Linux kernel top level directory.
It is also preferred method as of kernel 2.6.

</Para>
</Answer>
</QandAEntry>

<QandAEntry>
<Question>
<Para>

I'd like to use supermount with kernel version x.y.z but I cannot find patch
for this version. Should I wait while you release one?

</Para>
</Question>

<Answer>
<Para>

I usually make new patch either when I add new features to supermout itself
or when there are incompatible changes in new kernel. So try patch for
the closest kernel version
first - chances are it works just fine. If you find a problem do not hesitate
to inform me - I cannot always check new kernel as soon as it is available.

</Para>
</Answer>
</QandAEntry>

<QandAEntry>
<Question>
<Para>

I tried your patch with -ac kernel but it does not apply. Will you make patch
for this kernel available?

</Para>
</Question>

<Answer>
<Para>

Sorry, no. I have absolutely no time to make patches for all possible kernel
flavours.

</Para>
</Answer>
</QandAEntry>

<QandAEntry>
<Question>
<Para>

Will supermount be included in standard kernel?

</Para>
</Question>

<Answer>
<Para>

Frankly speaking, I do not know. Version for 2.4 kernel is still more of
a hack so I would not even try to ask for it. I still do not consider 2.6
version to be ready for inclusion in mainline - although it would definitely
make some things easier. If anyone thinks supermount should be part of standard
kernel - feel free to ask on LKML.

</Para>
</Answer>
</QandAEntry>
</QandADiv>

<QandADiv>
<title>Using supermount</title>

<QandAEntry>
<Question>
<Para>

During shutdown my system "freezes" after message <ComputerOutput>Shutting down ALSA service</ComputerOutput>. It does not happen if there are no supermounted
devices.

</Para>
</Question>

<Answer>
<Para>

Do not use name of a real file (or directory) as <Replaceable>device name</Replaceable>
when mounting supermounted directory. Use <Literal>none</Literal> as common
mnemonic for pseudo filesystems that do not require real device. ALSA shutdown
script is using <Command>fuser</Command> to search for all processes that are
currently using
sound devices. Unfortunately, <Command>fuser</Command> will attempt to stat
inside mounted filesystem if it can stat <Replaceable>device name</Replaceable>
triggering supermount attempt to mount media. And this for <Emphasis>every</Emphasis> process.
That can take quite a lot of time depending on your hardware and number of
supermounted filesystems.

</Para>
</Answer>
</QandAEntry>

<QandAEntry>
<Question>
<Para>

I have notebook with removable floppy. When I boot wihout floppy my system
freezes in the middle of running initscripts.

</Para>
</Question>

<Answer>
<Para>

Exact reason for this is not clear but I suspect something similar to the
previous item with the same solution. Apparently there is no way for a floppy driver to find out
that no floppy is present except by probing for it and waiting for an answer.
This is not specific supermount or Linux problem, the same happens under
Windows as well. Another solution would be probably disable floppy controller
in BIOS when it is not used.

</Para>
</Answer>
</QandAEntry>

<QandAEntry>
<Question>
<Para>

When I do <UserInput>ls -l <FileName>/mnt</FileName></UserInput> it pauses for some time and LED on
CD-ROM start blinking.

</Para>
</Question>

<Answer>
<Para>

Try <UserInput>sysctl -w dev.cdrom.autoclose=0</UserInput>. Apparently most
CD-ROM drives do not distinguish between <ErrorName>NO MEDIA</ErrorName> and
<ErrorName>TRAY OPEN</ErrorName> conditions and always return <ErrorName>TRAY OPEN</ErrorName>.
In return cdrom driver tries to close tray that makes CD-ROM drive to check for
media presence - and that is exactly what is causing those delays and unwanted
drive activity. It was reported that some drives need very long time to give up.
Setting <Parameter>autoclose</Parameter> to 0 makes cdrom driver to return
immediately with <ErrorName>ENOMEDIA</ErrorName>.

</Para>
</Answer>
</QandAEntry>
<QandAEntry>
<Question>
<Para>

When I enter into <FileName>/mnt</FileName> in <Command>Konqueror</Command>
LED on CD-ROM/floppy blink constantly
and <Command>Konqueror</Command> is very unrepsonsive.

</Para>
</Question>

<Answer>

<Para>
<Command>Konqueror</Command> tries to monitor for changes in directory
<FileName>/mnt</FileName> and subdirectories.
By default it does it by simply reading directory contents approximately every
second. Of course supermount attempts to mount media every time
<Command>Konqueror</Command>
tries to list <FileName>/mnt/cdrom</FileName> etc.
</Para>

<Para>
I suggest you enable <Acronym>FAM</Acronym> if your system supports it.
In this case <Command>Konqueror</Command> asks <Acronym>FAM</Acronym>
to monitor directories;
and <Acronym>FAM</Acronym> does it by requesting kernel to send
notification instead of constantly polling for changes. This is supported
by supermount since versions 1.2.8 and 2.0.1 for kernels 2.4 and 2.6 resp.
</Para>

<Para>
If it is not an option see previous item how to fix things for CD-ROM.
There is no way to do the same for floppy.
</Para>

<Para>
Third possibility would be to selectively disable monitoring for changes on
per-directory basis. If you know how to do it - let me know so I could update
this FAQ.
</Para>

</Answer>
</QandAEntry>

<QandAEntry>
<Question>
<Para>

I can't eject CD-ROM. Tray is opened half way and immediately closed again.
I can't even insert <Emphasis>new</Emphasis> CD for the same reason!

</Para>
</Question>

<Answer>

<Para>
You are probably using <Command>Konqueror</Command> or other file manager
that monitors directory for changes and have supermounted directory opened
in this file manager. See previous item for possible ways to fix it.
</Para>

</Answer>
</QandAEntry>

<QandAEntry>
<Question>
<Para>

When I do <UserInput>fdformat /dev/fd0</UserInput> I get <ComputerOutput>Device or resource busy</ComputerOutput>

</Para>
</Question>

<Answer>

<Para>
Even after you changed floppy kernel still thinks it is mounted. If your kernel
includes support for procfs you can request supermount to unmount device
by using <FileName>/proc/fs/supermount/subfs</FileName>. E.g.
</Para>

<BlockQuote>
<Para>
<UserInput>echo -n /dev/fd0 release > /proc/fs/supermount/subfs</UserInput>
</Para>
</BlockQuote>

<Para>
Unfortunately currently this requires <Literal>root</Literal> priviliges.
I am using small wrapper script combined with <Literal>pam_console</Literal>
that allows everyone logged in locally to release device.
</Para>

</Answer>
</QandAEntry>

<QandAEntry>
<Question>
<Para>

I get errors from kernel like
<ComputerOutput>cdrom: This disc doesn't have any tracks I recognize!</ComputerOutput>

</Para>
</Question>

<Answer>

<Para>
You have audio CD without data tracks. To turn off these errors use
<UserInput>sysctl -w dev.cdrom.check_media=1</UserInput>.
</Para>

<Para>
Note that some old programs may misbehave (known case is <Literal>cdp</Literal>). The fix is to change these programs to use <Constant>O_NONBLOCK</Constant> when opening CD-ROM.
</Para>

</Answer>
</QandAEntry>

</QandADiv>

<QandADiv>
<title>Compatibility questions</title>

<QandAEntry>
<Question>
<Para>

Does supermount work with any driver?

</Para>
</Question>

<Answer>
<Para>
No. By default drivers for removable media lock tray (if possible) while
device is in use. It prevents media from being ejected when it is mounted
by supermount. Drivers have to be modified so supermount can unlock tray
when it knows it is safe to do. Currently drivers have to define extra method
<Function>->mediactl</Function>; this may change in future.
</Para>

<Para>
Additionally drivers must account for supermount in their <Function>->open</Function>
and <Function>->release</Function> methods. Otherwise the following sequence
leaves media locked:
<BlockQuote><LiteralLayout>
	<UserInput>ls /mnt/cdrom</UserInput>
	<UserInput>dd if=/dev/cdrom ...</UserInput>
</LiteralLayout></BlockQuote>
</Para>
</Answer>
</QandAEntry>

<QandAEntry>
<Question>
<Para>

I have IDE ZIP drive. When I change disk <UserInput>ls /mnt/zip</UserInput>
still displays old contents.

</Para>
</Question>

<Answer>

<Para>
This is driver problem. ide-floppy driver does not implement media change
detection at all. Until it is fixed your only hope is to use ide-scsi.
Unfortunately it is known to be broken in 2.6 as of this writing.
</Para>

</Answer>
</QandAEntry>

</QandADiv>

</QandASet>
</Article>
