分类:
2006-11-08 15:34:36
although ESX can’t map USB device to virtual machine, it can recognize USB device directly attached to it. the only limitation is your partition on USB device must be FAT32. so we can use a big capacity USB acting as a backup target to backup template, export virtual machine etc.
below is a example:
1) attach USB device to ESX
2) use fdisk –l to verify USB is recognized by ESX
# fdisk –l
......
Disk /dev/sdf: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdf1 1 2483
/dev/sdf2 2484 4863
/dev/sdf5 2484 4863 19117318+ b Win95 FAT32
……
3) use dmesg to double check
dmesg |grep sdf
VMWARE: Device that would have been attached as scsi disk sdf at scsi0, channel 0, id 2, lun 0
VMWARE: Device that would have been attached as scsi disk sdf at scsi0, channel 0, id 2, lun 0
VMWARE SCSI Id: Supported VPD pages for sdf : 0x20 0x0
VMWARE SCSI Id: Could not get disk id for sdf
:VMWARE: Unique Device attached as scsi disk sdf at scsi2, channel 0, id 0, lun 0
Attached scsi disk sdf at scsi2, channel 0, id 0, lun 0
SCSI device sdf: 78140160 512-byte hdwr sectors (38154 MB)
sdf: sdf1 sdf2 < sdf5 >
4)
mount /dev/sdf1 /mnt/usb1
mount /dev/sdf5 /mnt/usb2
if your file name have Chinese character, please use below command:
mount -o codepage=936,iocharset=gb2312 -t vfat /dev/sdf5 /mnt/usb2
[root@BI-ESX2 root]# ls -l /mnt/usb1
总用量 3864496
drwxr-xr-x 4 root root 16384 6月 22 10:51 docs
drwxr-xr-x 2 root root 16384 10月 18 11:22 ghost
-rwxr-xr-x 1 root root 3956889600 11月 6 17:57 kelu.iso
drwxr-xr-x 2 root root 16384 8月 31 23:05 mp3
drwxr-xr-x 5 root root 16384 10月 18 15:25 office
drwxr-xr-x 6 root root 16384 6月 22 11:23 Recycled
drwxr-xr-x 8 root root 16384 6月 22 10:20 System Volume Inform
on
drwxr-xr-x 5 root root 16384 6月 22 10:52 wangyue
drwxr-xr-x 3 root root 16384 6月 22 10:52 其它
drwxr-xr-x 3 root root 16384 6月 22 10:51 各种文件
drwxr-xr-x 2 root root 16384 6月 22 10:52 名单
drwxr-xr-x 8 root root 16384 6月 22 10:52 对内公文
drwxr-xr-x 2 root root 16384 6月 22 11:22 彩票广告
drwxr-xr-x 3 root root 16384 6月 22 10:52 我接收到的文件
drwxr-xr-x 7 root root 16384 6月 22 11:22 新建文件夹
drwxr-xr-x 3 root root 16384 6月 22 11:22 模拟与练习
drwxr-xr-x 2 root root 16384 6月 22 13:49 游戏
drwxr-xr-x 24 root root 16384 7月 27 11:48 照片
drwxr-xr-x 2 root root 16384 6月 22 13:49 礼品
drwxr-xr-x 2 root root 16384 6月 22 10:52 考勤
drwxr-xr-x 2 root root 16384 6月 22 13:48 通讯
drwxr-xr-x 6 root root 16384 6月 22 10:52 项目经理