開機啟動及grub基礎知識和光碟片鏡像製作

來源:互聯網
上載者:User

標籤: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的,需要設定![](http://i2.51cto.com/images/blog/201810/17/19ad4b1bc2b2a9a6f04b2c3086fc4406.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)可以開啟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基礎知識和光碟片鏡像製作

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.