пятница, 2 октября 2009 г.

Восстановление Grub и Chroot`им раздел для работы с ним грамотно.

Восстанавливаем - поврежденный GRUB.


Загружаемся с live Ubuntu cd.

Запускаем терминал и :



Code:
sudo grub
Видим "grub>" дальнейшее делаем в самом загрузчике (т.е. grub shell). Вводим комманды (должен быть grub>.)


Code:
find /boot/grub/stage1
Это вернет положение необходимое для восстановление работоспособности.
ВАЖНО, используем "место" которое нашли дальше (набираем в grub>. следующие 3 команды)



Code:
root (hd?,?)
Если find вернул (hd0,1) тогда набираем root (hd0,1)

Следующая комманда установит grub в mbr



Code:
setup (hd0)
Выходим из grub shell


Code:
quit
Grub восстановлен.

Chroot

Code:

$


Code:
sudo mkdir /mnt/root
$

Code:
sudo mount -t ext3 /dev/sda6 /mnt/root
Then you have to mount the proc subsystem and udev inside /mnt/root also:
Code:

$

Code:
sudo mount -t proc none /mnt/root/proc
$

Code:
sudo mount -o bind /dev /mnt/root/dev
Doing this allows grub to discover your drives. Next you have to chroot:
Code:

$

Code:
sudo chroot /mnt/root /bin/bash
Now that you're chrooted into your drive as root everything should work.
Code:

#

Code:
sudo grub
I edited in the sudo, just to be safe. When I enter grub and not sudo grub, grub cannot find the file. I do not know if the chroot changes this because I did not try it that way. In the end I figured it was better to err on the side of caution. Tosk I hope you don't mind my editing of your reply.
grub>

Code:
find /boot/grub/stage1
It found mine on (hd0,5)
Code:

grub>

Code:
root (hd0,5)

Code:

grub>


Code:
setup (hd0)
Ok

grub link http://www.gnu.org/software/grub/manual/html_node/Installing-GRUB-natively.html#Installing-GRUB-natively
Если chroot метод не помог - можно попробовать http://ubuntuforums.org/showthread.php?t=24113
(с) http://ubuntuforums.org/showthread.php?t=224351

Комментариев нет: