How to figure out if a disk is USB or not on Linux
It is surprisingly difficult to know if a disk connected to a running Linux system is a USB disk or not. The command that finally worked for me was lsblk -do name,tran
, which looked like this:
$ lsblk -do name,tran
NAME TRAN
loop0
loop1
loop2
loop3
loop4
loop5
loop6
loop7
loop8
loop9
loop10
loop11
loop12
loop13
sda sata
sdb sata
sdc usb
(Of course there's 14 bogus loopback devices that seemingly do nothing, that's just how things work, right?)
Things that did not work for me:
- Rooting around in the
/dev
symlinks (they all just say "ATA") udevadm info --query=all --name=sda
:ID_BUS
isscsi
for my USB disk, but people online claim it should be "USB". This might be a USB 3 thing.