Hi ! Happy ending !
I wanted.... automatic directory creation in /media automatic symlinking automatic mounting automatic unmounting (and I will yank it without unmounting anytime after the lights stop blinking in the USB stick ! This is a necessary condition for this device) automatic removal of directory so added the automount.rules in /etc/udev/rules.d KERNEL=="sd[a-z]", NAME="%k", SYMLINK+="usb%m", OPTIONS="last_rule" ACTION=="add", KERNEL=="sd[a-z][0-9]", SYMLINK+="usb%n", NAME="%k" ACTION=="add", KERNEL=="sd[a-z][0-9]", RUN+="/bin/mkdir -p /media/usb%n" ACTION=="add", KERNEL=="sd[a-z][0-9]", RUN+="/bin/mount -t auto -o rw,noauto,sync,dirsync,noexec,nodev,noatime /dev/%k /media/usb%n", OPTIONS="last_rule" ACTION=="remove", KERNEL=="sd[a-z][0-9]", RUN+="/bin/umount -l /media/usb%n" ACTION=="remove", KERNEL=="sd[a-z][0-9]", RUN+="/bin/rmdir /media/usb%n", OPTIONS="last_rule" And works like a charm ! Thanks to ILUGC ! ILUGC rocks ! Cheers varadarajan www.cloudversity.com On Tue, Apr 7, 2009 at 2:02 PM, Kapil Hari Paranjape <[email protected]>wrote: > Hello, > > On Tue, 07 Apr 2009, Ashok Gautham wrote: > > Data is not written immediately. It is written asynchronously. You > > can force it to be written to the disk by using the sync call.. This > > call will exit only when all data waiting to be written has been > > written (This works even when you have two or more disks where data > > remains unwritten) > > Not really! See the recent discussion on sync, fsync and so on on > LKML or the kernel page of LWN. For example, > http://lwn.net/Articles/325420/ says: > > All [sync] does is preƫmpt the normally delayed flushing of dirty blocks > by > expiring them all. It does *not* write them. They just go on the > various disk queues to be written to each device, but that doesn't get > them there -- yet. Once upon a time, and on some systems still, there > was a user process called update(8) that did this sort of thing every 30 > seconds or so. > > Then there are "write-caching" disk-controllers etc. ... > > To ensure that data gets written to a removable device you should > "umount" it. Then wait for the activity light on the device to go off > (if it is not broken!) before unplugging/remove the device. > > Kapil. > -- > > _______________________________________________ > To unsubscribe, email [email protected] with > "unsubscribe <password> <address>" > in the subject or body of the message. > http://www.ae.iitm.ac.in/mailman/listinfo/ilugc > _______________________________________________ To unsubscribe, email [email protected] with "unsubscribe <password> <address>" in the subject or body of the message. http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
