You are not logged in.

#1 2009-04-01 11:10:49

Oskar
Member
Registered: 2009-04-01
Posts: 4

So I went and screwed up my GRUB...

Hi everyone!

So, here's the deal: I have a nice little Asus EEE PC, which I run Linux on. I have three partitions on it, one partition for my /home folder, and two partitions for operating systems, Arch Linux and Ubuntu EEE (now called Easy Peasy I believe). I used to run Ubuntu EEE because I had previous experience with Ubuntu, but I was really curious to try Arch, heard a lot of nice things about it. I installed it about a month ago and I really like it, so I decided to remove Ubuntu (it's a rather small harddrive, and it was taking up to many GB).

Ubuntu was installed on sda1, /home was sda2 and Arch was on sda3. I figured that it'd be a good idea not to screw up that device order, so I started up GParted Live and I simply formatted sda1 and then resized it to take up only about 100 megabytes and moved around and resized the other two partitions to take up the rest of the space.

Here's the stupid part that I didn't think of before taking this rash action: since my computer originally had Ubuntu on it, all the GRUB files that I used for booting was on it, and now they're gone, and I'm not quite sure what the smoothest way to fix it is. I Googled around some, but it seems that most guides seem to assume that the MBR got screwed up somehow, but the GRUB files (stage1 and menu.lst for instance) are intact. But that's not my problem. GRUB is looking for files that are now gone, and so my computer can't boot.

What's the smoothest way to fix this? I have a Ubuntu live USB lying around here somewhere, so I'm thinking I'll just boot from that and run the grub installer, but I'm not sure exactly what to do.

Can anyone help a poor newbie?

Offline

#2 2009-04-01 11:49:27

Surgat_
Member
Registered: 2007-08-08
Posts: 317

Re: So I went and screwed up my GRUB...

Do you get a GRUB prompt? If so, you can boot Arch and reinstall grub from there. If / on the third partition and you don't have a separate /boot (that's what I've understood), I think you'd have to type:

root (hd0,2)
kernel /boot/vmlinuz26 root=/dev/sda3 ro
initrd /boot/kernel26.img

I don't know if the root= parameter is needed in the kernel line. Of course, if I'm wrong, please correct me.
Cheers!

Last edited by Surgat_ (2009-04-01 11:50:03)

Offline

#3 2009-04-01 11:55:51

Oskar
Member
Registered: 2009-04-01
Posts: 4

Re: So I went and screwed up my GRUB...

Surgat_ wrote:

Do you get a GRUB prompt?

I don't, no. It just says "GRUB Loading, please wait" and then "Error 15" and nothing happens

EDIT: It also says "GRUB Loading stage 1.5" at the top

Last edited by Oskar (2009-04-01 12:00:57)

Offline

#4 2009-04-01 13:06:22

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: So I went and screwed up my GRUB...

So obviously - you are missing some grub files - those that are usually found in /boot/grub.
If you can boot from another usb (I believe you have Ubuntu on one), then you can copy the /boot/grub-files from the usb to /dev/sda3/boot/grub and then ... assuming your original drive is now 'sdb' and not 'sda'... do:
grub
root (hd1)
setup (hd1,2)
quit

Then you have to edit the /dev/sda3/boot/grub/menu.lst file (now /dev/sdb3/boot/grub/menu.lst) as indicated above by Surgat

Offline

#5 2009-04-01 13:10:54

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: So I went and screwed up my GRUB...

Grub error codes and the wiki™

Last edited by Mr.Elendig (2009-04-01 13:12:03)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#6 2009-04-01 13:49:05

Oskar
Member
Registered: 2009-04-01
Posts: 4

Re: So I went and screwed up my GRUB...

perbh wrote:

So obviously - you are missing some grub files - those that are usually found in /boot/grub.
If you can boot from another usb (I believe you have Ubuntu on one), then you can copy the /boot/grub-files from the usb to /dev/sda3/boot/grub and then ... assuming your original drive is now 'sdb' and not 'sda'... do:
grub
root (hd1)
setup (hd1,2)
quit

Then you have to edit the /dev/sda3/boot/grub/menu.lst file (now /dev/sdb3/boot/grub/menu.lst) as indicated above by Surgat

When I booted Ubuntu Live, the hard-drive stayed as sda (I checked in GParted to be sure), so I used (hd0) and (hd0,2) instead (that's the correct designations for sda and sda3, right?), but it didn't work. I started grub, typed in "root (hd0)" (which worked fine), but when I typed "setup (hd0,2)" I got the result "Error 17: Cannot mount selected partition". I don't know exactly what that means, as when I tried mounting it as a filesystem it went just fine.

Offline

#7 2009-04-01 15:29:34

Oskar
Member
Registered: 2009-04-01
Posts: 4

Re: So I went and screwed up my GRUB...

Ahh, not to worry, I got it working again! It took some fiddling with the grub CLI and some copying over of different stages and things, but it's working now, I'm typing this very message from my Arch installation.

Thanks everyone!

Offline

#8 2009-04-01 15:46:52

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: So I went and screwed up my GRUB...

Please mark it 'solved'

Offline

#9 2009-04-01 16:21:44

thisperishedmin
Member
Registered: 2008-11-04
Posts: 164

Re: So I went and screwed up my GRUB...

Oskar wrote:

Ahh, not to worry, I got it working again! It took some fiddling with the grub CLI and some copying over of different stages and things, but it's working now, I'm typing this very message from my Arch installation.

Thanks everyone!

grub fixing is always one of the most traumatic and frustrating experiences in getting a hang of your system...but its never that hard. just very frustrating haha.

glad you got it fixed!

Offline

Board footer

Powered by FluxBB