我如何确定我的 USB 驱动器插入了哪个 /dev/sdX 设备?
我正在运行 Ubuntu 9.04。
答案1
您可能希望使用/dev/disk/by-id
或。无论您的可插拔驱动器具有/dev/disk/by-uuid/
什么,这些都不会因给定设备而改变。/dev/sdXX
答案2
执行sudo blkid
:它将显示块设备名称:
/dev/sdc1:UUID="004A31DB4A31CDE2" 标签="WinGamer" 类型="ntfs" /dev/sdd1:LABEL="0DAY" UUID="9b14c03b-7251-434f-bbb9-eac42b2db927" TYPE="ext2" /dev/sdg5:标签="QFAT" UUID="4257-E346" 类型="vfat" /dev/sdg6:标签=“备份-HDD”UUID=“fee45c66-11bd-49fa-a62a-4a541716e8e1”类型=“ext2”
答案3
在命令行上,执行 als /media
你通常会看到它。
例如在我的系统上:
$ ls /media
cdrom cdrom0 cdrom1 floppy floppy0 LaCie
LaCie 是我的 USB 记忆棒
尝试失败
$ lsusb
在我的系统上
$ lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
...
Bus 001 Device 004: ID 059f:1028 LaCie, Ltd
...
如果它出现在那里但没有出现在/media中,您将需要弄清楚如何安装,或者提出另一个问题。
最后,我可以输入“mount”并查看输出以找到您的答案,或者就我的情况而言:
$ mount | grep LaCie
/dev/sdb on /media/LaCie type vfat (rw,nosuid,nodev,uhelper=hal,shortname=mixed,uid=1000,utf8,umask=077,flush)
答案4
这要视情况而定。dmesg
在控制台输入,输出应显示正在安装的 USB 棒。
以下是一些示例输出:
[ 2699.328853] Initializing USB Mass Storage driver...
[ 2699.339045] scsi4 : SCSI emulation for USB Mass Storage devices
[ 2699.345916] usbcore: registered new interface driver usb-storage
[ 2699.345922] USB Mass Storage support registered.
[ 2699.350764] usb-storage: device found at 3
[ 2699.350767] usb-storage: waiting for device to settle before scanning
[ 2704.353322] usb-storage: device scan complete
[ 2704.354353] scsi 4:0:0:0: Direct-Access USB DISK 2.0 0403 PQ: 0 ANSI: 0 CCS
[ 2704.374592] sd 4:0:0:0: [sdb] 3981312 512-byte hardware sectors: (2.03 GB/1.89 GiB)
[ 2704.415233] sd 4:0:0:0: [sdb] Write Protect is off
[ 2704.415239] sd 4:0:0:0: [sdb] Mode Sense: 43 00 00 00
[ 2704.415242] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[ 2704.418087] sd 4:0:0:0: [sdb] 3981312 512-byte hardware sectors: (2.03 GB/1.89 GiB)
[ 2704.419100] sd 4:0:0:0: [sdb] Write Protect is off
[ 2704.419105] sd 4:0:0:0: [sdb] Mode Sense: 43 00 00 00
[ 2704.419107] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[ 2704.419114] sdb: sdb1
[ 2704.421024] sd 4:0:0:0: [sdb] Attached SCSI removable disk
[ 2704.421093] sd 4:0:0:0: Attached scsi generic sg2 type 0
就我而言,它是sdb
我插入 USB 记忆棒后分配的设备,因为我的笔记本电脑中只有一个内置硬盘 (sda)。