Artificial intelligent assistant

Finding all storage devices attached to a Linux machine I have a need to find all of the writable storage devices attached to a given machine, whether or not they are mounted. The dopey way to do this would be to try every entry in `/dev` that corresponds to a writable devices (hd* and sd*). Is there a better solution, or should I stick with this one?

If one is interested only in **block** storage devices, one can use `lsblk` from widely-available util-linux package:


$ lsblk -o KNAME,TYPE,SIZE,MODEL
KNAME TYPE SIZE MODEL
sda disk 149.1G TOSHIBA MK1637GS
sda1 part 23.3G
sda2 part 28G
sda3 part 93.6G
sda4 part 4.3G
sr0 rom 1024M CD/DVDW TS-L632M


It lends itself well to scripting with many other columns available.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy e7ebc81a581d60b222d7f7e0b2394c00