歡迎您光臨本站 註冊首頁

linux無人值守安裝光碟製作

←手機掃碼閱讀     火星人 @ 2014-03-08 , reply:0

linux(rhel5.5)無人值守安裝光碟製作

一、生產自動安裝kickstart配置文件(可用kickstart配置工具,system-config-kickstart配置) [[email protected] ~]#vim /root/ks.cfg #platform=x86, AMD64, 或 英特爾 EM64T # System authorization information auth --useshadow --enablemd5 key --skip #跳過安裝sn的輸入,必須有 # System bootloader configuration bootloader --location=mbr # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel # Use graphical install #graphical # Use text mode install #字元界面安裝 text # Firewall configuration firewall --disabled # Run the Setup Agent on first boot firstboot --disable # System keyboard keyboard us # System language lang zh_CN #系統默認語言設置 # Installation logging level logging --level=info # Use CDROM installation media cdrom #默認安裝介質 # Network information network --bootproto=static --device=eth0 --gateway=192.168.32.254 --ip=192.168.32.30 --netmask=255.255.255.0 --onboot=on #網路設置 # Reboot after installation reboot --eject #安裝后彈出cd重新系統,必須彈出cd,否則重啟時會再次自動安裝系統 #Root password rootpw --iscrypted $1$m3qF5xHj$nPMaPd2vTvl6Bnm5Do.un. # SELinux configuration selinux --disabled # System timezone timezone Asia/Chongqing # Install OS instead of upgrade install # X Window System configuration information xconfig --defaultdesktop=GNOME --depth=16 --resolution=1024x768 --startxonboot # Disk partitioning information

#硬碟分區設置 part /boot --bytes-per-inode=4096 --fstype="ext3" --ondisk=sda --size=256 part swap --bytes-per-inode=4096 --fstype="swap" --ondisk=sda --size=8192 #part / --bytes-per-inode=4096 --fstype="ext3" --grow --ondisk=sda --size=51200 #LVM install #邏輯卷創建配置,必須嚴格按照物理卷、卷組、邏輯卷順序創建 part pv.01 --ondisk=sda --size 51200 volgroup vg00 pv.01 logvol / --vgname=vg00 --size=1 --grow --name=lv00 #Software packages install #軟體安裝包選擇 %packages @base @gnome-desktop @development-libs @base-x @admin-tools @legacy-software-development @development-tools @chinese-support @server-cfg @legacy-network-server @legacy-software-support @system-tools @editors @text-internet @graphical-internet @smb-server @ftp-server 二、準備光碟源 [[email protected] ~]#mount -o loop /virhost/soft/rhel-server-5.5-i386-dvd.iso /mnt [[email protected] ~]#cp -a /mnt/* /virhost/soft/rhel5src/ [[email protected] soft]# ls /virhost/soft/rhel5src/ Cluster README-ja.html RELEASE-NOTES-en RELEASE-NOTES-ta.html RELEASE-NOTES-U5-or.html ClusterStorage README-kn.html RELEASE-NOTES-en.html RELEASE-NOTES-te.html RELEASE-NOTES-U5-pa.html EULA README-ko.html RELEASE-NOTES-es.html RELEASE-NOTES-U5-as.html RELEASE-NOTES-U5-pt_BR.html eula.en_US README-ml.html RELEASE-NOTES-fr.html RELEASE-NOTES-U5-bn.html RELEASE-NOTES-U5-ru.html GPL README-mr.html RELEASE-NOTES-gu.html RELEASE-NOTES-U5-de.html RELEASE-NOTES-U5-si.html images README-or.html RELEASE-NOTES-hi.html RELEASE-NOTES-U5-en RELEASE-NOTES-U5-ta.html isolinux README-pa.html RELEASE-NOTES-it.html RELEASE-NOTES-U5-en.html RELEASE-NOTES-U5-te.html README-as.html README-pt_BR.html RELEASE-NOTES-ja.html RELEASE-NOTES-U5-es.html RELEASE-NOTES-U5-zh_CN.html README-bn.html README-ru.html RELEASE-NOTES-kn.html RELEASE-NOTES-U5-fr.html RELEASE-NOTES-U5-zh_TW.html README-de.html README-si.html RELEASE-NOTES-ko.html RELEASE-NOTES-U5-gu.html RELEASE-NOTES-zh_CN.html README-en README-ta.html RELEASE-NOTES-ml.html RELEASE-NOTES-U5-hi.html RELEASE-NOTES-zh_TW.html README-en.html README-te.html RELEASE-NOTES-mr.html RELEASE-NOTES-U5-it.html RPM-GPG-KEY-redhat-beta README-es.html README-zh_CN.html RELEASE-NOTES-or.html RELEASE-NOTES-U5-ja.html RPM-GPG-KEY-redhat-release README-fr.html README-zh_TW.html RELEASE-NOTES-pa.html RELEASE-NOTES-U5-kn.html Server README-gu.html RELEASE-NOTES-as.html RELEASE-NOTES-pt_BR.html RELEASE-NOTES-U5-ko.html TRANS.TBL README-hi.html RELEASE-NOTES-bn.html RELEASE-NOTES-ru.html RELEASE-NOTES-U5-ml.html VT README-it.html RELEASE-NOTES-de.html RELEASE-NOTES-si.html RELEASE-NOTES-U5-mr.html 三、修改啟動載入器設置 [[email protected] rhel5src]# vim /virhost/soft/rhel5src/isolinux/isolinux.cfg #default linux default install

#默認啟動的操作系統代號 prompt 1 #timeout 600 timeout 50 #開啟后等候時間 display boot.msg F1 boot.msg F2 options.msg F3 general.msg F4 param.msg F5 rescue.msg label install #新增操作系統代號,install kernel vmlinuz append ks=cdrom:/ks.cfg initrd=initrd.img #指定自動化的kickstart安裝配置文件,ks.cfg label linux kernel vmlinuz append initrd=initrd.img label text kernel vmlinuz append initrd=initrd.img text label ks kernel vmlinuz append ks initrd=initrd.img label local localboot 1 label memtest86 kernel memtest append - 四、製作安裝光碟 1、製作自動安裝光碟iso文件 [[email protected] rhel5src]# cd /virhost/soft/rhel5src [[email protected] rhel5src]# find -type f -name "TRANS.TBL" | xargs rm -f #刪除各目錄中TRANS.TBL文件 [[email protected] rhel5src]# rm -rf isolinux/boot.cat #刪除isolinux/boot.cat文件 [[email protected] rhel5src]# chmod w isolinux/* #為isolinux下文件添加寫許可權 [[email protected] rhel5src]# mkisofs -o ../myrhel5.5.iso -J -r -v \ #製作iso文件,存儲在上一層目錄 >-b isolinux/isolinux.bin \ #指定安裝光碟的啟動載入器isolinux >-c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table \ >-V "RHEL5.5_X86_32_AutoInstall_DVD" \ #設置光碟的卷標識符 >. #將當前目錄中所有文件加入到安裝光碟中

INFO: ... 99.35% done, estimate finish Fri Jan 13 19:14:56 2012 99.68% done, estimate finish Fri Jan 13 19:14:56 2012 Total translation table size: 2048 Total rockridge attributes bytes: 274480 Total directory bytes: 415744 Path table size(bytes): 188 Done with: The File(s) Block(s) 1519384 Writing: Ending Padblock Start Block 1519762 Done with: Ending Padblock Block(s) 150 Max brk space used 267000 1519912 extents written (2968 MB) #mkisofs選項說明: -o 指定生成鏡像的名字 -b 指定哪個文件為光碟光碟自引導啟動的文件(目錄內以.bin結尾的文件) -c 將boot.cat文件的配置信息顯示出來(目錄內以.cat結尾的文件) -no-emul-boot 不模仿boot這種引導格式(光碟內沒有MBR不能進行boot格式的啟動) [[email protected] rhel5src]# file ../myrhel5.5.iso #查看iso文件的類型和識別碼是否正確 ../myrhel5.5.iso: ISO 9660 CD-ROM filesystem data 'RHEL5.5_X86_32_AutoInstall_DVD ' (bootable) 2、為安裝光碟加上md5驗證碼 [[email protected] rhel5src]# /usr/lib/anaconda-runtime/implantisomd5 --force ../myrhel5.5.iso Inserting md5sum into iso image... md5 = a753af4a7c3fb2e128fe5d73b644d2f9 Inserting fragment md5sums into iso image... fragmd5 = ea4c3e9936bf3fb273d8dffce22edf95924e078e16f398e77c5e5cb6baa1 frags = 20 Setting supported flag to 0 #產生iso文件后,必須為其加上md5驗證碼,否則anacomda可能會認為這不是一個正確的安裝光碟,而無法安裝

本文出自 「netsword.blogchina.com」 博客,請務必保留此出處http://netsword.blog.51cto.com/13993/763186


[火星人 ] linux無人值守安裝光碟製作已經有644次圍觀

http://coctec.com/docs/linux/show-post-46822.html