Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > Your Distro > Redhat / Fedora Linux Help
Reload this Page install MBR with GRUB from Knoppix
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Redhat / Fedora Linux Help Help and discussion related to Redhat and Fedora Linux.

Reply
 
Thread Tools Display Modes
Old 07-20-2006   #1 (permalink)
gunnerjoe
Just Joined!
 
Join Date: Jun 2006
Posts: 7
install MBR with GRUB from Knoppix

Hi All,


Why Knoppix: RHEL 4 does not have mkbootdisk, in the 64 bit distro, also when booting into 'linux rescue' I cannot find the grub command, that is why I'm using Knoppix.

I have a test box that I'm trying to recover. RHEL 4 with 4 SCSI drives.

/dev/sda1 is the /boot # This partition is outside the Raid 5
/dev/sda2 is swap
/dev/sda3 is part of the software raid

The other drives contain swap and software raid partitions.

Software raid 5 is /dev/md0

In my test I'm failing sda3 with mdadm, as if I have lost the whole drive and then booting in with Knoppix to save the day. Next I rebuild the partitions, format the /dev/sda1 and copy the /boot info back to /dev/sda1 from backup copy I have on CD. Next I want to redo the MBR on /dev/sda, this is where I'm getting stuck on grub syntax.

I need to tell grub about the location of /boot which is /dev/sda1, not sure how this is done from a Knoppix boot.

Any Ideas Welcome!

Joe
gunnerjoe is offline   Reply With Quote
Old 07-20-2006   #2 (permalink)
ozar
Super Moderator
 
Join Date: May 2004
Location: Arch Linux
Posts: 8,475
Here are a couple ways of doing it and hopefully one of them will work for you:

Boot with a Knoppix CD (or some other live-cd), or use a rescue/boot floppy like Tomsrtbt ( http://www.toms.net/rb/ ); determine your root partition and mount it to a temporary mount point; then chroot into it; then reinstall GRUB:

sudo mkdir /mnt/temp

sudo mount /dev/hda1 /mnt/temp
(change /dev/hda1 to match your own root partition)

sudo chroot /mnt/temp

sudo grub-install /dev/hda

or...

determine your root partition, then mount it "dev" option enabled with write permissions. If the filesystem isn't mounted you'll need to mount it like this (be sure to change "hda1" and "hda" to match the location/device in your own system):

sudo mount -o dev,rw /mnt/hda1

if it's already mounted, remount it like this:

sudo mount -o remount,dev,rw /mnt/hda1

now restore grub like this:

sudo chroot /mnt/hda1 grub-install /dev/hda

if it doesn't work using chroot, try remounting as outlined above and do:

sudo grub-install -root-directory=/mnt/hda1 /dev/hda
__________________
oz

New Users: * FAQ *

ozar is offline   Reply With Quote
Old 07-21-2006   #3 (permalink)
gunnerjoe
Just Joined!
 
Join Date: Jun 2006
Posts: 7
Hello,

Thanks for the reply. I don't think this will work because the / (root) partition is part of /dev/md0 (raid 5). I can mount the /dev/sda1 which contains /boot .

I'm running this test on RHEL 4 32 bit and I have made a boot disk with mkbootdisk command, using the boot disk you can run grub and get everything back to normal on the new /dev/sda/ disk. But the real server is RHEL 4 64 bit and the mkbootdisk command is not available So trying to recover some other way on the test box without a RHEL 4 boot disk.

When I first started this little test I made a copy of the MBR, I've been trying to re-install the MBR with:

dd if=MBRbackup.bin of=/dev/sda bs=512 count=1

It runs fine, but GRUB does not boot the system.

I don't know, just seems to be little gotchas no matter which way I go.

Thanks,

Joe




Quote:
Originally Posted by ozar
Here are a couple ways of doing it and hopefully one of them will work for you:

Boot with a Knoppix CD (or some other live-cd), or use a rescue/boot floppy like Tomsrtbt ( http://www.toms.net/rb/ ); determine your root partition and mount it to a temporary mount point; then chroot into it; then reinstall GRUB:

sudo mkdir /mnt/temp

sudo mount /dev/hda1 /mnt/temp
(change /dev/hda1 to match your own root partition)

sudo chroot /mnt/temp

sudo grub-install /dev/hda

or...

determine your root partition, then mount it "dev" option enabled with write permissions. If the filesystem isn't mounted you'll need to mount it like this (be sure to change "hda1" and "hda" to match the location/device in your own system):

sudo mount -o dev,rw /mnt/hda1

if it's already mounted, remount it like this:

sudo mount -o remount,dev,rw /mnt/hda1

now restore grub like this:

sudo chroot /mnt/hda1 grub-install /dev/hda

if it doesn't work using chroot, try remounting as outlined above and do:

sudo grub-install -root-directory=/mnt/hda1 /dev/hda
gunnerjoe is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 11:48 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0