8.此時(shí),您需要將 initrd 文件系統(tǒng)重新壓縮到一個(gè)映像中,并替換 /boot 目錄下的原有映像。
a.對(duì)于 Red Hat Enterprise Linux 第 3 版之前的版本和 SUSE Linux Enterprise Server 第 9 版之前的版本: [root@linuxhost ~]#umount temp
[root@linuxhost ~]#gzip initrd
[root@linuxhost ~]#cp initrd.gz /boot/initrd-2.x.x-x.img
b.對(duì)于 Red Hat Enterprise Linux 第 4 版和更高版本或者 SUSE Linux Enterprise Server 第 10 版和更高版本: [root@linuxhost ~]#find ./ | cpio -H newc -o > ../initrd
[root@linuxhost ~]#gzip initrd
[root@linuxhost ~]#cp initrd.gz /boot/initrd-2.6.x-x.img
9.祝賀您!您已經(jīng)修正了問題,F(xiàn)在重新啟動(dòng)并檢查結(jié)果。
4. 使用標(biāo)簽、UUID 或友好的名稱
某些 Linux 文件系統(tǒng)類型(如 ext2、ext3、reiserfs、swap 和 XFS)支持裝入帶有標(biāo)簽的文件系統(tǒng)而不是帶有設(shè)備名稱的文件系統(tǒng),如果您的 Linux 系統(tǒng)支持,則可以轉(zhuǎn)而使用 UUID。此外,如果您的設(shè)備驅(qū)動(dòng)程序支持,則可以使用友好的名稱。
這些方法需要 Linux 系統(tǒng)支持這些功能(如 Red Hat Enterprise Linux V4 和更高版本或者 SUSE Linux Enterprise Server V9 和更高版本)。由于標(biāo)簽、UUID 和友好的名稱將永遠(yuǎn)與專用設(shè)備綁定在一起,因此不管擁有什么設(shè)備 ID 或者使用什么設(shè)備名稱,系統(tǒng)總是能夠找到根文件系統(tǒng)磁盤。
使用標(biāo)簽
1.在創(chuàng)建諸如 root、swap 之類的文件系統(tǒng)或其他文件系統(tǒng)時(shí),創(chuàng)建一個(gè)標(biāo)簽。 [root@linuxhost ~]#mkfs.ext3 -L ROOT /dev/sda1
[root@linuxhost ~]#mkfs.reiserfs -l OSROOT /dev/sdb2
[root@linuxhost ~]#mkfs.xfs -L XFSROOT /dev/sde3
[root@linuxhost ~]#mkswap -L SWAP0 /dev/sdb5
2.在創(chuàng)建文件系統(tǒng)后給它添加一個(gè)標(biāo)簽。 [root@linuxhost ~]#e2label /dev/sda1 PRIMARY_ROOT
[root@linuxhost ~]#reiserfstune -l OSROOT /dev/sdb2
[root@linuxhost ~]#xfs_admin -L DATA1 /dev/sdf4
3.在系統(tǒng)中使用標(biāo)簽。
a.編輯 Linux 系統(tǒng)的 /etc/fstab,這樣系統(tǒng)將使用標(biāo)簽而非設(shè)備名稱來裝入文件系統(tǒng)。下面是 /etc/fstab 內(nèi)容的簡(jiǎn)單示例: LABEL=ROOT / ext3 defaults 1 1
LABEL=BOOT /boot ext3 defaults 1 2
LABEL=SWAP swap swap defaults 0 0
LABEL=HOME /home ext3 nosuid,auto 1 2
b.編輯 Linux 引導(dǎo)加載程序的 grub.conf。 title Linux
root (hd0,0)
kernel (hd0,0)/vmlinuz ro root=LABEL=ROOT rhgb quiet
initrd (hd0,0)/initrd-2.x.x-xx.img
使用 UUID
1.獲得根設(shè)備的 UUID。讓我們假定以下示例中的根文件系統(tǒng)位于 /dev/sda 磁盤設(shè)備中: [root@linuxhost ~]#scsi_id -g -s -u /block/sda
2.使用以下命令檢查帶有從第 1 步中得到的設(shè)備 UUID 的根文件系統(tǒng)設(shè)備的 ID。 [root@linuxhost ~]#ls /dev/disk/by-id/
3.在本例中,通過編輯 /etc/fstab 以在系統(tǒng)中使用 UUID: /dev/disk/by-id/scsi--part2 / ext3 defaults 1 1
使用友好的設(shè)備名稱
如果將設(shè)備映射程序多路徑(DMMP)工具用于多路徑存儲(chǔ),則可以將友好的名稱用于根文件系統(tǒng)以避免設(shè)備在重新啟動(dòng)后被 DMMP 重新編號(hào)。
1.獲得根設(shè)備的 UUID。讓我們假定根文件系統(tǒng)位于 /dev/sda 磁盤設(shè)備中。 [root@linuxhost ~]#scsi_id -g -s -u /block/sda
2.編輯 /etc/multipath.conf 以添加根文件系統(tǒng)設(shè)備的友好名稱,如下所示: multipaths {
multipath {
wwid
alias OSROOT
}
}
3.然后,在重新引導(dǎo)系統(tǒng)或重新載入 DMMP 后,根文件系統(tǒng)設(shè)備將擁有諸如 /dev/mapper/OSROOT 之類的設(shè)備名稱(如果根文件系統(tǒng)使用的是此磁盤的分區(qū) 3,則將擁有 /dev/mapper/OSROOT-part3 或 /dev/mapper/OSROOTp3 設(shè)備名稱)。
本新聞共
5頁,當(dāng)前在第
4頁
1 2 3 4 5