linux系统做成iso镜像文件,制作iso镜像文件_linux系统下iso镜像文件制作方法 - 驱动管家...

1、检验下载的ISO镜像的MD5值:

$ md5sum download.iso

2、刻录ISO:

1)先下载cdrecord:

$sudo apt-get install cdrecord

2)寻找设备(刻录机):

$ cdrecord --scanbus (这会给出类似这样的一组数字:0,0,0)

c7e4538952fc7c83238653f2ffe316db.png

3)开始刻录:

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

3、检验已经刻录好的光盘的md5值:

(确保安装了isoinfo 没有的话apt-get~~~)

$ isoinfo -d -i /dev/cdrom

(查看光盘信息,会出现如下字样: Logical block size is: 2048 Volume size is: 339344)

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

制作ISO镜像

===========

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

mkisofs 主要参数说明:

-J/-joliet 使用 Joliet 格式的目录与文件名称

-T/-translation-table 为每个目录都生成一个 TRANS.TBL 文件名转换表文件

-R/-rock 使用 Rock Ridge Extensions

-V/-volid指定光盘的卷标ID

制作具有自我校验功能的光盘

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

ISO文件在网络传输过程中可能会发生改变,这个可以通过MD5校验码来检测文件的完整性,即:发布ISO的同时也公布其MD5校验码,这样他人下载 ISO后,再进行一次MD5运算,如果得到的MD5值和提供的一样,则ISO文件和原始文件一模一样,否则就得重新下载。

将ISO刻录到光盘后,又如何校验光盘上刻录的内容是否和原始ISO中的内容完全一样呢?因为在刻录过程中,也许...也许会出现错误。

这就需要用到 isomd5sum 这个工具了

加入MD5校验信息:

implantisomd5 --force ISO文件

刻录后,可以通过 checkisomd5 --verbose 来校验数据完整性

ISO制作完整脚本(带MD5校验)

脚本运行参数

mkiso.sh

#!/bin/sh

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

# Author: Muddyboot - toobyddum@gmail.com

# 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 $@; 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

### 制作ISO

mkisofs -J -T -R $extra_args \

-V $label -o $output $source

### 加入 MD5 校验信息

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值