reexporting a removable media through NFS

From: Boszormenyi Zoltan (zboszor@externet.hu)
Date: Wed Sep 13 2000 - 08:51:26 EST


Hi!

How can I reexport a mount point through NFS without causing too much
surprise to the users? The mount point contains a removable media
which can be removed anytime since it is not locked and the gui user
can work the same way as in front of a Windows machine. The system is
Red Hat 6.2, upgraded to 2.2.16-3 (+ide-patch +reiserfs) and
nfs-utils-0.1.9.1.

The old user space nfsd and mountd may have been given a "--reexport"
option and it was done.

With the above config, I tried this, at first only on localhost.

etc/exports:

/mnt/cdrom localhost(ro,o_root_squash[,no_subtree_check])

I tried this:

# /etc/rc.d/init.d/nfs start
# /etc/rc.d/init.d/nfslock start
# mount -t nfs localhost:/mnt/cdrom /mnt/XXX
# mount /mnt/cdrom
# ls /mnt/cdrom /mnt/XXX

The content of the CD is visible under /mnt/cdrom, /mnt/XXX is empty.

# umount /mnt/XXX
# mount -t nfs localhost:/mnt/cdrom /mnt/XXX
mount: localhost:/mnt/cdrom failed, reason given by server: Permission
denied
# umount /mnt/cdrom
# /etc/rc.d/init.d/nfs stop
# /etc/rc.d/init.d/nfslock stop
# mount /mnt/cdrom
# /etc/rc.d/init.d/nfs start
# /etc/rc.d/init.d/nfslock start
# mount -t nfs localhost:/mnt/cdrom /mnt/XXX
# ls /mnt/cdrom /mnt/XXX

The content of the CD is visible under /mnt/XXX, too.

# umount /mnt/cdrom
umount: /mnt/cdrom: device is busy
# umount /mnt/XXX
# umount /mnt/cdrom
umount: /mnt/cdrom: device is busy

This happens until "/etc/rc.d/init.d/nfs stop"

The "unhide" option does not seem to work, maybe it is not relevant.

With manual eject,

# ls /mnt/cdrom /mnt/XXX

shows both directory empty if the "no_subtree_check" is not given.
If it is, then /mnt/XXX shows the old directory content.
If I put back the CD then the next

# ls /mnt/cdrom /mnt/XXX

shows again the content of the CD in both directories.
But when I put in another CD then

# ls /mnt/cdrom /mnt/XXX

shows either garbage or nothing under /mnt/cdrom and the same under
/mnt/XXX (no_subtree_check is not given) or the previous content
(no_subtree_check is given). I have to umount /mnt/XXX, stop nfs and
kill gmc to be able to mount the CD again.

This procedure worked the same with the stock (0.1.6) nfs-utils.

Can someone help? The user would like to be able to umount /mnt/cdrom
or manually eject the CD from under the reexport and insert another
and see the new content (almost) instantly on another machine.
Is is solvable with 2.2.x?

Regards,
Zoltan Boszormenyi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Sep 15 2000 - 21:00:21 EST