Re: [Hampshire] Detect USB or SATA drive

Top Page

Reply to this message
Author: Chris Sykes via Hampshire
Date:  
To: Hampshire LUG Discussion List
CC: Chris Sykes
Subject: Re: [Hampshire] Detect USB or SATA drive
On Thu, 30 Apr 2020 at 10:12, Rob Malpass via Hampshire
<hampshire@???> wrote:
> It would be useful to me if I could determine (via df -h if poss) which are usb and which are usb.
>
> I’ve tried lsusb and lshw -C disk but neither are helping. lshw keeps telling me they’re all SCSI for example which I know is wrong. They’re all SATA – it’s just that some are connected via USB, some aren’t.


You might also like to try listing /dev/disk/by-path/
For example:

$ ls -l /dev/disk/by-path
  total 0
  lrwxrwxrwx. 1 root root 13 Apr 28 21:24 pci-0000:02:00.0-nvme-1 ->
../../nvme0n1
  lrwxrwxrwx. 1 root root 15 Apr 28 21:24
pci-0000:02:00.0-nvme-1-part1 -> ../../nvme0n1p1
  lrwxrwxrwx. 1 root root 15 Apr 28 21:24
pci-0000:02:00.0-nvme-1-part2 -> ../../nvme0n1p2
  lrwxrwxrwx. 1 root root 15 Apr 28 21:24
pci-0000:02:00.0-nvme-1-part3 -> ../../nvme0n1p3
  lrwxrwxrwx. 1 root root 15 Apr 28 21:24
pci-0000:02:00.0-nvme-1-part4 -> ../../nvme0n1p4
  lrwxrwxrwx. 1 root root 15 Apr 28 21:24
pci-0000:02:00.0-nvme-1-part5 -> ../../nvme0n1p5
  lrwxrwxrwx. 1 root root 15 Apr 28 21:24
pci-0000:02:00.0-nvme-1-part6 -> ../../nvme0n1p6
  lrwxrwxrwx. 1 root root  9 Apr 30 21:34
pci-0000:06:00.3-usb-0:2:1.0-scsi-0:0:0:0 -> ../../sda
  lrwxrwxrwx. 1 root root 10 Apr 30 21:34
pci-0000:06:00.3-usb-0:2:1.0-scsi-0:0:0:0-part1 -> ../../sda1
                                                           ^^^
                                                              `-- bus type here


HTH,

Chris.

--
Please post to: Hampshire@???
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------