linux - bash, search for usb storage devices. output location -
i looking way list usb connected devices or removable storage media.
i using list gtk boot media writer, user can write iso usb.
this creates perfect list of partitions:
ls /dev | grep "[sh]d[a-z][1-9]"
how can similar looking list removable media?
on system (ubuntu 12.04), can list of usb devices , partitions
ls /dev/disk/by-path/*usb*
giving
/dev/disk/by-path/pci-0000:00:02.1-usb-0:1.1:1.0-scsi-0:0:0:0 /dev/disk/by-path/pci-0000:00:02.1-usb-0:1.1:1.0-scsi-0:0:0:0-part1
or partitions alone
ls /dev/disk/by-path/*usb*part*
these symbolic links, pointing real device files, /dev/sdd
, /dev/sdd1
example.
i have tested usb stick , external usb hard disk only. cannot say, whether or how works esata or firewire disks.
Comments
Post a Comment