How to use linux virtual optical drive?

藏色散人
Release: 2020-09-18 14:34:58
Original
3771 people have browsed it

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
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

Then you look at the iso file, has it become a virtual optical drive?

Cancel this optical drive:

losetup -d /dev/loop7
Copy after login

If you change the disk:

Just transfer the iso association to /dev/loop

losetup /dev/loop7 /*/XXXXX.iso
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!