13

I have USB device, which is actually identified as serial device by Ubuntu 10.04. How can I find its full path?

ls -la /dev/

shows a lot of devices. How to choose correct one?

8

From a Terminal prompt:

df -h

You should have a screen similiar to the one attached which should give you the mount point of the USB device.

enter image description here

  • 4
    -1 that command will show disk usage when the OP has stated his device is showing up as a serial device. – Nathan Osman Sep 5 '11 at 16:12
8

Probably the simplest thing to do, but not always simple to interpret, is to run dmesg after inserting the device.

For a flash memory pendrive you can find something like the following

[39653.096626] usb-storage: device scan complete
[39653.097617] scsi 6:0:0:0: Direct-Access     Kingston DataTraveler 2.0 1.00 PQ: 0 ANSI: 2
[39653.099860] sd 6:0:0:0: Attached scsi generic sg2 type 0
[39653.101089] sd 6:0:0:0: [sdb] 1994752 512-byte logical blocks: (1.02 GB/974 MiB)
[39653.101588] sd 6:0:0:0: [sdb] Write Protect is off
[39653.101592] sd 6:0:0:0: [sdb] Mode Sense: 23 00 00 00
[39653.101595] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[39653.110832] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[39653.110839]  sdb: sdb1 sdb2
[39653.197706] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[39653.197712] sd 6:0:0:0: [sdb] Attached SCSI removable disk
[39653.960873] EXT4-fs (sdb2): warning: maximal mount count reached, running e2fsck is recommended
[39653.962127] EXT4-fs (sdb2): mounted filesystem with ordered data mode

where it is simple to see that two partition /dev/sdb1 and /dev/sdb2 are on the drive.

For a serial device you should find something talking about ttyS0 or similar, corresponding to /dev/ttyS0.

  • OK, but what is the path? – Kajsa Apr 5 at 12:08
  • don't you see sdb2? the path is /dev/sdb2 – enzotib Apr 5 at 13:27
2

For serial devices I tend to look in /dev/serial/by-id. For disks I use /dev/disk/by-label. If you use ls -l on those they'll show you where they're linked to.

1

You can find all information related to a device from the built-in disk utility available in Ubuntu (called Disks in Ubuntu 13.04 and newer versions.).

  • full path of device. (e.x. /dev/sdb1 or /dev/sdc1)
  • partition type
  • serial number
  • size of device and model name

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.