You are not logged in.

#1 2006-04-19 17:03:51

Haiyadragon
Member
Registered: 2006-03-21
Posts: 56

Restore grub

I'm trying to restore Grub after a Windows reinstall. I didn't give it a second thought 'cause I remember restoring Grub and Lilo to the MBR lots of times.

In slack I just chrooted the disk and grub-install /dev/hda would do the trick. But it didn't work this time, with Arch.

I tried the Slackware install disk, mounting the partition and mount --bind the /dev and /proc dirs to the mounted part (don't remember ever doing that before but ok). Chrooting and finally grub-install /dev/hda (or hd0,1) but it tells me the discs don't have a BIOS whatever. Adding --recheck to grub-install doesn't work, it takes forever (I let it go for about 5 minutes).

So I figure it's Arch's weird device scheme /dev/discs/di*. But the Arch install disc doesn't seem to be able to mount --bind (invalid option or something). I also can't boot to the partition, either the kernel doesn't support reiserfs or the procedure is broken. Sorry I can't be more specific but I'm not rebooting from this crappy OS untill I know the answer.

Thanks in advance for any help you can give me.

Offline

#2 2006-04-19 17:17:29

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: Restore grub

Haiyadragon wrote:

So I figure it's Arch's weird device scheme /dev/discs/di*.

That's devfs file system. I assume you're using the 0.7 install disc. From 0.7.1 udev is used on the install cd.

My normal way of reinstalling grub is:

- boot the install cd with normal parameters (like when you're going to do an install
- mount your devices to /mnt
- start the installer --> /arch/setup
- choose to install grub, it reads the menu.lst from your mounted partition
- install grub and end the installation
- reboot into your archlinux

Offline

#3 2006-04-19 17:19:12

McQueen
Member
From: Arizona
Registered: 2006-03-20
Posts: 382

Re: Restore grub

Haiyadragon wrote:

Chrooting and finally grub-install /dev/hda (or hd0,1) but it tells me the discs don't have a BIOS whatever. Adding --recheck to grub-install doesn't work, it takes forever (I let it go for about 5 minutes).

This should work better:

# install-grub /dev/hda

If that fails you can always do it this way:

# grub
grub> root (hd0,1) --> your root partition
grub> setup (hd0)  --> the MBR
grub> quit

/path/to/Truth

Offline

#4 2006-04-19 19:05:24

Haiyadragon
Member
Registered: 2006-03-21
Posts: 56

Re: Restore grub

pressh wrote:
Haiyadragon wrote:

So I figure it's Arch's weird device scheme /dev/discs/di*.

That's devfs file system. I assume you're using the 0.7 install disc. From 0.7.1 udev is used on the install cd.

My normal way of reinstalling grub is:

- boot the install cd with normal parameters (like when you're going to do an install
- mount your devices to /mnt
- start the installer --> /arch/setup
- choose to install grub, it reads the menu.lst from your mounted partition
- install grub and end the installation
- reboot into your archlinux

You were right. I was using 0.7. Using Noodle and install_grub it was done in no time. Thanks guys.

But mount --bind still didn't work. I had to use the mount binary from the partition smile Any idea why? I didn't try the /arch/setup method (because the other one worked).

Offline

#5 2006-04-19 21:28:40

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: Restore grub

I believe the correct way for that should be

mount -o bind /dev/ mnt/dev

That should work I guess

Offline

#6 2006-04-19 22:37:36

Haiyadragon
Member
Registered: 2006-03-21
Posts: 56

Re: Restore grub

pressh wrote:

I believe the correct way for that should be

mount -o bind /dev/ mnt/dev

That should work I guess

Nice

Offline

#7 2006-11-08 01:58:10

nbcjr
Member
From: BRAZIL!
Registered: 2004-12-04
Posts: 79

Re: Restore grub

i'm trying to restore linux. my hd is hda. i get this:

kurumin@kurumin:/ramdisk/home/kurumin$ sudo chroot /mnt/hda2/
^[[Abash-3.1# install-grub /dev/hda
Install Device:         (hd0)           /dev/hda
Boot Device:            (hd0,1)         /dev/hda2

Continue? [Y/n] Y
Probing devices to guess BIOS drives. This may take a long time.


    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]
grub> root (hd0,1)

Error 21: Selected disk does not exist
grub> setup (hd0)

Error 12: Invalid device requested
grub> quit
/sbin/install-grub: line 138: /dev/null: Permissão negada

Grub installation finished.

bash-3.1#

Offline

#8 2006-11-08 06:21:35

McQueen
Member
From: Arizona
Registered: 2006-03-20
Posts: 382

Re: Restore grub

nbcjr wrote:

i'm trying to restore linux. my hd is hda. i get this:

Error 21: Selected disk does not exist
grub> setup (hd0)

After this topic came up initially I tested the preferred method of restoring grub on my box using a chroot session just as you did, and received the same error message that you have posted. Since that time I've tried it on several other occasions and always got the identical error. But if I simply booted into Arch and used the install-grub command it completed the process as expected.

In short, to date I've never been able to restore grub on my Arch system using chroot. I've tried it from another Linux partition on my disk, from a liveCD and from the Arch InstallCD. I will say that I'm using the grub-gfx package and not the default grub version that comes with Arch.


/path/to/Truth

Offline

#9 2006-11-08 07:45:41

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,750

Re: Restore grub

just a thought I can run lilo under chroot as shown in wiki ... would that work for grub...?


Mr Green

Offline

#10 2006-11-08 08:58:00

gradgrind
Member
From: Germany
Registered: 2005-10-06
Posts: 921

Re: Restore grub

Firstly, note that grub-install and install-grub are different scripts!

I have had some success using something along the lines of the following:

#!/bin/sh

# Install grub to MBR
# INSTALL is where your Arch system is mounted
# DEVICE can be /dev/hda or (hd0) style

# If you have a separate boot partition that must also be
# mounted correctly!

# e.g. for Arch on /dev/hda2
DEVICE=/dev/hda
INSTALL=/mnt/install
mount ${DEVICE}2 ${INSTALL}
#

mount --bind /proc ${INSTALL}/proc
mount --bind /sys ${INSTALL}/sys
mount --bind /dev ${INSTALL}/dev
cat /proc/mounts | grep ${INSTALL} | sed "s|${INSTALL}|/|" | 
    sed "s|//|/|" >${INSTALL}/etc/mtab
chroot ${INSTALL} /sbin/grub-install --no-floppy ${DEVICE}
: >${INSTALL}/etc/mtab
umount ${INSTALL}/dev
umount ${INSTALL}/sys
umount ${INSTALL}/proc

umount ${INSTALL}

Offline

#11 2013-01-21 17:37:40

pathanck
Member
Registered: 2012-07-30
Posts: 2

Re: Restore grub

The simplest solution I found is to start your system using the Super Grub CD (which can detect grub.cfg) and then in your system execute:
# grub-mkconfig -o /boot/grub/grub.cfg
which restored my previous Grub configuration.

Offline

#12 2013-01-21 18:26:01

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Restore grub

Old 2006 post is old.

GRUB Legacy support has been dropped from Arch Linux since last year: https://www.archlinux.org/news/grub-leg … -supported


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#13 2013-01-21 18:48:51

fsckd
Forum Moderator
Registered: 2009-06-15
Posts: 3,514

Re: Restore grub

This topic is about grub-legacy (back then it was simply grub). This is why we frown upon bumping old threads. Closing.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

Board footer

Powered by FluxBB