Re: [Pcbsd-developer] removage storage unmounting (devd.conf)
Status: Beta
Brought to you by:
kmoore134
From: Andrei K. <an...@bs...> - 2006-08-25 18:59:41
|
On Friday 25 August 2006 4:34 pm, Federico Lorenzi wrote: > On Friday 25 August 2006 13:19, Andrei Kolu wrote: > > On Friday 25 August 2006 2:03 pm, Federico Lorenzi wrote: > > > On Friday 25 August 2006 10:02, Andrei Kolu wrote: > > > > On Friday 25 August 2006 8:18 am, Federico Lorenzi wrote: > > > > > On Thursday 24 August 2006 23:15, Andrei Kolu wrote: > > > > > > I found this interesting feature for /etc/devd.conf: > > > > > > ------------------------------------------------------------- > > > > > > attach 0 { > > > > > > device-name "umass0"; > > > > > > action "sleep 2 && test -c /dev/da0s1 && /sbin/mount_msdosfs -m > > > > > > 777 /dev/da0s1 /mnt/flash"; > > > > > > }; > > > > > > detach 0 { > > > > > > device-name "umass0"; > > > > > > action "umount -f /mnt/flash"; > > > > > > > > > > Just one problem... ATM we cant unmount a device after it has been > > > > > taken out, as it can cause file loss and the like. And if you do, > > > > > you are left with the entry still in /dev... Maybe a good thing to > > > > > find out is if there is a way to disable WB-caching for certain > > > > > disks? > > > > > > > > devd.conf is working on hardware level, this is not a plain script > > > > here. detach 0 command is exactly the way to prevent crashing if some > > > > device is removed. > > > > > > Just tested it now on 6.1-STABLE - Kernel seems to panic and the > > > machine reboots... > > > > Are you sure it is mounted in /mnt/flash? > > > > Show me /var/log/messages file. > > Yip, i checked and it mounted the drive fine, however when i unplugged it > AFAIK the kernel pancied... > Last lines of /var/log/messages > Aug 25 12:54:14 federico kernel: da0 at umass-sim0 bus 0 target 0 lun 0 > Aug 25 12:54:14 federico kernel: da0: <Generic USB Flash Disk 0.00> > Removable Direct Access SCSI-2 device > Aug 25 12:54:14 federico kernel: da0: 1.000MB/s transfers > Aug 25 12:54:14 federico kernel: da0: 250MB (512000 512 byte sectors: 64H > 32S/T 250C) > I ran devd in debugging mode, and it did all the right things.... Just > disconnecting it.... > > Cheers change "device-name "umass0";" to "device-name "umass-sim0";" |