Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> 電腦軟體教學 >> 伺服器技術 >> 伺服器綜合

刀片伺服器硬碟啟動 Linux 獨立安裝實戰(二):GRUB 安裝、核心準備與 AutoYaST 微調

編輯:伺服器綜合

第四步:安裝 GRUB 啟動程式

  1. 掛載第一分區:mount /dev/sdb1 /mnt/sdb
  2. 複製 GRUB 檔案:從 /boot/grub 複製到 /mnt/sdb/boot/grub
  3. 安裝 GRUB 到磁碟 B 第一分區:
    grub-install --root-directory=/mnt/sdb /dev/sdb1 --recheck
    
    輸出裝置映射表確認無誤:(hd0) /dev/sda, (hd1) /dev/sdb。

第五步:準備安裝核心

建立 /mnt/sdb/boot,從 SUSE ISO /boot/i386/loader/ 複製 linux 核心檔與 initrd 到此目錄。

第六步:準備 Linux 安裝鏡像檔

建立 /mnt/sdb/SUSE,**必須將 ISO 內所有檔案解壓複製至此**,不可直接放 ISO 檔(SUSE 10 不支援直接掛載 ISO 安裝)。

第七步:為 SUSE 安裝微調 AutoYaST 配置

使用 YaST 自動安裝產生 autoinst.xml,修改兩處:

a. 新增開機選單項(提供還原入口)

<bootloader>
  <sections config:type="list">
    <section>
      <ramdisk_size>8192</ramdisk_size>
      <install>hd://sda1/SUSE</install>
      <autoyast>file:///mounts/extra/autoinst.xml</autoyast>
      <splash>silent</splash>
      <showopts>1</showopts>
      <initrd>(hd0,0)/boot/initrd</initrd>
      <kernel>(hd0,0)/boot/linux</kernel>
      <lines_cache_id>3</lines_cache_id>
      <name>SUSE Linux Enterprise Server 10 Installation</name>
      <original_name>install</original_name>
      <root>/dev/sda1</root>
      <type>image</type>
    </section>
  </sections>
</bootloader>

⚠️ 選擇此項將**清空磁碟所有資料**並重新安裝。

b. 修改分區區段:禁止建立/格式化第一分區

<partitioning config:type="list">
  <drive>
    <device>/dev/sda</device>
    <partitions config:type="list">
      <partition>
        <create config:type="boolean">false</create>
        <filesystem config:type="symbol">ext3</filesystem>
        <format config:type="boolean">false</format>
        <partition_id config:type="integer">131</partition_id>
        <partition_nr config:type="integer">1</partition_nr>
        <partition_type>primary</partition_type>
        <size>7402719232</size>
      </partition>
      <partition>
        <filesystem config:type="symbol">swap</filesystem>
        <format config:type="boolean">true</format>
        <mount>swap</mount>
        <partition_id config:type="integer">130</partition_id>
        <partition_nr config:type="integer">2</partition_nr>
        <partition_type>primary</partition_type>
        <size>auto</size>
      </partition>
      <partition>
        <filesystem config:type="symbol">reiser</filesystem>
        <format config:type="boolean">true</format>
        <mount>/</mount>
        <partition_id config:type="integer">131</partition_id>
        <partition_nr config:type="integer">3</partition_nr>
        <partition_type>primary</partition_type>
        <size>max</size>
        <use>all</use>
      </partition>
    </partitions>
  </drive>
</partitioning>

**核心邏輯**:使用整顆磁碟,但**第一分區(安裝分區)不建立、不格式化**,保留安裝介質與 GRUB。

Copyright © Windows教程網 All Rights Reserved