You are not logged in.
xduugu, thanks for the rules set you made. one problem was faced with default file system setting is a new file created is not properly saved unless unmount the volume manually. To be more clear it goes like this
> touch sometext (remove the volume without unmount keep sometext there)
> put some thing on this file and save(remove the volume without manual unmount no text in sometext)
as per the rule remove action un-plugging should unmount the volume.
can some one shed light on this..
Offline
That happens because of mounts async option:
async All I/O to the filesystem should be done asynchronously. (See also the sync option.)
So when you unplug your device, there may be data which hasn't written yet. This data will be lost if you simply unplug a device. There are several options to get this data written:
1. run "sync" before unplugging which flushes all the data from the cache to the devices
2. use mounts sync option:
sync All I/O to the filesystem should be done synchronously. In case of media with limited number of write cycles (e.g. some flash drives) "sync" may cause life-cycle shortening.
3. unmount the device before unplugging: only possible as root but it would also be possible to write a fstab entry when a device is plugged in so that it can also be unmounted as an user (may introduce a race condition though: what happens to fstab if more than one device is plugged in/unplugged at the same time?)
4. use pmount to mount the devices which can mount / umount devices as user: I think there is an adjusted udev rule in the wiki, but you may have to patch it to get e.g. ext4 support.
Offline
@xduugu: a useful summary of disk syncing in Linux. Thanks.
Offline
it would also be possible to write a fstab entry when a device is plugged in so that it can also be unmounted as an user (may introduce a race condition though: what happens to fstab if more than one device is plugged in/unplugged at the same time?)
FYI that would also be abuse of fstab:
fstab is only read by programs, and not written; it is the duty of the system administrator to properly create and maintain this file.
I use the pmount variant myself - works perfectly for my mostly-vfat with-occasional-ext3 selection of devices.
Offline
FYI that would also be abuse of fstab:
man fstab wrote:fstab is only read by programs, and not written; it is the duty of the system administrator to properly create and maintain this file.
All right, was just an idea because the "users" mount option only works in fstab. But it would be ugly anyway.
My personal "ideal solution" would be a systray application that reads /proc/self/mounts and can umount devices when run as root. I hope I get this done soon.
Offline