一、示範挂載ISO檔案。(前提:上傳xp_VLK_Sp2.iso到目錄/root/Desktop/)
- [root@localhost /]# mkdir /root/Desktop/ISO_MOUNT
- [root@localhost ~]# ls /root/Desktop/ISO_MOUNT [root@localhost ~]# mount -o loop -t iso9660 /root/Desktop/xp_VLK_Sp2.iso /root/Desktop/ISO_MOUNT
- [root@localhost ~]# ls /root/Desktop/ISO_MOUNT AUTORUN.INF DOCS I386 SETUP.EXE SMARTDRV.EXE sn.txt VALUEADD WIN51IP WinRAR.exe BOOTFONT.BIN DOTNETFX README.HTM SETUPXP.HTM SM.EXE SUPPORT WIN51 WIN51IP.SP2 [root@localhost ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda2 3.8G 2.6G 1.1G 71% / /dev/sda1 46M 9.2M 35M 22% /boot tmpfs 913M 0 913M 0% /dev/shm /dev/sda3 14G 1.5G 12G 12% /home /root/Desktop/xp_VLK_Sp2.iso 596M 596M 0 100% /root/Desktop/ISO_MOUNT
- [root@localhost /]# ls /root/Desktop/ISO_MOUNT
- AUTORUN.INF DOTNETFX SETUP.EXE SM.EXE VALUEADD WIN51IP.SP2
- BOOTFONT.BIN I386 SETUPXP.HTM sn.txt WIN51 WinRAR.exe
- DOCS README.HTM SMARTDRV.EXE SUPPORT WIN51IP
- [root@localhost /]# head -3 /root/Desktop/ISO_MOUNT/AUTORUN.INF
- [AutoRun]
- open=setup.exe
- icon=setup.exe,0
- [root@localhost Desktop]# cd /root/Desktop/ISO_MOUNT
- [root@localhost ISO_MOUNT]# umount /root/Desktop/ISO_MOUNT
- umount: /root/Desktop/ISO_MOUNT: device is busy
- umount: /root/Desktop/ISO_MOUNT: device is busy
- [root@localhost ISO_MOUNT]# cd ..
- [root@localhost Desktop]# umount /root/Desktop/ISO_MOUNT
- [root@localhost Desktop]# echo $?
二、示範挂載CD。(前提,設定好VM的CD/DVD連接配接,具體見附件。然後,在光驅中放入CD)
- [root@localhost ~]# mkdir /root/Desktop/CD_MOUNT
- [root@localhost ~]# ls /root/Desktop/CD_MOUNT
- [root@localhost ~]# mount -t iso9660 -o loop /dev/cdrom /root/Desktop/CD_MOUNT
- [root@localhost ~]# df -h
- Filesystem Size Used Avail Use% Mounted on
- /dev/sda2 3.8G 2.6G 1.1G 71% /
- /dev/sda1 46M 9.2M 35M 22% /boot
- tmpfs 913M 0 913M 0% /dev/shm
- /dev/sda3 14G 1.5G 12G 12% /home
- /dev/hdc 693M 693M 0 100% /root/Desktop/CD_MOUNT
- [root@localhost ~]# ls /root/Desktop/CD_MOUNT
- autorun.exe ghost.exe $oem$ tvas tvob win51ip.sp2 winpe??×° xpemenu.ini
- autorun.inf hd-4.gho readme.txt tvbs win51 windows winpe.is_
- bootfont.bin oem tools tvoa win51ip winnt.xpe wxpe
- [root@localhost ~]# head -3 /root/Desktop/CD_MOUNT/autorun.inf
- [AutoRun]
- open=autorun.exe
- icon=autorun.exe,0
- [root@localhost ~]# cd /root/Desktop/CD_MOUNT
- [root@localhost CD_MOUNT]# umount /root/Desktop/CD_MOUNT
- umount: /root/Desktop/CD_MOUNT: device is busy
- umount: /root/Desktop/CD_MOUNT: device is busy
- [root@localhost CD_MOUNT]# cd ..
- [root@localhost Desktop]# umount /root/Desktop/CD_MOUNT
- [root@localhost Desktop]# echo $?
- [root@localhost Desktop]# ls -l /dev/cdrom lrwxrwxrwx 1 root root 3 Apr 3 16:08 /dev/cdrom -> hdc
- #注意到/dev/cdrom是一個軟連結,真正的位置是/dev/hdc,是以我們在df -h的結果裡看到Filesystem是/dev/hdc。
- #同時,CD在挂載中的時候,是無法彈出光驅的,讀者可以試一試。
三、示範挂載USB。這裡有三個前提:
1. 在Windows中啟動VMware USB Arbitration Service服務(控制台中輸入“net start VMUSBArbService”)。
2. 綠色或精簡版的VM要打上更新檔VMUSB。更新檔附件中可以見下載下傳。
3. 設定VM—》Settings中的USB Controller選項,具體參見附件。
- [root@localhost ~]# mkdir /root/Desktop/USB_MOUNT
- [root@localhost ~]# ls /root/Desktop/USB_MOUNT
- [root@localhost ~]# #顯示目前系統所挂載的磁盤裝置,可以看到隻有/dev/sda
- [root@localhost ~]# fdisk -l
- Disk /dev/sda: 32.2 GB, 32212254720 bytes
- 255 heads, 63 sectors/track, 3916 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Device Boot Start End Blocks Id System
- /dev/sda1 * 1 6 48163+ 83 Linux
- /dev/sda2 7 515 4088542+ 83 Linux
- /dev/sda3 516 2356 14787832+ 83 Linux
- /dev/sda4 2357 3600 ×××430 83 Linux
- [root@localhost ~]# #插入U盤
- [root@localhost ~]# #然後,VM->Removable Devices->Alcor Micro Mass Storage Device->Connect。這時Windows系統會讀不到該U盤。
- [root@localhost ~]# #再次顯示目前系統所挂載的磁盤裝置,可以看到除了/dev/sda,還有/dev/sdb,這就是U盤裝置所在目錄
- [root@localhost ~]# fdisk -l
- Disk /dev/sda: 32.2 GB, 32212254720 bytes
- 255 heads, 63 sectors/track, 3916 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Device Boot Start End Blocks Id System
- /dev/sda1 * 1 6 48163+ 83 Linux
- /dev/sda2 7 515 4088542+ 83 Linux
- /dev/sda3 516 2356 14787832+ 83 Linux
- /dev/sda4 2357 3600 ×××430 83 Linux
- Disk /dev/sdb: 522 MB, 522189824 bytes
- 17 heads, 59 sectors/track, 1016 cylinders
- Units = cylinders of 1003 * 512 = 513536 bytes
- This doesn't look like a partition table
- Probably you selected the wrong device.
- Device Boot Start End Blocks Id System
- /dev/sdb1 ? 775809 1913904 570754815+ 72 Unknown
- Partition 1 has different physical/logical beginnings (non-Linux?):
- phys=(357, 116, 40) logical=(775808, 8, 13)
- Partition 1 has different physical/logical endings:
- phys=(357, 32, 45) logical=(1913903, 14, 4)
- Partition 1 does not end on cylinder boundary.
- /dev/sdb2 ? 168185 2098423 968014120 65 Novell Netware 386
- Partition 2 has different physical/logical beginnings (non-Linux?):
- phys=(288, 115, 43) logical=(168184, 16, 27)
- Partition 2 has different physical/logical endings:
- phys=(367, 114, 50) logical=(2098422, 8, 24)
- Partition 2 does not end on cylinder boundary.
- /dev/sdb3 ? 1864289 3794527 968014096 79 Unknown
- Partition 3 has different physical/logical beginnings (non-Linux?):
- phys=(366, 32, 33) logical=(1864288, 10, 12)
- Partition 3 has different physical/logical endings:
- phys=(357, 32, 43) logical=(3794526, 1, 20)
- Partition 3 does not end on cylinder boundary.
- /dev/sdb4 ? 2877051 2877106 27749+ d Unknown
- Partition 4 has different physical/logical beginnings (non-Linux?):
- phys=(372, 97, 50) logical=(2877050, 0, 3)
- Partition 4 has different physical/logical endings:
- phys=(0, 10, 0) logical=(2877105, 5, 41)
- Partition 4 does not end on cylinder boundary.
- Partition table entries are not in disk order
- [root@localhost ~]# mount /dev/sdb /root/Desktop/USB_MOUNT
- [root@localhost ~]# df -h
- Filesystem Size Used Avail Use% Mounted on
- /dev/sda2 3.8G 2.6G 1.1G 71% /
- /dev/sda1 46M 9.2M 35M 22% /boot
- tmpfs 913M 0 913M 0% /dev/shm
- /dev/sda3 14G 1.5G 12G 12% /home
- /dev/sdb 498M 294M 204M 59% /root/Desktop/USB_MOUNT
- [root@localhost ~]# #可以看到U盤檔案夾下面20090509下面存儲了很多相片
- [root@localhost ~]# ls /root/Desktop/USB_MOUNT/20090509
- img_0852.jpg img_0855.jpg img_0858.jpg img_0861.jpg img_0864.jpg img_0867.jpg img_0870.jpg img_0873.jpg img_0876.jpg p1060409.jpg
- img_0853.jpg img_0856.jpg img_0859.jpg img_0862.jpg img_0865.jpg img_0868.jpg img_0871.jpg img_0874.jpg img_0877.jpg
- img_0854.jpg img_0857.jpg img_0860.jpg img_0863.jpg img_0866.jpg img_0869.jpg img_0872.jpg img_0875.jpg p1060408.jpg
- [root@localhost ~]# cd /root/Desktop/USB_MOUNT
- [root@localhost USB_MOUNT]# umount /root/Desktop/USB_MOUNT
- umount: /root/Desktop/USB_MOUNT: device is busy
- umount: /root/Desktop/USB_MOUNT: device is busy
- [root@localhost USB_MOUNT]# cd ..
- [root@localhost Desktop]# umount /root/Desktop/USB_MOUNT
- [root@localhost Desktop]# echo $?