Vmware中Ubuntu挂ISO到虚拟光驱
Posted oucaijun
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Vmware中Ubuntu挂ISO到虚拟光驱相关的知识,希望对你有一定的参考价值。
Ubuntu 下挂ISO到虚拟光驱的方法 https://i.cnblogs.com/EditPosts.aspx?opt=1
如果要ubuntu找到rpm软件包,需要把iso挂载到/media/cdrom下面
root@ubuntu:~/test# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 80G 0 disk
├─sda1 8:1 0 78G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 2G 0 part [SWAP]
sr1 11:1 1 667M 0 rom
sr2 11:2 1 667M 0 rom
root@ubuntu:~/test# mount /dev/sr1 /media/cdrom
mount: /dev/sr1 is write-protected, mounting read-only
root@ubuntu:~/test# ls /media/cdrom
boot dists doc EFI install isolinux md5sum.txt pics pool preseed README.diskdefines ubuntu
====================================================================================
相关链接:
Under linux mount (mount) CD-ROM image file. Removable hard disk. U disk. Windows and NFS network shares http://www.codeweblog.com/under-linux-mount-mount-cd-rom-image-file-removable-hard-disk-u-disk-windows-and-nfs-network-shares/
linux is an excellent open source operating system that can run on small to large to giant types of handheld computer systems, with the linux system, the growing maturity and stability as well as its unique advantages of open source, linux in the world been more widely used. Now many companies are from the UNIX system, computer systems, Linux systems and Windows system components of the hybrid system, different systems often need to exchange data. Here I offer my own practical experience tell us about how to mount the linux system (mount) CD-ROM image file, move the hard disk, U disk, and Windows network shares and UNIX NFS network shares.
Mount command (mount)
First of all, tell us about mount (mount) to use the command, mount command parameter is very large, here mainly to talk about today, we will use the.
Command format:
mount [-t vfstype] [-o options] device dir
Of which:
1.-t vfstype specified file system type, usually do not have to be specified. mount will automatically select the correct type. Common types are:
CD-ROM or CD-ROM image: iso9660
DOS fat16 file system: msdos
Windows 9x fat32 file system: vfat
Windows NT ntfs File System: ntfs
Mount Windows file network share: smbfs
UNIX (LINUX) file sharing network: nfs
2.-o options mainly used to describe the way of equipment or files attached. Commonly used parameters are:
loop: used to mount a file as a hard disk partition on the system ro: read-only mounted equipment using rw: read-write mounted device using iocharset: access to the file system used by the specified character set 3.device to mount (mount) equipment.
4.dir device on the system mount point (mount point).
CD-ROM image file attached disk technology in recent years great progress, new computer systems are equipped with large capacity disk systems, in Windows, many people are used to make the software and data through a virtual CD-ROM CD-ROM image file to use. This has many advantages: first, the drive to reduce wear and tear; two large storage capacity hard drives are now dozens of CD-ROM image file is not a problem, as used with the transfer is very convenient; Third, the hard drive is much higher than the CD-ROM read speed the read speed, CPU usage greatly reduced. In fact, the production and use linux system disc images more convenient than the Windows system, do not borrow any third-party packages.
1 CD-ROM image file from the CD-ROMs. The CD into the drive, execute the following command.
# Cp / dev / cdrom / home / sunky / mydisk.iso or # dd if = / dev / cdrom of = / home / sunky / mydisk.iso
Note: the implementation of any of the above command to the current drive can be made into a CD-ROM in the CD-ROM image file / home / sunky / mydisk.iso
2, the files and directories on CD-ROM image file, execute the following command.
# Mkisofs-r-J-V mydisk-o / home / sunky / mydisk.iso / home / sunky / mydir
Note: This command will / home / sunky / mydir directory of all the directories and files on CD-ROM image file / home / sunky / mydisk.iso, CD label is: mydisk
3, CD-ROM image file mounted (mount)
# Mkdir / mnt / vcdrom
Note: Create a directory used as a mount point (mount point)
# Mount-o loop-t iso9660 / home / sunky / mydisk.iso / mnt / vcdrom
Note: Use the / mnt / vcdrom can access the disk image file mydisk.iso in all the files.
Mount removable hard disk on linux systems, USB interface, removable hard disk is treated as a SCSI device. Into the mobile hard disk before you use the fdisk-l or more / proc / partitions View the system hard drive and hard disk partition situation.
[Root at pldyrouter /] # fdisk-l
Disk / dev / sda: 73 dot 4 GB, 73407820800 bytes
255 heads, 63 sectors / track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/ Dev/sda1 1 4 32098 + de Dell Utility
/ Dev/sda2 * 5 2554 20482875 7 HPFS / NTFS
/ Dev/sda3 2555 7904 42973875 83 Linux
/ Dev/sda4 7905 8924 8193150 f Win95 Ext\'d (LBA)
/ Dev/sda5 7905 8924 8193118 + 82 Linux swap
Here you can clearly see that the system has a SCSI hard disk / dev / sda and its four disk partition / dev/sda1 - / dev/sda4, / dev/sda5 is the partition / dev/sda4 logical partitions. Connected mobile hard disk, then fdisk-l or more / proc / partitions View the system hard drive and hard disk partitioning [root at pldyrouter /] # fdisk-l
Disk / dev / sda: 73 dot 4 GB, 73407820800 bytes
255 heads, 63 sectors / track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/ Dev/sda1 1 4 32098 + de Dell Utility
/ Dev/sda2 * 5 2554 20482875 7 HPFS / NTFS
/ Dev/sda3 2555 7904 42973875 83 Linux
/ Dev/sda4 7905 8924 8193150 f Win95 Ext\'d (LBA)
/ Dev/sda5 7905 8924 8193118 + 82 Linux swap
Disk / dev / sdc: 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/sdc1 1 510 4096543 + 7 HPFS / NTFS
/ Dev/sdc2 511 4864 3497 3505 f Win95 Ext\'d (LBA)
/ Dev/sdc5 511 4864 3497 3473 + b Win95 FAT32
We should be able to find more than a SCSI hard disk / dev / sdc and its two disk partition / dev/sdc1?, / Dev/sdc2, where / dev/sdc5 is / dev/sdc2 partition logical partitions. We can use the following command mount / dev/sdc1 and / dev/sdc5.
# Mkdir-p / mnt/usbhd1
# Mkdir-p / mnt/usbhd2
Note: Create a directory used as a mount point (mount point)
# Mount-t ntfs / dev/sdc1 / mnt/usbhd1
# Mount-t vfat / dev/sdc5 / mnt/usbhd2
Note: ntfs formatted disk partition should use-t ntfs parameters, fat32 formatted disk partition should use-t vfat parameters. If the file name is displayed as garbled characters or no show, you can use the following command format.
# Mount-t ntfs-o iocharset = cp936 / dev/sdc1 / mnt/usbhd1
# Mount-t vfat-o iocharset = cp936 / dev/sdc5 / mnt/usbhd2
linux system partition using fdisk and mkfs command to create a command file system partition can be made into a mobile hard disk linux system unique to ext2, ext3 format. Thus, even more convenient to use linux. Use the following command can be directly attached.
# Mount / dev/sdc1 / mnt/usbhd1
U disk and mount removable hard disk USB interface on the linux systems, like U disk is treated as a SCSI device. Using the same methods and mobile hard disk. Insert U disk before you use the fdisk-l or more / proc / partitions View the system hard drive and hard disk partition situation.
[Root at pldyrouter root] # fdisk-l
Disk / dev / sda: 73 dot 4 GB, 73407820800 bytes
255 heads, 63 sectors / track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/ Dev/sda1 1 4 32098 + de Dell Utility
/ Dev/sda2 * 5 2554 20482875 7 HPFS / NTFS
/ Dev/sda3 2555 7904 42973875 83 Linux
/ Dev/sda4 7905 8924 8193150 f Win95 Ext\'d (LBA)
/ Dev/sda5 7905 8924 8193118 + 82 Linux swap
Into the U-hours, and then fdisk-l or more / proc / partitions View the system hard drive and hard disk partition situation.
[Root at pldyrouter root] # fdisk-l
Disk / dev / sda: 73 dot 4 GB, 73407820800 bytes
255 heads, 63 sectors / track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/ Dev/sda1 1 4 32098 + de Dell Utility
/ Dev/sda2 * 5 2554 20482875 7 HPFS / NTFS
/ Dev/sda3 2555 7904 42973875 83 Linux
/ Dev/sda4 7905 8924 8193150 f Win95 Ext\'d (LBA)
/ Dev/sda5 7905 8924 8193118 + 82 Linux swap
Disk / dev / sdd: 131 MB, 131072000 bytes
9 heads, 32 sectors / track, 888 cylinders
Units = cylinders of 288 * 512 = 147456 bytes
Device Boot Start End Blocks Id System
/ Dev/sdd1 * 1 889 127983 + b Win95 FAT32
Partition 1 has different physical / logical endings:
phys = (1000, 8, 32) logical = (888, 7, 31)
System more than a SCSI hard disk / dev / sdd, and a disk partition / dev/sdd1, / dev/sdd1 is what we want to mount the U disk.
# Mkdir-p / mnt / usb
Note: Create a directory used as a mount point (mount point)
# Mount-t vfat / dev/sdd1 / mnt / usb
Note: It can be / mnt / usb to visit U disk, and if the file name is displayed as garbled characters or no show, you can use the following command.
# Mount-t vfat-o iocharset = cp936 / dev/sdd1 / mnt / usb
Mount a network share Windows file sharing is the core of Windows SMB / CIFS, to be mounted under the linux (mount) windows disk sharing, you must install and use the samba package. Now most popular linux distributions already contain the samba package, if not installed install linux system, please first install samba samba. Of course, can also go to
www.samba.org ...... download the new version is 3.0.10 version.
When the windows system after sharing set, you can mount the linux client (mount), the specific operation is as follows:
# Mkdir-p / mnt / samba
Note: Create a directory used as a mount point (mount point)
# Mount-t smbfs-o username = administrator, password = pldy123 / / 10.140.133.23 / c $ / mnt / samba
Note: administrator and pldy123 is ip address 10.140.133.23 windows computer, a user name and password, c $ is a disk of this computer to share
So can the linux system through the / mnt / samba to access windows files on the system disk. Above operations in redhat as server 3, redflag server 4.1, suse server 9, and windows NT 4.0, windows 2000, windows xp, windows 2003 environment test.
NFS mount UNIX system similar to windows file sharing network to share, UNIX (Linux) system also has its own network sharing, that is NFS (Network File System), here we have the SUN Solaris2.8 and REDHAT as server 3 as an example a simple explain how to mount nfs in linux network share.
The client in linux mount (mount) NFS shared disk, you must configure NFS server.
1, Solaris NFS server system configuration is as follows:
(1) modify / etc / dfs / dfstab, increase the shared directory share-F nfs-o rw / export / home / sunky
(2) start the nfs service # / etc / init.d / nfs.server start
(3) NFS services started, you can use the following command to add new shared # share / export/home/sunky1
# Share / export/home/sunky2
Note: / export / home / sunky and / export/home/sunky1 is ready to share the directory 2, linux NFS server system configuration is as follows:
(1) modify / etc / exports, increase the shared directory / export / home / sunky 10.140.133.23 (rw)
/ Export/home/sunky1 * (rw)
/ Export/home/sunky2 linux-client (rw)
Note: / export / home / directory sunky, sunky1, sunky2 is ready to share the directory, 10.140.133.23, *, linux-client is allowed to mount this share linux client IP address or host name. If you want to use the host name linux-client to the server host in / etc / hosts file to increase linux-client host ip definition. The following format:
10.140.133.23 linux-client
(2) start and stop NFS service / etc / rc.d / init.d / portmap start (the default in the REDHAT started in PORTMAP)
/ Etc / rc.d / init.d / nfs start start the NFS service / etc / rc.d / init.d / nfs stop stop the NFS service NOTE: If modify / etc / export file to add new shares, should stop the NFS service, and then start NFS service can the sharing of the additional work. Use the command exportfs-rv can achieve the same effect.
3, linux client mount (mount) other linux system or UNIX system, NFS share # mkdir-p / mnt / nfs
Note: Create a directory used as a mount point (mount point)
# Mount-t nfs-o rw 10.140.133.9: / export / home / sunky / mnt / nfs
Note: Here we assume 10.140.133.9 is the NFS server host IP address, of course, here you can use the host name, but in the local / etc / hosts file to increase the definition of the server ip. / Export / home / sunky shared directory for the server.
So can the linux client through / mnt / nfs to access other linux system or UNIX system out of NFS Share file. Above operations in redhat as server 3, redflag server4.1, suse server 9, and Solaris 7, Solaris 8, Solaris 9 for x86 & sparc environment test.
Linux:如何挂载CD-ROM光盘驱动器 https://i.cnblogs.com/EditPosts.aspx?opt=1
如何在linux操作系统的命令行下挂载光盘驱动器呢?你需要使用mount命令来挂载CD或者DVD光盘驱动器,首先,你需要先插入CD或者DVD到光盘驱动器里,然手输入下面的mount命令来挂载光盘。
获取CD/DVD的设备名
使用下面的命令来获取DVD/CD-ROM/Writer设备的名字:
#lsblk
或者
#dmesg | egrep -i --color \'cdrom|dvd|cd/rw|writer
命令输出:
ata2.00: ATAPI: VMware Virtual IDE CDROM Drive, 00000001, max UDMA/33
sr0: scsi3-mmc drive: 1x/1x writer dvd-ram cd/rw xa/form2 cdda tray
在linux系统里挂载DVD/CDROM
#mount -t iso9660 -o ro /dev/设备名 /挂载目录名
创建挂载点,输入mkdir命令:
#mkdir -p /mnt/cdrom
挂载/dev/cdrom 或者/dev/sr0:
#mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom
或者
#mount -t iso9660 -o ro /dev/sr0 /mnt/cdrom
使用下面的两个命令来验证光驱是否挂载在/mnt/cdrom上,输入下面的命令:
#mount
#df
如何卸载已经挂载的光驱?
输入下面的命令:
#umount /cdrom
或者
#umount /dev/cdrom
或者
#umount /mnt/cdrom
以上是关于Vmware中Ubuntu挂ISO到虚拟光驱的主要内容,如果未能解决你的问题,请参考以下文章
使用VMware虚拟机安装Ubuntu14.04.3-server系统
虚拟机VMware Workstation Pro下安装ubuntu-14.04.4(64位)方法(附ubuntu-14.04-desktop-amd64.iso下载链接)