Making, decompressing and loading ISO files in Linux system

Time:2021-5-2

Making and decompressing ISO files under Linux
1. Make ISO image file

Switch to the root account and execute the command

Copy code

The code is as follows:

cp /dev/cdrom XXXXX.iso

Xxxxx.iso is the ISO file name to be named. After execution, all the files on the CD are mapped to XXXXX. ISO

2. Loading ISO file
Execute the command under the root account

Copy code

The code is as follows:

rm -rf /dev/cdrom
ln -s /dev/loop7 /dev/cdrom
Losetup / dev / loop7 / path (ISO file path)
mount /mnt/cdrom

If you need to change the plate

Copy code

The code is as follows:

losetup -d /dev/loop7

Repeat

Copy code

The code is as follows:

Losetup / dev / loop7 / path (ISO file path)
mount /mnt/cdrom

If it is a normal CD with ISO
You can use the command directly

Copy code

The code is as follows:

mount -t iso9660 -o loop /../*.iso /path

/… / *. ISO is the ISO file path

/Path is the mount point

or

Copy code

The code is as follows:

Mount – O loop < ISO file name > < destination directory >

If the destination directory does not exist, use MKDIR to create the folder.

3. Unload the loaded ISO file

Copy code

The code is as follows:

Umount – N < destination directory / ISO file name >

Two methods of opening ISO file under Linux
Method 1: Mount command in Linux

The software disk downloaded from the Internet is in ISO format. You can read the files in it without carving it into a CD. No need to unzip.

In terminal

Copy code

The code is as follows:

mount -o loop /mnt/*/1.iso /mnt/cdrom

Command (where * is the path where your tool tray is placed).

After inputting the command, open my computer — > open the CD-ROM to see the files inside. Run install or autorun.

When charudi is prompted for two discs, type the command

Copy code

The code is as follows:

umount /mnt/cdrom

Then type again

Copy code

The code is as follows:

mount -o loop /mnt/*/2.iso/mnt/cdrom

(change the file name of the first command from 1 to 2, which is the name of the second CD). Then go back. Just wait.

To cancel mounting

Copy code

The code is as follows:

umount /mnt/cdrom

Example:

Mount the first disk

Copy code

The code is as follows:

#mount -o loop /mnt/*/1.iso /mnt/cdrom

Unmount

Copy code

The code is as follows:

#umount /mnt/cdrom

Mount the second disk

Copy code

The code is as follows:

#mount -o loop /mnt/*/2.iso/mnt/cdrom

Unmount

Copy code

The code is as follows:

#umount /mnt/cdrom

Note: there is a space between umount and / or

/*Is the path where ISO files are placed

The first method has been used successfully, the second method can not be used, and there is no personal practice.

Method 2: use virtual CD-ROM under Linux

In fact, you don’t need any virtual CD-ROM software at all. You can do it with the mount command.

1. Make the CD into ISO file

Copy code

The code is as follows:

cp /dev/cdrom XXXXX.iso

Xxxxx.iso is the image file you named. After executing this command, the whole CD can be made into ISO file. You can add a path before xxxxx.iso.

2. Load the ISO file on the hard disk to the CD (or virtual CD drive).

Copy code

The code is as follows:

mount -t iso9660 -o loop /*/XXXXX.iso /mnt/iso

3. If you are installing the files provided by the system disk, such as adding or deleting programs, the system may prompt you to insert the CD, but we have no CD, only the image. What should we do?

For RedHat, Mount ISO first, and then execute

Copy code

The code is as follows:

redhat-install-packages –isodir=/mnt/iso

4. General virtual optical drive

Copy code

The code is as follows:

RM – RF / dev / CDROM</p>

Then you can see if the ISO file becomes a virtual CD-ROM drive?

5. Cancel this CD-ROM drive:

Copy code

The code is as follows:

losetup -d /dev/loop7

In case of change:

Just transfer the ISO association to / dev / loop

Copy code

The code is as follows:

losetup /dev/loop7 /*/XXXXX.iso

Note: / * is the path. You may need to create a folder named CDROM under / MNT /

Recommended Today

Large scale distributed storage system: Principle Analysis and architecture practice.pdf

Focus on “Java back end technology stack” Reply to “interview” for full interview information Distributed storage system, which stores data in multiple independent devices. Traditional network storage system uses centralized storage server to store all data. Storage server becomes the bottleneck of system performance and the focus of reliability and security, which can not meet […]