Koozali.org: home of the SME Server

Script in wiki for finding USB disk device name is not working

Offline SRobinson

  • *
  • 3
  • +0/-0
http://wiki.contribs.org/USBDisks#USB_on_SME_8

One of my USB drives is a Western Digital My Passport.  As best as I can tell, the script documented on the USBDisks wiki page is not working for this device.  It's displaying a CDROM device instead of the ext3 device. 


[root@luna /]# hal-find-by-property --key volume.fsusage --string filesystem |
> while read udi ; do
>    # ignore optical discs
>    if  "$(hal-get-property --udi $udi --key volume.is_disc)" == "false" ; then
>        dev=$(hal-get-property --udi $udi --key block.device)
>        fs=$(hal-get-property --udi $udi --key volume.fstype)
>        lb=$(hal-get-property --udi $udi --key volume.label)
>        echo $dev": label "$lb",file system: "$fs ",uid: "$udi
>    fi
> done
/dev/sr1: label WD SmartWare,file system: udf ,uid: /org/freedesktop/Hal/devices/volume_label_WD_SmartWare
[root@luna /]#


If I add "test" to the if statement, the script seems to work correctly.


[root@luna /]# hal-find-by-property --key volume.fsusage --string filesystem |
> while read udi ; do
>    # ignore optical discs
>    if test "$(hal-get-property --udi $udi --key volume.is_disc)" == "false" ; then
>        dev=$(hal-get-property --udi $udi --key block.device)
>        fs=$(hal-get-property --udi $udi --key volume.fstype)
>        lb=$(hal-get-property --udi $udi --key volume.label)
>        echo $dev": label "$lb",file system: "$fs ",uid: "$udi
>    fi
> done
/dev/sdb1: label ,file system: ext3 ,uid: /org/freedesktop/Hal/devices/volume_uuid_f396fe77_0d99_47a6_8f8a_03cb82acdce9
[root@luna /]#


Should this be changed in the wiki?

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Script in wiki for finding USB disk device name is not working
« Reply #1 on: June 12, 2012, 12:53:06 AM »
Should this be changed in the wiki?

Yes.