標籤:grub.con text mkisofs shell centos oar grub kickstart rom
1、簡述linux作業系統啟動流程
POST-->BIOS-->bootloader(MBR)-->kernel(ramdisk)-->rootfs(switch root)-->/sbin/init加電自檢啟動bios讀取mbr引導載入核心(ramdisk)根切換執行/sbin/init檔案執行/etc/rc.d/目錄下所有S開頭的服務
2、簡述grub啟動引導程式配置及命令列介面詳解
stage1:安裝在mbrstage1_5:存放在mbr之後的扇區stage2:存放在基本磁碟分區(/boot/grub) [[email protected] grub]# ls -l /boot/grub/grub.conf -rw-------. 1 root root 745 9月 27 03:02 /boot/grub/grub.conf
[[email protected] grub]# cat grub.conf
#boot=/dev/sdadefault=0timeout=5splashimage=(hd0,0)/grub/splash.xpm.gzhiddenmenutitle CentOS 6 (2.6.32-754.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-754.el6.x86_64 ro root=UUID=810dbdfe-b59d-4dff-8534-0b64dd6abd67 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=128M LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet initrd /initramfs-2.6.32-754.el6.x86_64.img default=0:設定預設啟動的菜單。title編號從0開始 timeout=5:啟動中出現功能表項目,等待的時間長度(秒) splashimage=(hd0,0)/grub/splash.xpm.gz:菜單背景圖片 title CentOS 6 (2.6.32-754.el6.x86_64) :菜單的標題 root (hd0,0):grub所在的分區(hd0表示一個硬碟,後面的那個0表示第一個分組) kernel /vmlinuz-2.6.32-754.el6.x86_64 ro root=UUID=810dbdfe-b59d-4dff-8534-0b64dd6abd67 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=128M LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet :指定驅動的核心和參數 initrd /initramfs-2.6.32-754.el6.x86_64.img:指定initrd檔案。
按c進入命令列模式,按e編輯 核心參數。
grub命令列模式啟動系統
grub> root (hd0,0)grub>kernel /vmlinuz-2.6.32-754.el6.x86_64 ro root=UUID=810dbdfe-b59d-4dff-8534-0b64dd6abd67grub>initrd /initramfs-2.6.32-754.el6.x86_64.imggrub>boot
3、實現kickstart檔案製作與光碟片鏡像製作
(1)準備工作目錄[[email protected] ~]# mkdir myboot(2)掛載光碟片[[email protected] ~]# mount -r /dev/cdrom /media/cdrom/(3)複製isolinux到myboot目錄[[email protected] ~]# cp -r /media/cdrom/isolinux/ /root/myboot/(4)編輯ks.conf檔案安裝system-config-kickstart[[email protected] ~]# yum install system-config-kickstart[[email protected] ~]# system-config-kickstart注意:使用xshell的,需要設定可以開啟root目錄下的anaconda-ks.cfg檔案編輯完成,儲存至/root/myboot/目錄下建立光碟片鏡像:[[email protected] ~]# mkisofs -R -J -T -v --no-emul-boot --boot-load-size 4 --boot-info-table -V "CentOS 6 x86_64 boot" -c isolinux/boot.cat -b isolinux/isolinux.bin -o /root/boot.iso myboot/
開機啟動及grub基礎知識和光碟片鏡像製作