5

I tried the following commands, but couldn't find the name of USB port

$ lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 045e:00cb Microsoft Corp. Basic Optical Mouse v2.0
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 04e8:6818 Samsung Electronics Co., Ltd 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

$ cat /etc/fstab
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=8e93f00d-0154-495b-9c82-d9c485681cda / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=14fe526f-2b5c-429f-87dd-8ab40f4b5093 none swap sw 0 0

$ dmesg | grep tty
[ 0.000000] console [tty0] enabled
[ 1.900695] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 2.257708] 00:06: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

None of the above commands gave the name of the USB port, I want the output as /dev/sdax or ttysax or something like that.

Any other commands and suggestions would be helpful.

4 Answers 4

3

Try something like:

ls -l /dev/disk/by-id/usb*

That should give you a listing of usb devices listed, including your phone. For me that string looks like:

usb-Manufacturer_Product_SerialNumber-0:0

You should see something similar allowing you to easily identify your device.

ls -l will show that the device listing is merely a symlink to the actual device node (something like ../../sdc). Alternatively, readlink -e will give you slightly more straightforward output.

1

Maybe this is a little clunky, but I'm not knowledgable enough to make the other suggestions work. If you are in the same boat, try making two files that each contain a list of everything visible in /dev, before and after plugging in the device and then compare them. From the home directory:

touch before after
chmod 777 before after
cd /dev
ls > ~/before

Plug in or unplug the device, then:

ls > ~/after
cd ~/
diff before after
rm before after
0

You could look at

fdisk -l

before and after pluging in your phone.

OR watch

tail -f /var/log/messages

and plug in the phone.

Either way you should be able to deduce the device.

1
  • You could also use dmesg (which is similar to the second option).
    – Mike
    Sep 3, 2011 at 6:29
0

I don't have any phone to connect, but I guess you should query /sys/ filesystem.

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.