Home > Article > Operation and Maintenance > How to use linux virtual optical drive?
Using a virtual optical drive under Linux actually does not require any virtual optical drive software. You can use the mount command to complete it.
1. Make the CD into an iso file
cp /dev/cdrom XXXXX.iso
XXXXX.iso is an image file named for you. After executing this command, the entire disc can be made into an iso file. You can add the path before XXXXX.iso
.
2. Load the iso file on the hard disk to the CD (or virtual CD-ROM drive).
mount -t iso9660 -o loop /*/XXXXX.iso /mnt/iso
3. If you are installing files provided by the system disk, such as adding or deleting programs, the system may prompt you to insert the CD, but we do not have a CD, only a mirror, what should we do?
For Redhat, first mount iso, and then execute
redhat-install-packages --isodir=/mnt/iso
4. General virtual optical drive
Use losetup to check the usage of the loop device, and use losetup -f to find the first available device.
rm -rf /dev/cdrom #删除光驱 ln /dev/loop7 /dev/cdrom losetup /dev/loop7 /*/XXXXX.iso mount /dev/cdrom /mnt/cdrom
Then you look at the iso file, has it become a virtual optical drive?
Cancel this optical drive:
losetup -d /dev/loop7
If you change the disk:
Just transfer the iso association to /dev/loop
losetup /dev/loop7 /*/XXXXX.iso
The above is the detailed content of How to use linux virtual optical drive?. For more information, please follow other related articles on the PHP Chinese website!