Disk sync at shutdown and fusefs filesystems

Alejandro Pulver alepulver at FreeBSD.org
Tue Dec 11 07:02:22 PST 2007


On Mon, 10 Dec 2007 20:18:26 -0800
Doug Barton <dougb at FreeBSD.org> wrote:

> Alejandro Pulver wrote:
> 
> > Then I have to look for some way to manually
> > unmount FUSE filesystems at shutdown, because they are already mounted
> > at startup. I thought about instructing the fusefs-kmod rc.d script to
> > unmount FUSE filesystems before attempting to unload the kernel module
> > (currently it only loads/unloads fuse.ko).
> 
> Yes, I think that given what we're working with here, that would be a
> good idea regardless. It should be pretty easy to do, you can find a
> sample of something like what you would want in /etc/rc.d/dumpon. Let
> me know if you need help, I'm more than a little interested in getting
> fuse-ntfs set up here.
> 

Thanks, here is what I've got so far: it seems /dev/fuse[0-9]* devices
aren't removed after the corresponding filesystem is unmounted (I guess
they are reused), so instead of listing /dev the list has to be taken
from 'mount'. Also there should be a delay between the 'umount' and
'kldunload' commands. What do you think about the following
(replacement for fusefs_stop function)?

echo "Stopping ${name}."
for fs in `mount | grep '^/dev/fuse[0-9]*' | cut -d ' ' -f 1`; do
	umount $fs
done
sleep 2
kldunload $kmod

Unfortunately it doesn't have a status function to avoid loading when
already loaded and the other way, but can easily be added.

Best Regards,
Ale
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20071211/4eae7fc0/signature.pgp


More information about the freebsd-hackers mailing list