You are not logged in.

#1 2008-08-28 17:11:19

tehyosh
Member
Registered: 2008-08-28
Posts: 6

I screwed up GRUB and /boot

I have Arch on my laptop but I needed to install Windows XP also. Because of my lack of attention I deleted the boot partition so I had to remake it. After installing Windows I thought I just have to reinstall grub and everything will be A-OK. I was wrong.

I tried doing what the wiki says about reinstalling GRUB but there is one thing I cannot do:

If on the other hand it's on a separate partition (for example, /dev/sda2), then you need to mount that partition now to /boot so that grub can find the files it needs:

My boot partition is now empty. GRUB can't get 'the files it needs' from there. What can I do to fix this and be able to boot in Arch?
I tried installing GRUB from Arch LiveCD but I get this error:

Filesystem type unknown, partition type 0x7
setup (hd0)

Error 14: Cannot mount selected partition

My current partitions are:
/dev/sda1 - windows - ntfs
/dev/sda2 - / - ext3
/dev/sda3 - /home - ext3
/dev/sda4 - boot - ext3

edit:
I tried doing this but still didn't work:
grub> find /boot/grub/stage1  // it outputed (hd0,1)
grub> root (hd0,1)
grub> setup (hd0)
then reboot. Nothing.

edit2:
I tried reinstalling grub and kernel26 with pacman via live cd. still didn't work sad

Last edited by tehyosh (2008-08-28 22:56:58)

Offline

#2 2008-08-28 23:13:36

IMG
Member
From: Greece
Registered: 2008-02-22
Posts: 21

Re: I screwed up GRUB and /boot

what was the output of grub> root and grub> setup?

should look like this

grub> find /boot/grub/stage1
 (hd0,0)

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

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

Also happens when you power on?

Offline

#3 2008-08-28 23:34:29

tehyosh
Member
Registered: 2008-08-28
Posts: 6

Re: I screwed up GRUB and /boot

Ext3:

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

NTFS:

grub> root (hd0,0)
 Filesystem type is unknown, partition type 0x7
grub> setup (hd0,0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0,0)"... failed (this is not fatal)
 Running "embed /boot/grub/e2fs_stage1_5 (hd0,1)"... failed (this is not fatal)
 Running "install /boot/grub/stage1 (hd0,0) /boot/grub/stage2 p /boot/grub/menu.lst " ... succeeded
Done.
grub> setup (hd0,1)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0,1)"... failed (this is not fatal)
 Running "embed /boot/grub/e2fs_stage1_5 (hd0,1)"... failed (this is not fatal)
 Running "install /boot/grub/stage1 (hd0,1) /boot/grub/stage2 p /boot/grub/menu.lst " ... succeeded
Done.

After I reinstalled grub and kernel26 I got this error when trying to run grub:

grub: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

When I powered on (before reinstalling) it sent me to a grub command line.

After trying so much to fix this I'm thinking of just backing up my /home and making a clean Arch install neutral
I also may have broken stuff more than before while trying different methods to fix it neutral

Last edited by tehyosh (2008-08-29 13:10:55)

Offline

#4 2008-08-29 03:21:44

ladislaio
Member
From: Greenville, Pennsylvania
Registered: 2007-09-22
Posts: 14

Re: I screwed up GRUB and /boot

I am an advocate of re-installing to fix problems like this smile

I think your problem could be that you ran the 'grub> setup' on the wrong partition.  Hopefully nothing bad happened to Windows, which is what was on the partition you setup grub on.
Try instead

grub> setup (hd0,1)

mmm... Linux...

Offline

#5 2008-08-29 06:45:20

IMG
Member
From: Greece
Registered: 2008-02-22
Posts: 21

Re: I screwed up GRUB and /boot

well , just in case you didnt reinstall already:

grub should be set up to work with your boot partition. So with the info you provide seemslike thats your (hda1,3) (disk 1 , partition 4) is the boot partition. When you try it  does the  output  look like the succesful one i quoted above. However since you tried getting grub on hd0,0 , which is the partition your NTLOADER is located, probably you wont be able to boot windows , and maybe get on a grub->grub->grub loop even if you sometime setup correctly your grub stage 2.(i did this myself back when my adventure started, funny disastrous stories wink ).

Just some info: your MBR should points to your boot partition, where the os loader is indexed by the first few sectors of that specific partition.
So when you power on, typically your MBR is examined, and your booting system knows to which partition first sectors it should look for an inxdex to OS loader. Then it reads those sectors to find the OS loader (such as the grub stage 2 you use in linux, or ntloader you use on windows XP  etc) and thats the way it boots.

So in general one way to dual boot XP/linux is to
1) install windows lets say in partition 1
2) install linux boot in partition 2
3) install grub in partition 2 in this case (it will correct MBR anyway)
4) then you uncomment the windows entry at your /boot/grub/menu.lst , and set the correct path to your windows partition, so that grub knows where to look for the loader of windows, the ntloader smile

This stuff is great, i learnt so much when i got my turn ruining my windows installation !

IMG

Last edited by IMG (2008-08-29 06:47:29)

Offline

#6 2008-08-29 13:23:35

tehyosh
Member
Registered: 2008-08-28
Posts: 6

Re: I screwed up GRUB and /boot

Tried both of what you guys said. Same messages.

Regarding (hda1,3) it said that the disk doesn't exist. Same for (hd1,2)

I backed up /home and gonna reinstall tomorrow morning. I wanna be sure everything is installed and working properly, that it's not just a patchwork that might break at the first system update.

Thanks for your time and help.

Last edited by tehyosh (2008-08-29 14:09:21)

Offline

#7 2008-08-29 17:48:28

Onwards
Member
From: Pakistan
Registered: 2007-04-18
Posts: 108

Re: I screwed up GRUB and /boot

Do copy your /var/cache/pacman/pkg/* packages alongwith /home as well. this way you don't 've to redownload all those pkgs again !!

Offline

#8 2008-08-29 20:10:22

nick
Member
From: Canada
Registered: 2008-08-22
Posts: 21

Re: I screwed up GRUB and /boot

tehyosh wrote:

Tried both of what you guys said. Same messages.

Regarding (hda1,3) it said that the disk doesn't exist. Same for (hd1,2)

I backed up /home and gonna reinstall tomorrow morning. I wanna be sure everything is installed and working properly, that it's not just a patchwork that might break at the first system update.

Thanks for your time and help.

hda wouldn't work if you have SCSI/SATA drives, as your original post indicates.  So the proper syntax would be sdx instead of hdx, "x" in this case being the drive letter.  Or is that a typo, and do you mean (hd1,3)?  In that case you should disregard my post.  lol

Offline

#9 2008-08-30 00:17:05

tehyosh
Member
Registered: 2008-08-28
Posts: 6

Re: I screwed up GRUB and /boot

Onwards wrote:

Do copy your /var/cache/pacman/pkg/* packages alongwith /home as well. this way you don't 've to redownload all those pkgs again !!

great idea. thanks! big_smile


nick wrote:

hda wouldn't work if you have SCSI/SATA drives, as your original post indicates.  So the proper syntax would be sdx instead of hdx, "x" in this case being the drive letter.  Or is that a typo, and do you mean (hd1,3)?  In that case you should disregard my post.

I tried a lot of combinations with hd/sd and none worked. Didn't feel the need to list every combination that failed big_smile

Offline

Board footer

Powered by FluxBB