• grub rescue>, Arch Linux, and an erased System Reserved partition (Need some advice)
    9 replies, posted
I find myself in an odd situation. My laptop hard drive is 320GB in size, and Windows 7 was installed first, and given the majority of the space on the disk. I wanted a Linux partition to work in, so I allocated the last 10GB as unpartitioned space, and installed Ubuntu. Last night I decided I wanted to install Arch Linux over my existing Ubuntu 10.04 install. First things first, I go into Windows and delete 10GB partition with disk manager, realizing this would fuck up GRUB, but I thought I could get it working easily enough after installing Arch, and everything would be fine. I continue to install Arch, add a 100MB boot primary partition, then the 8.5GB root parition, and the rest swap space. It installs fine, but when I get to the part where I am supposed to install GRUB, I choose to install to the /boot partition I had made, obviously. Computer restarts and I am greeted with an "error....grub rescue> " message. I hard shutdown and install Arch again, going through all the steps to get to install bootloader. I thought that the previous grub install must've been to the first partition on the disk, /dev/sda1, the system reserved partition for Windows 7, because that's where the system would first read it. I install it again, this time on system reserved. I reboot and get the same "grub rescue> " error. Figuring I needed a GUI disk partitioner to really see what is the matter, I boot into my Ubuntu live cd and use Gparted. It list /dev/sda1 as corrupted, which now makes sense to me. I boot up my Windows 7 cd next, and try to use the startup repair. No dice, same error. I follow a guide online and delete the partition entirely because it was corrupted, and supposedly windows could reinstall it. I use system repair again and again, it always claiming to have fixed the problem, but on reboot the error persists. I did mark /dev/sda2, the the large Windows partition, as active in Cmd prompt one time, and it did recognize it when I clicked "repair your computer" when the disk loads. But I don't see the point of that. Right before I left for work, I marked the /boot partition as the active partition in cmd prompt and shut down. I don't know if that will work 100%, but the last time I checked it had grub installed to it. I'm not sure if my system is FUBAR or not, all the important data is intact, but I have no way to boot into any OS. I remember trying "Boot into Other OS" option on the Arch disc, but it didn't work at the time. That might be another option to try as well. I know if I can boot into Windows, I can manually install the bootloader. Anyway, what's the easiest/best option availible to me at the moment to fix this? Do I have to reinstall Windows again? The goals are to either get the Windows bootloader working again first, so I can install GRUB after and know it will work, or just get GRUB working correctly first, then I won't have to fiddle with anything else.
pop in your windows disk, do a recovery console and fixmbr that shit
You have to install GRUB on the disk itself (AKA MBR) when you install it on the /boot partition it will live there and only be loaded when an existing bootloader loads it. The GRUB that's currently on the MBR is the one your Ubuntu installation put on there. The problem is that GURB on the MBR simply looks for a /boot in the wrong place (where it was originally in ubuntu). What you can simply do is reinstall arch and install GRUB on the MBR. Another thing you can do is using a live CD of Arch or something and Manually install GRUB on the MBR. You can also use grup rescue> and fix it yourself. You'll first need to load grub properly (get the right modules from /boot. Once you do that's you'll have a grub> prompt that will allow you do change stuff around. You'll then make GRUB look for it's root in the right location. This will also allow you to boot into an OS. making the change permanent requires something else. It's been a while since I did this and I don't remember fully. After reading your story for a second time I think the best way to fix your problem is to simply reinstall arch or some other distro and make GRUB install itself on the MBR. It will autoconfigure and point to the right stuff. You can also screw around with the grub rescue and fix grub. The GRUB shell is complicated and not very intuitive. I'll try to look for some detailed instructions on how to do this and will post them in this thread.
Wow, thanks for taking the time out to help me, I really appreciate it. I was dreading I might have to copy over my a few hundred GBs of files to my HDD and reinstall Windows, then copy it over again. I'll read a bit into grub-rescue and it commands, and decide if it would be easier to just reinstall Ubuntu and fix grub or go with grub-rescue. Or Windows fixmbr, but I didn't know there was such a command. Either way, thanks again. --------------------------------------------------------------------------------- Alright, I've tried the /fixboot, /fixmbr methods, they didn't work. I tried formatting the first 100MBs of the drive to ntfs again using Gparted, but it still returns corrupt when it finishes. I think my only option at this point is to backup and completely refresh the disk with Windows 7, as much as I hate to do it. The problem is I deleted the grub files, so wherever in the MBR it pointed, there was no longer anything there, and then I stupidly deleted the System Reserved partition and somehow corrupted it so it can no longer be formatted (for some reason unbeknownest to me). I think I'm up shit creek without a paddle, and there's no way back.
When you say that fixboot and fixmbr didn't work, do you mean it didn't recognize the command or did it spew out an error. Can you also post the "layout" of your hard-drive If you boot into a linux live CD and run: [code]fdisk -l[/code] It should give you a layout of all the drives on your system (including USB sticks, CDs, etc. Where is windows located, at the end or the beginning of the HDD or maybe somewhere in the middle. Running the "fdisk -l" in linux should give us a clue on what's going on. I've had experience with GParted and even Parted and the tool arch uses to format the HDD (forgot the name) screwing around because of partition overlap or an order problem. It seems like Windows or Ubuntu or some crazy thing likes to make partitions that overlap each other and sometimes simply puts them in the wrong order. I know that my old Xubuntu installation put the swap partition at the end of my HDD and made it so it was (in order of partitions sda1,sda2,etc.) somewhere in the middle. All your data should be fine if you didn't write over your Windows partition. If windows is fine reinstalling linux should do the job. As for the error you get it can be fixed using fdisk. I would guess that your partition table got corrupted somehow. So yeah, post the results of [code] fdisk-l [/code] In a linux live CD. That way we can see what's going on.
[QUOTE=Boris-B;22477358]When you say that fixboot and fixmbr didn't work, do you mean it didn't recognize the command or did it spew out an error. Can you also post the "layout" of your hard-drive If you boot into a linux live CD and run: [code]fdisk -l[/code]It should give you a layout of all the drives on your system (including USB sticks, CDs, etc. Where is windows located, at the end or the beginning of the HDD or maybe somewhere in the middle. Running the "fdisk -l" in linux should give us a clue on what's going on. I've had experience with GParted and even Parted and the tool arch uses to format the HDD (forgot the name) screwing around because of partition overlap or an order problem. It seems like Windows or Ubuntu or some crazy thing likes to make partitions that overlap each other and sometimes simply puts them in the wrong order. I know that my old Xubuntu installation put the swap partition at the end of my HDD and made it so it was (in order of partitions sda1,sda2,etc.) somewhere in the middle. All your data should be fine if you didn't write over your Windows partition. If windows is fine reinstalling linux should do the job. As for the error you get it can be fixed using fdisk. I would guess that your partition table got corrupted somehow. So yeah, post the results of [code] fdisk-l [/code]In a linux live CD. That way we can see what's going on.[/QUOTE] Right. The biggest problem is the first part of the harddrive has been deleted. What used to be Partition 1 (i.e. /dev/sda1 "System Reserved" 100MB) is gone. The new partition 1 is the main install of windows, ~285GBs. So it maps out like this: /dev/sda1 - Windows 7 install /dev/sda2 - /boot /dev/sda4 - extended partition (~9GBs) /dev/sda5 - root /dev/sda6 - swap I think the entire MBR is corrupt, and the only solution is to format and reinstall. If I hadn't messed with the MBR, then I could probably still save it.
If the MBR is messed up you can still "save" it. You can either install GRUB or run fixmbr (not sure of the parameters) in the windows recovery console. fixmbr will put the windows bootloader on the MBR. Can you also post the full output of "fdisk -l", it contains information about where the partition is, free space and all sorts of good stuff. I'm not exactly sure what that "System reserved" partition is. If it's Windows itself then you're in big trouble.
[QUOTE=Boris-B;22478091]If the MBR is messed up you can still "save" it. You can either install GRUB or run fixmbr (not sure of the parameters) in the windows recovery console. fixmbr will put the windows bootloader on the MBR. Can you also post the full output of "fdisk -l", it contains information about where the partition is, free space and all sorts of good stuff. I'm not exactly sure what that "System reserved" partition is. If it's Windows itself then you're in big trouble.[/QUOTE] I GOT IT TO WORK! Here's how: 1) No current partitions were marked active by diskpart, so I boot the windows disc up and set the Windows partition as active. 2) I restarted, instead of a grub error, I get "Bootmanager is not installed." I restart again. 3) Boot up the disc once more, perform automatic startup repair, it runs, I restart and windows loads as normal. Phew. Ok, now that I have access to windows, I'm going to backup my system. But I ask, what's the correct way to install arch to a 10GB partition? I obviously botched it last time. How should I partition it?
The way you did it looks just fine. You need to set up partitions, one can do the job. +swap I would recommend having a partition for /boot. That way, if you remove arch you don't remove /boot and GRUB still works. When you install GRUB you need to install it to the MBR (the entire hard-drive) that way it will replace the Windows bootloader and work properly. When you change the "settings" for grub (edit menu.lst) uncomment the lines for the Windows section. (Make sure it "looks" like the other ones) [code] # (2) Windows <-- KEEP THIS ONE COMMENTED title Windows rootnoverify (hd0,0) makeactive #if you use Windows7 this line should be commented out chainloader +1 [/code] Here's the Partition setup you want [code] /boot - ext2 - 100M approx / - ext3/ext4 - Whatever space is left swap - swap - 1-4G (really up to you) If you didn't know the swap is what linux uses when you run out of RAM [/code] The stuff you did at first was fine, you can use that again. There's one thing you did wrong. This time install GRUB on the [b]MBR[/b] [editline]10:59PM[/editline] Ohh another thing, if you want to access your data on your NTFS partition (Windows) you need to install a special NTFS module so that you have write access to that partition (I forgot the details) and you need to add an entry to /etc/fstab. You'll have to setup /etc/fstab to that a normal user (non-root) can access that partition. Look at this thread the guy has this problem, I posted a solution (last 2 posts). This will probably change with your setup. [url]http://www.facepunch.com/showthread.php?t=948672[/url] Ohh and one last thing, (if you're not already doing this) follow the arch linux beginner's guide
Thanks man. Will do.
Sorry, you need to Log In to post a reply to this thread.