Getting EBUSY upon unmount ATA disk...

Paul Marciano pm940 at yahoo.com
Wed Mar 8 18:37:11 UTC 2006


(originally sent to freebsd-fs, but that looks like a
developer list).

I am running FreeBSD-5.4 with root on md0.

I am seeing the following problem:

# df
Filesystem     1K-blocks  Used Avail Capacity  Mounted
on
/dev/md0           17370 15810   172    99%    /
devfs                  1     1     0   100%    /dev
/dev/md1            3694    16  3384     0%    /var
/dev/md2           31470     8 28946     0%    /tmp
/dev/md3.uzipc     20808 18890   254    99%    /usr

# mount /dev/ad0s1a /flash
# : > /flash/foobar
# umount /flash
umount: unmount of /flash failed: Device busy


Waiting doesn't help.  I can repeat the unmount
command after a time and it still reports EBUSY.

ad0 is a SanDisk Compact Flash card.

So far I've traced the unmount op to

ffs_flushfiles() in ffs_vfsops.c:

/*
 * Flush all the files.
 */
if ((error = vflush(mp, 0, flags, td)) != 0)
        return (error);


Still trying to track it down, but I'm not an fs guy
and so I'm asking for a little help.



Some more background:

My system uses a Compact Flash card to store
configuration information.  It's seldom accessed and
it would be nice to support controlled
removing/replacing during operation.

It looks like it is possible using atacontrol to
detach the channel and then reattach when the card is
inserted.

I can: insert, attach, mount, read, umount, remove all
day long without problems.  But now as soon as I do
one write the drive doesn't want to unmount.


No processes are camping on the mount point.
manually typing "sync" doesn't help.

unmount -f succeeds.


I hope someone can advise me.

Thanks,
Paul.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the freebsd-questions mailing list