安装、以root身份登录linux,
1.检查核心是否加载USB模块
# dmesg | grep usb
有输出如"usb.c: registered....."信息说明模块已加载,否则需要执行:
# modprobe usb-uhci
# modprobe usb-storage
# dmesg |grep usb
....
....
registered new drver usbdevfs
usb.c: registered new driver hub
usb-uhci.c: $Revision: 1.259 $ time 17:36:49 Sep 6 2001
usb-uhci.c: High bandwidth mode enabled
PCI: Enabling device 00:07.2 (0000 -> 0001)
PCI: Assigned IRQ 9 for device 00:07.2
usb-uhci.c: USB UHCI at I/O 0x10e0, IRQ 9
usb-uhci.c: Detected 2 ports
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
usb-uhci.c: v1.251:USB Universal Host Controller Interface driver
SCSI subsystem driver Revision: 1.00
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
2.连接好USB硬盘,
# dmesg tail
....
....
hub.c: USB new device connect on bus1/2, assigned device number 3
usb-uhci.c: interrupt, status 3, frame# 1489
scsi0 : SCSI emulation for USB Mass Storage devices
Vendor: Model: Rev:
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 19640880 512-byte hdwr sectors (10056 MB)
sda: sda1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 3
usb.c: USB disconnect on device 3
usb.c: USB disconnect on device 2
发现USB设备,对应的设备为 /dev/sda1
# mkdir /mnt/usbdisk
# mount -t vfat /dev/sda1 /mnt/usbdisk
这样您就可以通过usbdisk目录访问usb的文件了.
-t vfat 只能mount fat文件系统..
对于ntfs的文件系统mount就稍复杂一点了.