一、FAT格式的U盘
插入U盘
[root@localhost ~]# dmesg | grep usbusbcore: registered new interface driver usbfsusbcore: registered new interface driver hubusbcore: registered new device driver usbusb usb1: New USB device found, idVendor=1d6b, idProduct=0002usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1usb usb1: Product: EHCI Host Controllerusb usb1: Manufacturer: Linux 2.6.32-431.el6.x86_64 ehci_hcdusb usb1: SerialNumber: 0000:00:0b.0usb usb1: configuration #1 chosen from 1 choiceusb usb2: New USB device found, idVendor=1d6b, idProduct=0001usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1usb usb2: Product: OHCI Host Controllerusb usb2: Manufacturer: Linux 2.6.32-431.el6.x86_64 ohci_hcdusb usb2: SerialNumber: 0000:00:06.0usb usb2: configuration #1 chosen from 1 choiceusbcore: registered new interface driver hiddevusbcore: registered new interface driver usbhidusbhid: v2.6:USB HID core driverusb 1-1: new high speed USB device number 2 using ehci_hcdusb 1-1: New USB device found, idVendor=0951, idProduct=1666usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3usb 1-1: Product: DataTraveler 3.0usb 1-1: Manufacturer: Kingstonusb 1-1: SerialNumber: 60A44C3FACC9F21109990161usb 1-1: configuration #1 chosen from 1 choiceusbcore: registered new interface driver usb-storageusb-storage: device found at 2usb-storage: waiting for device to settle before scanningusb-storage: device scan completeusb 1-1: USB disconnect, device number 2
[root@localhost ~]# fdisk -lDisk /dev/sdb: 15.5 GB, 15472047104 bytes255 heads, 63 sectors/track, 1881 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0xcad4ebea Device Boot Start End Blocks Id System/dev/sdb4 * 1 1882 15109293 c W95 FAT32 (LBA)
[root@localhost ~]# mkdir /mnt/usb[root@localhost ~]# mount /dev/sdb4 /mnt/usb/[root@localhost ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/mapper/VolGroup-lv_root 50G 880M 46G 2% /tmpfs 1.9G 0 1.9G 0% /dev/shm/dev/sda1 485M 33M 427M 8% /boot/dev/mapper/VolGroup-lv_home 65G 180M 62G 1% /home/dev/sdb4 15G 5.3G 9.2G 37% /mnt/usb
二、NTFS格式挂载
我自己的移动硬盘为NTFS格式,共3个分区
连接上之后dmesg | grep usb可以看到USB设备已经连接了。
然后centos6.5默认是不识别NTFS分区的(微软专利,得谈合作),所以需要安装NTFSde rpm包
然后我就在https://pkgs.org/下载了fuse-ntfs-3g-2013.1.13-2.el6.rf.x86_64.rpm,然后装了glibc也死活不行,
然后又去https://pkgs.org/下载了fuse-ntfs-3g-2013.1.13-2.el6.rf.x86_64.rpm,执行
yum install -y fuse-ntfs-3g-2013.1.13-2.el6.rf.x86_64.rpm
然后搞定了。哎!不能求新丫!!!
modprobe usb-storage #fdisk看不到就执行这条命令fdisk -l
mount /dev/sdb2 /mnt/usb/mount -t ntfs-3g /dev/sdb2 /mnt/usb/mount.ntfs /dev/sdb2 /mnt/usb/
以上3个命令都可以,只不过不指定mount文件系统的时候系统会多花1s的时间去查看到底是啥系统。