一、FAT格式的U盤
插入U盤
[root@localhost ~]# dmesg | grep usb usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 usb usb1: Product: EHCI Host Controller usb usb1: Manufacturer: Linux 2.6.32-431.el6.x86_64 ehci_hcd usb usb1: SerialNumber: 0000:00:0b.0 usb usb1: configuration #1 chosen from 1 choice usb usb2: New USB device found, idVendor=1d6b, idProduct=0001 usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 usb usb2: Product: OHCI Host Controller usb usb2: Manufacturer: Linux 2.6.32-431.el6.x86_64 ohci_hcd usb usb2: SerialNumber: 0000:00:06.0 usb usb2: configuration #1 chosen from 1 choice usbcore: registered new interface driver hiddev usbcore: registered new interface driver usbhid usbhid: v2.6:USB HID core driver usb 1-1: new high speed USB device number 2 using ehci_hcd usb 1-1: New USB device found, idVendor=0951, idProduct=1666 usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 1-1: Product: DataTraveler 3.0 usb 1-1: Manufacturer: Kingston usb 1-1: SerialNumber: 60A44C3FACC9F21109990161 usb 1-1: configuration #1 chosen from 1 choice usbcore: registered new interface driver usb-storage usb-storage: device found at 2 usb-storage: waiting for device to settle before scanning usb-storage: device scan complete usb 1-1: USB disconnect, device number 2
[root@localhost ~]# fdisk -l Disk /dev/sdb: 15.5 GB, 15472047104 bytes 255 heads, 63 sectors/track, 1881 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk 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 -h Filesystem 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的時間去查看到底是啥系統。