close

IF your  /  root partition and /usr partition are not at the same disk partition ??

How to rescue grub under Debian lirnux ? 

 

1. boot from an Debian CD

2. start rescue mode , after setting  network and clock ,  ALT+F2 enter a Terminal shell

   若在 安裝網路之前,則 fdisk 不動作

3. fdisk -l ,  find the root partition,  such as   /dev/sda2

    要了解 partition 內容可以 再 mount 之後進入看其內容來判斷之

4. # mkdir  myroot ,

    # mount /dev/sda2  /myroot,

5. # mount -o bind /proc  /myroot/proc

     proc 再 chroot 之後可以 看 partition

    #mount -o bind /dev  /myroot/dev

    #mount -o bind /sys  /myroot/dev

6. # chroot /myroot

       change root to /myroot

7.  # fdisk -l ,  find  the /usr partition , such as  /dev/sda7

    #mount  /dev/sda7  /usr ,   since grub-install is at /usr/sbin.

 

8. #update-grub ,      a new grub.cfg is as /boot/grub/

    copy origin grub.cfg to /boot/grub

    #cp  /usr/lib/grub/grub.cfg   /boot/grub/.

 

9. #grub-install  /dev/sda

 

10 . reboot.

 

 

 

 

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 Jasonubt 的頭像
    Jasonubt

    Jason work on unbuntu and debian

    Jasonubt 發表在 痞客邦 留言(0) 人氣()