每個標籤(LABEL)後面都多了一個1,有些人比較隨便可能可以接受,有些人像我比較追求完美就會覺得有點瑕疵,想要將這個多餘的1去除掉。
可是難道要重新再安裝一次嗎?重新安裝一次就可以解決嗎?答案是不用跟不一定。
以下是我試出來的方法:
首先先找出每個掛載點的硬碟分割名稱
[root@www ~]# df -h
1檔案系統 容量 已用 可用 已用% 掛載點
2/dev/hda5 3.9G 713M 3.0G 19% /
3/dev/hda7 24G 173M 23G 1% /home
4/dev/hda3 3.9G 1.2G 2.5G 33% /usr
5/dev/hda2 3.9G 239M 3.5G 7% /var
6/dev/hda1 99M 17M 78M 18% /boot
7tmpfs 189M 0 189M 0% /dev/shm
我們可以發現 / 對應到/dev/hda5分割區,而 / 在/etc/fstab中的LABEL是/1
利用修改硬碟標籤的指令e2label,我們可以將它們依序修改成我們想要的標籤名稱
e2label /dev/hda5 /
e2label /dev/hda7 /home
e2label /dev/hda3 /usr
e2label /dev/hda2 /var
e2label /dev/hda1 /boot
在重新開機前,記得修改/etc/grub.conf
[root@www ~]# vi /etc/grub.conf
01# grub.conf generated by anaconda
02#
03# Note that you do not have to rerun grub after making changes to this file
04# NOTICE: You have a /boot partition. This means that
05# all kernel and initrd paths are relative to /boot/, eg.
06# root (hd0,0)
07# kernel /vmlinuz-version ro root=/dev/hda5
08# initrd /initrd-version.img
09#boot=/dev/hda
10default=0
11timeout=5
12splashimage=(hd0,0)/grub/splash.xpm.gz
13hiddenmenu
14title CentOS (2.6.18-128.el5)
15 root (hd0,0)
16 kernel /vmlinuz-2.6.18-128.el5 ro root=LABEL=/1
17 initrd /initrd-2.6.18-128.el5.img
將LABEL=/1改為LABEL=/
存檔後,再執行
sync;sync;sync
reboot
這樣子就可以正常開機了
[障礙排除]
如果您忘了修改這個/etc/grub.conf而造成無法正常開機時,可以拿出安裝光碟片的第一片
用光碟開機後,輸入linux rescue
在開機完成後,系統會將目前的root partition掛載到/mnt/sysimage
所以我們可以
cd /mnt/sysimage/etc
vi grub.conf
將LABEL=/1修正為LABEL=/
存檔後再重新開機即可。
沒有留言:
張貼留言