把U盤上的數據複製到虛擬機CentOS系統中的usb目錄下

操作系統: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  #可行


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章