免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 876 | 回复: 0
打印 上一主题 下一主题

linux 制作iso文件的几种方法! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-05-15 22:01 |只看该作者 |倒序浏览
#dd if=/dev/cdrom of=/root/rh1.iso
#cat /dev/cdrom >;/root/1.iso
#cp -r /home/user name.iso
#mkisofs -a -l -J -L -r -o filename.iso /directory
现在的DVDROM挺便宜的,我们可以应用一个脚本,把我们下载的ISO文件刻成DVD镜象文件,具体方法如下:
1、 下载以下脚本:
#/bin/bash
# by Chris Kloiber ;
# A quick hack that will create a bootable DVD iso of a Red Hat Linux
# Distribution. Feed it either a directory containing the downloaded
# iso files of a distribution, or point it at a directory containing
# the "RedHat", "isolinux", and "images" directories.
# This version only works with "isolinux" based Red Hat Linux versions.
# Lots of disk space required to work, 3X the distribution size at least.
# GPL version 2 applies. No warranties, yadda, yadda. Have fun.
if [ $# -lt 2 ]; then
echo "Usage: `basename $0` source /destination/DVD.iso"
echo ""
echo " The 'source' can be either a directory containing a single"
echo " set of isos, or an exploded tree like an ftp site."
exit 1
fi
cleanup() {
[ ${LOOP:=/tmp/loop} = "/" ] && echo "LOOP mount point = \/, dying!" && exit
[ -d $LOOP ] && rm -rf $LOOP
[ ${DVD:=~/mkrhdvd} = "/" ] && echo "DVD data location is \/, dying!" && exit
[ -d $DVD ] && rm -rf $DVD
}
cleanup
mkdir -p $LOOP
mkdir -p $DVD
if [ !`ls $1/*.iso 2>;&1>;/dev/null ; echo $?` ]; then
echo "Found ISO CD images..."
CDS=`expr 0`
DISKS="1"
for f in `ls $1/*.iso`; do
  mount -o loop $f $LOOP
  cp -av $LOOP/* $DVD
  if [ -f $LOOP/.discinfo ]; then
   cp -av $LOOP/.discinfo $DVD
   CDS=`expr $CDS + 1`
   if [ $CDS != 1 ] ; then
DISKS=`echo ${DISKS},${CDS}`
fi
  fi
  umount $LOOP
done
if [ -e $DVD/.discinfo ]; then
  awk '{ if ( NR == 4 ) { print disks } else { print ; } }' disks="$DISKS" $DVD/.discinfo >; $DVD/.discinfo.new
  mv $DVD/.discinfo.new $DVD/.discinfo
fi
else
echo "Found FTP-like tree..."
cp -av $1/* $DVD
[ -e $1/.discinfo ] && cp -av $1/.discinfo $DVD
fi
rm -rf $DVD/isolinux/boot.cat
find $DVD -name TRANS.TBL | xargs rm -f
cd $DVD
mkisofs -J -R -v -T -o $2 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .
/usr/lib/anaconda-runtime/implantisomd5 --force $2
cleanup
echo ""
echo "Process Complete!"
echo ""
2、然后运行
# mkdvdiso.sh /path/to/the/cd/isos /location/and/name/of/dvd.iso
# growisofs -Z /dev/scd0=/location/and/name/of/dvd.iso


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/68840/showart_689589.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP