Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running a Ubuntu 11 guest on a Windows XP host with VMware. I want to format an SD card in Ubuntu, but I can't figure out which /dev/xxx device the SD card is.

I plug the card into the built-in socket of my laptop. I "safely remove" the device in Windows. Then, I "connect" the PCMCIA reader in VMware. Now, I was supposed to see a new device like /dev/sdx, but it doesn't appear.

How can I find what the name of my USB device's name and mount it?

/var/log/message is empty.

Here is the output of dmesg:

[ 5268.927308] usb 2-1: new full speed USB device number 12 using uhci_hcd

And, here are the last lines of /var/log/syslog:

Oct 31 18:51:21 ubuntu kernel: [ 5268.927308] usb 2-1: new full speed USB device number 12 using uhci_hcd

Oct 31 18:51:21 ubuntu mtp-probe: checking bus 2, device 12: "/sys/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-1"

Oct 31 18:51:21 ubuntu mtp-probe: bus: 2, device: 12 was not an MTP device

share|improve this question

migrated from stackoverflow.com Nov 1 '11 at 1:12

This question came from our site for professional and enthusiast programmers.

    
Ubuntu 11 does not have /var/log/messages... – hovanessyan Oct 31 '11 at 17:12
    
This should be on askubuntu.com or unix.stackexchange.com – Martin Thoma May 13 '15 at 10:11

Try lsblk. This is the output from my current setup:

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0 195.3G  0 part 
├─sda2   8:2    0     4G  0 part [SWAP]
└─sda3   8:3    0 266.5G  0 part /
sdb      8:16   0 465.8G  0 disk 
└─sdb1   8:17   0 460.8G  0 part /home
sr0     11:0    1  1024M  0 rom  

I'm using Ubuntu 12.10.

share|improve this answer
ls -1 /dev > ~/before.txt

plug it in, then

ls -1 /dev > ~/after.txt

diff ~/before.txt ~/after.txt
share|improve this answer

Try using lsusb to see if the sd card reader is picked up in virtualbox. Another option would be to use palimpsest (also known by its menu entry, Disk Utility.)

Don't be afraid to use the GUI programs - they do work! If palimpsest sees your device, it will tell you the device node, so you can use the CLI utilities.

share|improve this answer

If it has a label use /dev/disk/by-label/[USB label] to format the disk

EDIT: Try /dev/disk/by-id/usb*

share|improve this answer
    
no, it doesn't have :( – mustafa Oct 31 '11 at 17:30
    
aren't there any other methods? – mustafa Oct 31 '11 at 20:35
    
USBs are usually /dev/sb followed by a number, or something along thoses lines if I'm not completely correct, it might be /dev/sdb followed by a number but not normally /dev/sda, so if there's only one plugged in that should do it – Will03uk Oct 31 '11 at 23:32

lsblk seems to work:

rishi@rishi-Inspiron-1018:~$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 232.9G  0 disk 
├─sda1   8:1    0 230.9G  0 part /
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0     2G  0 part [SWAP]
sdb      8:16   1   7.4G  0 disk 
└─sdb1   8:17   1   7.4G  0 part /media/3765-3233

So now I know my SD card is in /dev/sdb1.

share|improve this answer
    
Suspect. When using Debian live, I saw sdc (my usb device) listed in lsblk output but not in /dev. – user982671 Oct 28 '14 at 18:47
    
It'll appear in /dev only if udev is present (or an equivalent), and as a rule to create the node in it. Does not mean it can't be used, you can create the node where you want, since you have the Major/Minor number in lsblk. – xryl669 Jun 3 at 11:34

sudo fdisk -l will list the partition table on all available hard disks; it uses the Linux naming scheme for disks, handy for troubleshooting and remembering which partition is where.

Use man fdisk for more information on the parameters of fdisk.

share|improve this answer

Open a terminal and run ls /dev before you enable that USB device in vmware. Run ls /dev/ again after you enabled it and look for what pops up

share|improve this answer
# dir /dev/disk/by-path/
total 0
drwxr-xr-x. 2 root root 180 Aug 26 15:51 .
drwxr-xr-x. 6 root root 120 Aug 25 17:20 ..
lrwxrwxrwx. 1 root root   9 Aug 25 17:12 pci-0000:00:03.2-usb-0:3:1.0-scsi-0:0:0:0 -> ../../sr0
lrwxrwxrwx. 1 root root   9 Aug 26 15:51 pci-0000:00:03.2-usb-0:4.1.1:1.0-scsi-0:0:0:0 -> ../../sdb
lrwxrwxrwx. 1 root root  10 Aug 26 15:51 pci-0000:00:03.2-usb-0:4.1.1:1.0-scsi-0:0:0:0-part1 -> ../../sdb1
lrwxrwxrwx. 1 root root  10 Aug 26 15:51 pci-0000:00:03.2-usb-0:4.1.1:1.0-scsi-0:0:0:0-part2 -> ../../sdb2
lrwxrwxrwx. 1 root root  10 Aug 26 15:51 pci-0000:00:03.2-usb-0:4.1.1:1.0-scsi-0:0:0:0-part3 -> ../../sdb3
lrwxrwxrwx. 1 root root   9 Aug 25 17:12 pci-0000:07:00.0-scsi-0:2:0:0 -> ../../sda
lrwxrwxrwx. 1 root root  10 Aug 25 17:12 pci-0000:07:00.0-scsi-0:2:0:0-part1 -> ../../sda1

and

# dir /dev/disk/by-id/
total 0
drwxr-xr-x. 2 root root 280 Aug 27 01:20 .
drwxr-xr-x. 6 root root 120 Aug 25 17:20 ..
lrwxrwxrwx. 1 root root  10 Aug 25 17:20 dm-name-VG_RAID_201010081812-LV_RAID_201010081617 -> ../../dm-0
lrwxrwxrwx. 1 root root  10 Aug 27 01:20 dm-name-top4 -> ../../dm-2
lrwxrwxrwx. 1 root root  10 Aug 25 17:20 dm-uuid-LVM-XCQXKaPB3snmEgx9ZNGRssIxGmJPje6TXKMLyop5meKH3x3KiJ1H1q3aoqgXpci1 -> ../../dm-0
lrwxrwxrwx. 1 root root   9 Aug 25 17:12 scsi-36842b2b04963f900144207e1091bf90c -> ../../sda
lrwxrwxrwx. 1 root root  10 Aug 25 17:12 scsi-36842b2b04963f900144207e1091bf90c-part1 -> ../../sda1
lrwxrwxrwx. 1 root root   9 Aug 25 17:12 usb-ASUS_SBW-06D2X-U_3248433031354B4A30303030-0:0 -> ../../sr0
lrwxrwxrwx. 1 root root   9 Aug 26 15:51 usb-ST916041_2AS_579FFFFFFFFF-0:0 -> ../../sdb
lrwxrwxrwx. 1 root root  10 Aug 26 15:51 usb-ST916041_2AS_579FFFFFFFFF-0:0-part1 -> ../../sdb1
lrwxrwxrwx. 1 root root  10 Aug 26 15:51 usb-ST916041_2AS_579FFFFFFFFF-0:0-part2 -> ../../sdb2
lrwxrwxrwx. 1 root root  10 Aug 26 15:51 usb-ST916041_2AS_579FFFFFFFFF-0:0-part3 -> ../../sdb3
lrwxrwxrwx. 1 root root   9 Aug 25 17:12 wwn-0x6842b2b04963f900144207e1091bf90c -> ../../sda
lrwxrwxrwx. 1 root root  10 Aug 25 17:12 wwn-0x6842b2b04963f900144207e1091bf90c-part1 -> ../../sda1
share|improve this answer

I am new to linux, but so far I have found 3 ways to find out a device name:

1) lsblk (already mentioned above, lists device names and the folder they are mounted on)

2) sudo fdisk -l (lists device names, here you can also see the names of partitions)

3) dmesg immediately after you have inserted an usb stick (a lot of output, don't really know yet what they are for, but the last entries show the name of the inserted name somewhere)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .