操作系统:CentOS6.8

虚拟机:VM

移动存储器:U

任务:把U盘上的数据复制到虚拟机CentOS主机中的usb目录下。

问题:U盘显示乱码。

解决U盘显示乱码。

操作步骤如下:确保虚拟主机要能连上U盘。

[root@www ~]# fdisk -l

Disk /dev/sda: 21.5 GB,21474836480 bytes

255 heads, 63sectors/track, 2610 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:0x000adcc6

   Device Boot      Start         End      Blocks  Id  System

/dev/sda1   *          1          64      512000  83  Linux

Partition 1 does not endon cylinder boundary.

/dev/sda2              64        2611   20458496   8e  Linux LVM

Disk/dev/mapper/VolGroup-lv_root: 18.8 GB, 18832424960 bytes

255 heads, 63sectors/track, 2289 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:0x00000000

Disk/dev/mapper/VolGroup-lv_swap: 2113 MB, 2113929216 bytes

255 heads, 63sectors/track, 257 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:0x00000000

Disk /dev/sdb: 15.5 GB,15479597056 bytes

244 heads, 14sectors/track, 8850 cylinders

Units = cylinders of 3416* 512 = 1748992 bytes

Sector size(logical/physical): 512 bytes / 512 bytes

I/O size(minimum/optimal): 512 bytes / 512 bytes

Disk identifier:0x00000000

 Device Boot      Start         End      Blocks  Id  System

/dev/sdb1   *        305        8851   14596730    c  W95 FAT32 (LBA)

[root@www ~]# mount -o iocharset=utf8 /dev/sdb1 /mnt/usb  #可行

[root@www ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/VolGroup-lv_root

                       18G  4.7G  12G  29% /

tmpfs                 504M     0 504M   0% /dev/shm

/dev/sda1             477M  128M 325M  29% /boot

/dev/sdb1              14G  2.8G  12G  20% /mnt/usb

[root@www ~]# cd /mnt/usb

[root@www usb]# ll

总用量 98256

-rwxr-xr-x 1 rootroot      882 11 20 2015 cacti插件.txt

-rwxr-xr-x 1 rootroot  2811383 1  20 2015 soler - 风的季节.mp3

-rwxr-xr-x 1 rootroot  1545728 9   7 2015 winrar.exe

-rwxr-xr-x 1 rootroot  4691013 1  20 2015 是场梦还是真.mp3

-rwxr-xr-x 1 rootroot  5721671 1  20 2015 一起走过的日子.mp3

[root@www usb]# cp 一起走过的日子.mp3  /mnt/usb

cp: "一起走过的日子.mp3" "/mnt/usb/一起走过的日子.mp3" 为同一文件

[root@www usb]# cp  一起走过的日子.mp3  /data

[root@www usb]# ll  /data

-rwxr-xr-x 1 root  root 5721671 12 30 09:17 一起走过的日子.mp3

卸载U盘方式如下:

[root@www ~]# umount/mnt/usb

[root@www ~]# umount/dev/sdb1

重新挂载U

[root@www ~]# mount /dev/sdb1 /mnt/usb   #显示乱码

[root@www ~]# ll /mnt/usb

总用量 104648

-rwxr-xr-x 1 rootroot      882 11 20 2015 cacti??.txt

drwxr-xr-x 2 rootroot     8192 1   5 2016 GHO

-r-xr-xr-x 1 rootroot   292878 2  11 2014 icon.ico

drwxr-xr-x 2 rootroot     8192 1   5 2016 ISO

-rwxr-xr-x 1 rootroot  6377039 1  20 2015 ???? - ????.mp3

-rwxr-xr-x 1 rootroot  2770748 1  20 2015 ???? -???.mp3

-rwxr-xr-x 1 rootroot  5727742 1  20 2015 ?????? - ??.mp3

-rwxr-xr-x 1 rootroot  3053752 1  20 2015 ??????? - ???.mp3

-rwxr-xr-x 1 rootroot  3695911 1  20 2015 ????????.mp3

-rwxr-xr-x 1 rootroot  5721671 1  20 2015 ???????.mp3

-rwxr-xr-x 1 rootroot  3004854 1  20 2015 ???????(???).mp3

-rwxr-xr-x 1 root root10285792 1  20 2015 ??????.mp3

-rwxr-xr-x 1 root root10285792 1  20 2015 ??????.mp3

-rwxr-xr-x 1 rootroot  1276564 1  20 2015 ?????(??).mp3

-rwxr-xr-x 1 rootroot  2811383 1  20 2015 soler - ????.mp3

-rwxr-xr-x 1 rootroot  1545728 9   7 2015 winrar.exe

[root@www ~]# umount/dev/sdb1

[root@www ~]# mount  /dev/sdb1/mnt/usb -t vfat -o codepage=936,iocharset=utf8 #可行

[root@www ~]# ll /mnt/usb

总用量 98256

-rwxr-xr-x 1 rootroot      882 11 20 2015 cacti插件.txt

-rwxr-xr-x 1 rootroot  5727742 1  20 2015 爱的故事上集 - 伴奏.mp3

-rwxr-xr-x 1 rootroot  1276564 1  20 2015 爱死了昨天(铃声).mp3

-rwxr-xr-x 1 rootroot  3695911 1  20 2015 风雨彩虹铿锵玫瑰.mp3

-rwxr-xr-x 1 rootroot  3053752 1  20 2015 如果你知我苦衷 - 周慧敏.mp3

-rwxr-xr-x 1 rootroot  4691013 1  20 2015 是场梦还是真.mp3

-rwxr-xr-x 1 rootroot  2770748 1  20 2015 天若有情 -袁凤瑛.mp3

-rwxr-xr-x 1 rootroot  3695809 1  20 2015 痛彻心扉.mp3

-rwxr-xr-x 1 root root10285792 1  20 2015 我为何让你走.mp3

[root@www ~]# mount /dev/sdb1 /mnt/usb -t vfat -o iocharset=utf8  #可行