yopnono
August 28th, 2006, 03:13 PM
In the MS windows world you can copy/move files to a USB unit and then just unplug it.
But in the Linux world you need to use unmount device (umount), to make sure that your files are transferred to the unit.
If you are using this code, you can use the USB unit in a windows way = copy/move your files and unplug it.
Just copy the code in to a new file called... "usb.fdi"
and put it in the "/etc/hal/fdi/policy" Or use the attached .DEB file
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
<!-- Default policies merged onto computer root object -->
<device>
<match key="info.udi" string="/org/freedesktop/Hal/devices/computer">
<merge key="storage.policy.default.mount_root" type="string">/mnt</merge>
<merge key="storage.policy.default.use_managed_keyword" type="bool">true</merge>
<merge key="storage.policy.default.managed_keyword.primary" type="string">managed</merge>
<merge key="storage.policy.default.managed_keyword.secondary" type="string">kudzu</merge>
<merge key="storage.policy.default.mount_option.noauto" type="bool">true</merge>
<merge key="storage.policy.default.mount_option.pamconsole" type="bool">true</merge>
<merge key="storage.policy.default.mount_option.exec" type="bool">true</merge>
</match>
</device>
<device>
<!-- Whitelist bus types of storage devices we care about -->
<match key="info.category" string="storage">
<match key="storage.bus" string="usb">
<merge key="storage.policy.should_mount" type="bool">true</merge>
</match>
<match key="storage.bus" string="ide">
<merge key="storage.policy.should_mount" type="bool">true</merge>
</match>
<match key="storage.bus" string="ieee1394">
<merge key="storage.policy.should_mount" type="bool">true</merge>
</match>
<match key="storage.bus" string="sata">
<merge key="storage.policy.should_mount" type="bool">true</merge>
</match>
<match key="storage.bus" string="platform">
<merge key="storage.policy.should_mount" type="bool">true</merge>
</match>
</match>
<!-- Normal volumes; use volume label, uuid or drive_type -->
<match key="block.is_volume" bool="true">
<match key="volume.fsusage" string="filesystem">
<!-- skip for drives with the no partitions hint (they are handled above) -->
<match key="@block.storage_device:storage.no_partitions_hint" bool="false">
<merge key="volume.policy.should_mount" type="bool">true</merge>
<merge key="volume.policy.mount_filesystem" type="copy_property">volume.fstype</merge>
<!-- Fallback is '<storage.bus>', appended with 'disk', e.g. usbdisk,
idedisk, scsidisk etc. -->
<!--
<merge key="volume.policy.desired_mount_point" type="copy_property">@block.storage_device:storage.bus</merge>
<append key="volume.policy.desired_mount_point" type="string">disk</append>
-->
<merge key="volume.policy.desired_mount_point" type="string">removable</merge>
<!-- Best: If available use filesystem label -->
<match key="volume.label" empty="false">
<!-- unless it's a path (e.g. /boot, /, /home etc) -->
<match key="volume.label" is_absolute_path="false">
<!-- and only if the label is ascii -->
<match key="volume.label" is_ascii="true">
<merge key="volume.policy.desired_mount_point" type="copy_property">volume.label</merge>
</match>
</match>
</match>
<!-- Use noatime and sync options for all hotpluggable or removable
volumes smaller than 2GB -->
<match key="volume.size" compare_lt="2147483648">
<match key="@block.storage_device:storage.hotpluggable" bool="true">
<merge key="volume.policy.mount_option.sync" type="bool">true</merge>
<merge key="volume.policy.mount_option.noatime" type="bool">true</merge>
</match>
<match key="@block.storage_device:storage.removable" bool="true">
<merge key="volume.policy.mount_option.sync" type="bool">true</merge>
<merge key="volume.policy.mount_option.noatime" type="bool">true</merge>
</match>
</match>
<!-- Use UTF-8 charset for vfat -->
<!--
<match key="volume.fstype" string="vfat">
<merge key="volume.policy.mount_option.iocharset=utf8" type="bool">true</merge>
</match>-->
</match>
</match>
</match>
</device>
</deviceinfo>
But in the Linux world you need to use unmount device (umount), to make sure that your files are transferred to the unit.
If you are using this code, you can use the USB unit in a windows way = copy/move your files and unplug it.
Just copy the code in to a new file called... "usb.fdi"
and put it in the "/etc/hal/fdi/policy" Or use the attached .DEB file
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
<!-- Default policies merged onto computer root object -->
<device>
<match key="info.udi" string="/org/freedesktop/Hal/devices/computer">
<merge key="storage.policy.default.mount_root" type="string">/mnt</merge>
<merge key="storage.policy.default.use_managed_keyword" type="bool">true</merge>
<merge key="storage.policy.default.managed_keyword.primary" type="string">managed</merge>
<merge key="storage.policy.default.managed_keyword.secondary" type="string">kudzu</merge>
<merge key="storage.policy.default.mount_option.noauto" type="bool">true</merge>
<merge key="storage.policy.default.mount_option.pamconsole" type="bool">true</merge>
<merge key="storage.policy.default.mount_option.exec" type="bool">true</merge>
</match>
</device>
<device>
<!-- Whitelist bus types of storage devices we care about -->
<match key="info.category" string="storage">
<match key="storage.bus" string="usb">
<merge key="storage.policy.should_mount" type="bool">true</merge>
</match>
<match key="storage.bus" string="ide">
<merge key="storage.policy.should_mount" type="bool">true</merge>
</match>
<match key="storage.bus" string="ieee1394">
<merge key="storage.policy.should_mount" type="bool">true</merge>
</match>
<match key="storage.bus" string="sata">
<merge key="storage.policy.should_mount" type="bool">true</merge>
</match>
<match key="storage.bus" string="platform">
<merge key="storage.policy.should_mount" type="bool">true</merge>
</match>
</match>
<!-- Normal volumes; use volume label, uuid or drive_type -->
<match key="block.is_volume" bool="true">
<match key="volume.fsusage" string="filesystem">
<!-- skip for drives with the no partitions hint (they are handled above) -->
<match key="@block.storage_device:storage.no_partitions_hint" bool="false">
<merge key="volume.policy.should_mount" type="bool">true</merge>
<merge key="volume.policy.mount_filesystem" type="copy_property">volume.fstype</merge>
<!-- Fallback is '<storage.bus>', appended with 'disk', e.g. usbdisk,
idedisk, scsidisk etc. -->
<!--
<merge key="volume.policy.desired_mount_point" type="copy_property">@block.storage_device:storage.bus</merge>
<append key="volume.policy.desired_mount_point" type="string">disk</append>
-->
<merge key="volume.policy.desired_mount_point" type="string">removable</merge>
<!-- Best: If available use filesystem label -->
<match key="volume.label" empty="false">
<!-- unless it's a path (e.g. /boot, /, /home etc) -->
<match key="volume.label" is_absolute_path="false">
<!-- and only if the label is ascii -->
<match key="volume.label" is_ascii="true">
<merge key="volume.policy.desired_mount_point" type="copy_property">volume.label</merge>
</match>
</match>
</match>
<!-- Use noatime and sync options for all hotpluggable or removable
volumes smaller than 2GB -->
<match key="volume.size" compare_lt="2147483648">
<match key="@block.storage_device:storage.hotpluggable" bool="true">
<merge key="volume.policy.mount_option.sync" type="bool">true</merge>
<merge key="volume.policy.mount_option.noatime" type="bool">true</merge>
</match>
<match key="@block.storage_device:storage.removable" bool="true">
<merge key="volume.policy.mount_option.sync" type="bool">true</merge>
<merge key="volume.policy.mount_option.noatime" type="bool">true</merge>
</match>
</match>
<!-- Use UTF-8 charset for vfat -->
<!--
<match key="volume.fstype" string="vfat">
<merge key="volume.policy.mount_option.iocharset=utf8" type="bool">true</merge>
</match>-->
</match>
</match>
</match>
</device>
</deviceinfo>