Making and recording of ISO image file under Linux system

Time:2022-4-7

 

1. Verify the MD5 value of the downloaded ISO image:

$ md5sum download.iso

 

2. Burn ISO:

1) Download CDRECORD first:

$sudo apt-get install cdrecord

2) Find device (recorder):

$CDRECORD — scanbus (this will give a set of numbers like this: 0,0,0)

3) Start recording:

$ cdrecord dev=0,0,0 download.iso

 

3. Verify the MD5 value of the recorded disc:

(ensure)installIf there is no isoinfo, apt get ~ ~ ~)

$ isoinfo -d -i /dev/cdrom

(when viewing the disc information, the following words will appear: logical block size is: 2048 volume size is: 339344)

$ dd if=/dev/cdrom bs=2048 count=339344 conv=notrunc,noerror|md5sum

 

Make ISO image

===========

 

mkisofs -J -T -R -V volume_id -o mycd.iso source_dir

 

Description of main parameters of mkisofs:

 

-J / – Joliet directory and file names in Joliet format

-T / – translation table generates a trans for each directory TBL file name conversion table file

-R / – Rock Ridge extensions

-V / – volid < disc ID > specifies the volume label ID of the disc

 

Making CD with self checking function

==========================

 

ISO files innetworkThe transmission process as like as two peas can be detected by MD5 check code, which means that the integrity of the file can be detected by issuing the ISO check. The MD5 check code is also released when the ISO is released. After downloading the ISO, the MD5 operation is performed again. If the MD5 value is supplied and the same is provided, the ISO document is exactly the same as the original file, otherwise it will have to be downloaded again.

 

After the ISO is recorded to the CD, how to verify whether the contents recorded on the CD are exactly the same as those in the original ISO? Because during the recording process, maybe There may be errors.

 

This requires the tool isomd5sum

 

Add MD5 verification information:

 

Implantisomd5 — force ISO file

 

After recording, you can check the data integrity through checkisomd5 — verbose < CD device address, such as / dev / HDB >

 

 

Complete script produced by ISO (with MD5 verification)

 

Script run parameters

 

mkiso. SH < original file or directory to burn > < output ISO file >

 

#!/bin/sh

 

#****************************************************

# Author: Muddyboot – [email protected]

# Last modified: 2007-09-11 21:21

# Filename: mkiso.sh

# Description: script for easy creating ISO image

#****************************************************

 

if [ $# -lt 3 ]; then

echo -e “\nUsage: `basename $0` source_dir output_iso cd_label \n”

exit 1

fi

 

source=$1

output=$2

label=$3

 

### extra mkiso argument

shift 3

for i in [email protected]; do

extra_args=”$extra_args $1 “

shift

done

 

if [ ! -e “$source” ]; then

echo -e “\nERR: Source file or directory does not exist ! \n”

exit 1

fi

 

## remove exists TRANS.TBL files

if [ -d “$source” ]; then

find $source -name TRANS.TBL | xargs rm -f

fi

 

###Make ISO

mkisofs -J -T -R $extra_args \

-V $label -o $output $source

 

###Add MD5 verification information

MD5_CHECKSUM=`whereis implantisomd5|awk -F’: ‘ ‘{print $2}’`

 

if [ -z “$MD5_CHECKSUM” ]; then

echo -e “\n** WARNING: implantisomd5 not found, no md5sum added.\n”

else

echo -e “\n** Good, implantisomd5 program found.”

echo “Adding md5sum information for ISO image …”

implantisomd5 –force $output

fi

 

echo

echo “** ISO image $output created successfully ! “

echo

Recommended Today

When microservices are a bad idea

When microservices are a bad idea This article may be pouring cold water on everyone, please treat it rationally. On paper, microservices sound great. They are modular, scalable and fault tolerant. Many companies have used this pattern with great success, so microservices may naturally be a great architecture and the best way to launch new […]