RedHat DVD安裝盤製作

jacksonkingdom發表於2010-05-24
Redhat 4(光碟機生成ISO)

第一步:先準備一個較大的硬碟空間,大約4.5G,有條件最好大一點;

第二步:建立一個目錄,存放CD的ISO檔案;
    
mkdir /mnt/iso 

第三步:製作CD的ISO檔案;

    分別將RedHatEL4的四張光碟,放入光碟機,進行光碟映象,製作ISO格式檔案;
    dd if=/dev/hdc of=/mnt/iso/disk1.iso

    dd if=/dev/hdc of=/mnt/iso/disk2.iso

    dd if=/dev/hdc of=/mnt/iso/disk3.iso

    dd if=/dev/hdc of=/mnt/iso/disk4.iso

 第四步:建立目錄,以便mount剛才的映象檔案;
    mkdir /mnt/el4_iso

    mkdir /mnt/el4_iso/disk{1,2,3,4} /mnt/el4_iso/docs

第五步:掛載上面製作的ISO檔案
    mount -o loop /mnt/iso/disk1.iso /mnt/el4_iso/disk1

    mount -o loop /mnt/iso/disk2.iso /mnt/el4_iso/disk2

    mount -o loop /mnt/iso/disk3.iso /mnt/el4_iso/disk3

    mount -o loop /mnt/iso/disk4.iso /mnt/el4_iso/disk4

第五步:複製isolinux及.discinfo檔案;
    cd /mnt/el4_iso

    cp -av disk1/isolinux disk1/.discinfo ./

第六步:編輯.discinfo檔案,將第4行的1換成1,2,3,4,以表示要用這四4個ISO檔案;

第七步:製作DVD的ISO檔案;
mkisofs -o dvd.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot 

-boot-load-size 4 -boot-info-table -R -m TRANS.TBL -x disk1/.discinfo -x disk1/isolinux

-graft-points disk1 .discinfo=.discinfo isolinux/=isolinux RedHat/=disk2/RedHat

RedHat/=disk3/RedHat RedHat/=disk4/RedHat docs/=docs/


     OK,到此為止,已經成功將4張CD製作成一張DVD了!將其燒錄到DVD盤上,以後安裝RedHat就不用做那令人厭煩的換盤的事情 了!
如果想把extra那張盤上的程式包製作到DVD中,可以把Extras這張盤mount到disk5目錄下,mkisofs命令中加入 -x disk5/RedHat/base RedHat=cd5/RedHat/


Redhat 5(mount映象)

mkdir disk{1,2,3,4,5}
mkdir docs
mount -o loop rhel-5-server-i386-disc1.iso disk1/
mount -o loop rhel-5-server-i386-disc2.iso disk2/
mount -o loop rhel-5-server-i386-disc3.iso disk3/
mount -o loop rhel-5-server-i386-disc4.iso disk4/
mount -o loop rhel-5-server-i386-disc5.iso disk5/
cp -av disk1/isolinux disk1/.discinfo ./
vi .discinfo
#將第4行的1改為1,2,3,4,5
mkisofs -o RHEL5dvd.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 5 -boot-info-table -R -m TRANS.TBL -x disk1/.discinfo -x disk1/isolinux -graft-points disk1 .discinfo=.discinfo isolinux/=isolinux Server/=disk2/Server/ Server/=disk3/Server/ Server/=disk4/Server/ Server/=disk5/Server/ Cluster/=disk5/Cluster ClusterStorage/=disk5/ClusterStorage/ VT/=disk5/VT/ docs/=docs/

如何透過media test
生成dvdiso映象後, 執行/usr/sbin/implantisomd5 --force RHEL5dvd.iso, 就可以透過media test了.

另, 如果系統沒有implantisomd5, 可以從下 載原始碼,
先make, 然後 mv implantisomd5 checkisomd5 /usr/sbin.

注意事項:
可能會出現如下錯誤
Using BOOT000.CAT;1 for  isolinux/boot.cat (boot.cat)
mkisofs: Error: '(NULL POINTER)' and 'isolinux/boot.cat' have the same Rock Ridge name 'boot.cat'.
mkisofs: Unable to sort directory isolinux

刪除boot.cat檔案
cd isolinux
rm boot.cat

改進製作的iso映象
按以上方法制作的映象檔案在windows下直接讀取的話檔名全部遵循iso09660規範,而且沒有加入Joliet檔案系統,給我們的使用帶來了很大的不方便。新增J、D、U、T引數後,除了光碟的名稱為預設的”CDROM“外,基本和Redhat官方的DVD iso格式一致。

mkisofs -o dvd.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -JRDUT -m TRANS.TBL -x disk1/.discinfo -x disk1/isolinux -graft-points disk1 .discinfo=.discinfo isolinux/=isolinux RedHat/=disk2/RedHat RedHat/=disk3/RedHat RedHat/=disk4/RedHat

-J 建立Joliet檔案系統(windows)

-R 建立Rock Ridge檔案系統(unix/linux,保留許可權資訊)

-r     This  is  like  the -R option, but file ownership and modes are
              set to more useful values.  The uid and gid are  set  to  zero,
              because  they  are  usually only useful on the author’s system,
              and not useful to the client.  All the file read bits  are  set
              true,  so  that  files and directories are globally readable on
              the client.  If any execute bit is set for a file, set  all  of
              the  execute  bits, so that executables are globally executable
              on the client.  If any search bit is set for a  directory,  set
              all  of  the  search  bits,  so  that  directories are globally
              searchable on the client.  All write bits are cleared,  because
              the  CD-Rom  will  be mounted read-only in any case.  If any of
              the special mode bits are set, clear them, because  file  locks
              are  not useful on a read-only file system, and set-id bits are
              not desirable for uid 0 or gid 0.  When used on Win32, the exe-
              cute  bit  is set on all files. This is a result of the lack of
              file permissions on Win32 and the Cygwin POSIX emulation layer.
              See also -uid -gid, -dir-mode, -file-mode and -new-dir-mode.

-D 徹底隱藏rr_moved目錄 -disable-deep-relocation Disable deep directory relocation (violates ISO9660)

-U 不轉換檔名 -untranslated-filenames Allow Untranslated filenames (for HPUX & AIX - violates ISO9660). Forces -l, -d, -N, -allow-leading-dots, -relaxed-filenames, -allow-lowercase, -allow-multidot

-T 產生TRANS.TBL檔案 Generate translation tables for systems that don't understand long filenames

-graft-points
Allow to use graft points for  filenames.  If  this  option  is used,  all filenames are checked for graft points. The filename is divided at the first unescaped equal sign.  All  occurrences of  ’\\’  and  ’=’  characters  must  be  escaped  with
’\\’ if -graft-points has been specified.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23590362/viewspace-663534/,如需轉載,請註明出處,否則將追究法律責任。

相關文章