#1, 創建目錄 rm -rf /media/dvd1 /media/dvd2 /media/CentOS mkdir -pv /media/dvd1 /media/dvd2 /media/CentOS #2, 掛載鏡像 mount -o loop /root/CentOS-6.5-i386-bin-DVD1to2/CentOS-6.5-i386-bin-DVD1.iso /media/dvd1 mount -o loop /root/CentOS-6.5-i386-bin-DVD1to2/CentOS-6.5-i386-bin-DVD2.iso /media/dvd2 #3, 拷貝文件 cp -af /media/dvd1/* /media/CentOS cp -af /media/dvd2/Packages/*.rpm /media/CentOS/Packages #4, 追加並排序 cat /media/dvd2/Packages/TRANS.TBL >> /media/CentOS/Packages/TRANS.TBL mv /media/CentOS/Packages/{TRANS.TBL,TRANS.TBL.BAK} sort /media/CentOS/Packages/TRANS.TBL.BAK > /media/CentOS/Packages/TRANS.TBL rm -rf /media/CentOS/Packages/TRANS.TBL.BAK #5, 生成鏡像 mkisofs -r -o /root/CentOS-6.5-i386-bin-DVD.iso /media/CentOS #6, 卸載鏡像 umount /media/dvd1 umount /media/dvd2 #7, 刪除目錄 rm -rf /media/dvd1 /media/dvd2 /media/CentOS