Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to read and use iso Image File under linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to read and use iso image files under linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "how to read and use iso image files under linux"!

If you copy it locally, you can use mount

Mount fileName mountPoint-o loop,fileName is the name of the image file (* .iso, * .img)

Use case: if I have a / home/rhel5.2.iso CD image file

Mkdir / mnt/b

Mount / home/rhel5.2.iso / mnt/b-o loop, so enter the directory / mnt/b so you can browse the contents of rhel5.2.iso. The use of * .img files is the same.

Others may be useful to you for your reference.

Linux is an excellent open source operating system, which can run on all kinds of computer systems from large to small to palmtop. With the increasing maturity and stability of linux system and its unique advantages of open source, linux has been more and more widely used all over the world. At present, the computer systems of many enterprises are mixed systems composed of UNIX system, Linux system and Windows system, and data exchange is often needed between different systems. Based on my own practical work experience, I will introduce how to mount (mount) CD image files, removable hard disk, U disk, Windows network sharing and UNIX NFS network sharing under linux system.

Hook command (mount)

First of all, let's introduce the use of the mount command. There are a lot of parameters for the mount command. Here we will mainly talk about what we are going to use today.

Command format:

Mount [- t vfstype] [- o options] device dir

Where:

1. Murt vfstype specifies the type of file system, usually not necessarily. Mount automatically selects the correct type. The common types are:

CD or CD image: iso9660

DOS fat16 file system: msdos

Windows 9x fat32 file system: vfat

Windows NT ntfs file system: ntfs

Mount Windows file network sharing: smbfs

UNIX (LINUX) File Network sharing: nfs

2.Muro options is mainly used to describe how devices or files are connected. The commonly used parameters are:

Loop: used to attach a file to the system as if it were a hard disk partition

Ro: attach devices in read-only mode

Rw: use read-write mode to connect devices

Iocharset: specifies the character set used to access the file system

3.device the device to be attached (mount).

The mounting point (mount point) of a 4.dir device on the system.

Hang the CD image file

Due to the great progress of disk technology in recent years, new computer systems are equipped with large-capacity disk systems. Under Windows, many people are used to making software and materials into CD-ROM image files to use virtual optical drives. This has many advantages: first, reduce the wear of the optical drive; second, now the huge capacity of the hard disk to store dozens of CD image files is not a problem, with the use and adjustment is very convenient; third, the reading speed of the hard disk is much higher than the reading speed of the CD, and the CPU occupancy rate is greatly reduced. In fact, making and using CD-ROM image under linux system is more convenient than Windows system, and there is no need to borrow any third-party software packages.

1. Make a CD image file from the CD. Put the CD in the CD drive and execute the following command.

# cp / dev/cdrom / home/sunky/mydisk.iso or

# dd if=/dev/cdrom of=/home/sunky/mydisk.iso

Note: execute any of the above commands to make the CD in the current CD drive into a CD image file / home/sunky/mydisk.iso

2. Make the files and directories into CD-ROM image files and execute the following command.

# mkisofs-r-J-V mydisk-o / home/sunky/mydisk.iso / home/sunky/ mydir

Note: this command makes all the directories and files in the / home/sunky/mydir directory into a CD image file / home/sunky/mydisk.iso, and the CD volume is labeled: mydisk.

3. Mount of CD image files.

# mkdir / mnt/vcdrom

Note: create a directory to use as mount point.

# mount-o loop-t iso9660 / home/sunky/mydisk.iso / mnt/vcdrom

Note: use / mnt/vcdrom to access all the files in the disk image file mydisk.iso.

Attach a removable hard disk

For linux systems, the removable hard disk with USB interface is treated as a SCSI device. Before inserting a removable hard drive, use fdisk-l or more / proc/partitions to check the hard drive and hard disk partitions of the system.

[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 432098 + 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 drive / dev/sda and its four disk partitions / dev/sda1-/ dev/sda4, / dev/sda5 is the logical partition of the partition / dev/sda4. After connecting the removable hard drive, use fdisk-l or more / proc/partitions to check the hard disk and hard disk partition of the system.

[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 432098 + 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 34973505 f Win95 Ext'd (LBA)

/ dev/sdc5 511 4864 3497347343 + b Win95 FAT32

You should be able to find an extra SCSI hard disk / dev/sdc and its two disk partitions / dev/sdc1? / dev/sdc2, where / dev/sdc5 is the logical partition of the / dev/sdc2 partition. We can hook up / dev/sdc1 and / dev/sdc5 using the following command.

# mkdir-p / mnt/usbhd1

# mkdir-p / mnt/usbhd2

Note: create a directory to be used as a mount point.

# mount-t ntfs / dev/sdc1 / mnt/usbhd1

# mount-t vfat / dev/sdc5 / mnt/usbhd2

Note: the-t ntfs parameter should be used for disk partitions in ntfs format and-t vfat parameter should be used for disk partitions in fat32 format. If the Chinese character file name is displayed as garbled or not displayed, 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

At this point, I believe you have a deeper understanding of "how to read and use iso image files under linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report