Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1173201
  • 博文数量: 128
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 4870
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-19 14:28
文章分类

全部博文(128)

文章存档

2010年(2)

2009年(22)

2008年(104)

我的朋友

分类: LINUX

2008-03-21 10:06:30

linux下怎样刻录?


在linux下制作光盘镜像?
dd if=/dev/cdrom of=/backup/ubuntu.iso bs=512
制作iso镜像:
#mkisofs -R -o /var/tmp/mary.iso /home/mary
通过iso镜像刻录cd:
#cdrecord -v speed=2 dev=/dev/cdrom -data /var/tmp/mary.iso

制作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> 指定光盘的卷标ID 

制作具有自我校验功能的光盘 
========================== 
    ISO文件在网络传输过程中可能会发生改变,这个可以通过MD5校验码来检测文件的完整性,即:发布ISO的同时也公布其MD5校验码,这样他人下载ISO后,再进行一次MD5运算,如果得到的MD5值和提供的一样,则ISO文件和原始文件一模一样,否则就得重新下载。 
    将ISO刻录到光盘后,又如何校验光盘上刻录的内容是否和原始ISO中的内容完全一样呢?因为在刻录过程中,也许...也许会出现错误。 
    这就需要用到 isomd5sum 这个工具了 
    加入MD5校验信息: 
     implantisomd5 --force ISO文件 
    刻录后,可以通过 checkisomd5 --verbose <光盘设备地址,如/dev/hdb> 来校验数据完整性 
附ISO制作完整脚本(带MD5校验) 
============================== 
脚本运行参数 
============ 
    mkiso.sh <需要刻录的原始文件或目录> <输出ISO文件>  
#!/bin/sh 
#**************************************************** 
# Author: JL 
# 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
 
阅读(824) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~