[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Перенос GRUB



Anton Kovalenko пишет:
At Fri, 12 Mar 2010 13:41:06 +0200,
Игорь Чумак wrote:
Сделал симлинк.

grub-install --root-directory=. /dev/mapper/3600a0b800013d01700000ee24b97e7ad grub-probe: error: no mapping exists for `3600a0b800013d01700000ee24b97e7ad-part1'
/usr/sbin/grub-install: line 374: [: =: unary operator expected
The file ./boot/grub/stage1 not read correctly.

А, у вас kpartx. Надо, чтобы груб одновременно понимал, куда отображается (hd0),
и мог найти его разделы.

mkdir /root/tmpdev
ln -s /dev/mapper/3600a0b800013d01700000ee24b97e7ad /root/tmpdev/3600a0b800013d01700000ee24b97e7ad-part
ln -s /dev/mapper/3600a0b800013d01700000ee24b97e7ad-part* /root/tmpdev
echo '(hd0) /root/tmpdev/3600a0b800013d01700000ee24b97e7ad-part' > /root/tmp/boot/grub/device.map



А вот и нет ;)
Как оказалось , есть волшебная команда null (http://jbakshi.50webs.com/Linux_tutorial/GRUB/GNU%20GRUB%20simplified.html), которая подсказала, что нужный раздел - (hd5)

Сделал так:
Создал файлик tmp/NEW (метка, чтобы отличить новый раздел от старого)
Смонтировал /dev/mapper/3600a0b800013d01700000ee24b97e7ad-part1 в /boot (чтобы не заморачиваться с симлинками)

grub> root (hd5,0)
Filesystem type is ext2fs, partition type 0x83

grub> find /N<TAB>
появилось find /NEW - значит root правильный
(hd5,0)

grub> setup (hd5)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd5)"...  17 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd5) (hd5)1+17 p (hd5,0)/grub/stage2 /grub/menu.lst"... succeeded
Done.

Вроде все правильно.
Отмонтировал /boot, примонтировал его в tmp

gate:~# diff -r tmp /boot/
Binary files tmp/grub/stage2 and /boot/grub/stage2 differ
Only in /boot/grub: xfs_stage1_5
Only in tmp: lost+found
Only in tmp: NEW

Правда удивило, что stage2 разные.. Но скорее всего потому, что старый /boot - каталог, а новый - точка монтирования.
Перезагрузка покажет ;)




Reply to: