How to Safely unplug USB stick
Daniel Gonzalez
spammesilly at gmail.com
Tue Dec 20 12:00:47 PST 2005
>
> I went a little bit through the source of an linux "eject" and the
> *BSD "eject". The Linux Verion is using "cdrom.h" and *BSD "cdio.h".
> I think that both "eject's" are actually doing the same (*BSD:
> ioctl(fd,CDIOEJECT); Linux ioctl (fd,CDROMEJECT)). I'm not a
> kernel/driver programmer, but I think the umass Driver or SCSI Driver
> (because "eject /dev/cd0" also doesn't work ) doesn't accept a
> CDIOEJECT.
Have you tried:
# /usr/local/sbin/eject /dev/acd0
My cdrom drive is usually /dev/cd0 because it's a CD RW. Otherwise
non-writable drives
are /dev/acd0. My CDRW won't eject with /dev/cd0 but it works fine with
eject /dev/acd0.
As for the USB stick, I mount it using the following:
# mount_msdosfs -o longnames /dev/da0s1 /mnt/usbflash0
And umount with the following:
# umount /mnt/usbflash0
(I'm using PCBSD which is FreeBSD 6.0-RELEASE, GENERIC kernel
Unmounting the drive causes the LED light to flicker, then extinguish.
Don't know if that helps you any, but that is what happens on my system
Hope that helps
--
Dan Gonzalez
spammesilly at gmail.com
IM: signulth
More information about the freebsd-questions
mailing list