You are not logged in.

#1 2013-02-02 14:30:00

enn
Member
Registered: 2010-10-29
Posts: 10

GRUB on boot partition vs GRUB on root partition; how to recover?

Hello,

I'm hoping someone can help me figure out how to recover from doing a stupid thing.

About a week ago I reinstalled Arch from scratch on a box with two partitions, a boot partition with GRUB and a root partition with everything else.

I wiped everything on the root partition and re-installed Arch there. I ignored the part of the instructions about installing a bootloader, figuring that I already had GRUB installed on the separate partition, and could just re-use that. (In retrospect, I can't imagine why I thought this was a good idea.)

Of course, the new Arch install put GRUB under /boot on the main root partition. So now I had a boot partition with the old GRUB and the new GRUB on /boot on the root partition, unbeknownst to me. My BIOS appears to be booting the GRUB on the boot partition.

Somehow this worked until I installed a kernel upgrade. After the upgrade, I couldn't login. After downgrading back to 3.7.4, things worked again.

I don't understand enough about GRUB to know how to fix this, or whether it is possible to do so without completely repartitioning the disk and installing from scratch. I would greatly appreciate any suggestions.

Offline

#2 2013-02-02 14:53:02

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,110

Re: GRUB on boot partition vs GRUB on root partition; how to recover?

Well, what is your current partition scheme? Am I right to understand that you have now everything everything on a single partition (including boot)? To fix your system, boot from a bootable media (for example the arch install CD) and reinstall the bootloader according to the installation instruction (https://wiki.archlinux.org/index.php/Installation_Guide). Basically, mount your partition under /arch; then

arch-chroot /arch
pacman -S grub-bios # if grub is not already installed
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
exit

Then umount /arch and reboot.

Offline

#3 2013-02-02 18:55:08

enn
Member
Registered: 2010-10-29
Posts: 10

Re: GRUB on boot partition vs GRUB on root partition; how to recover?

I have everything on one partition (/dev/sda2) but the old boot partition is still there in the partition table (/dev/sda1).

I tried grub-install /dev/sda and got:

/usr/sbin/grub-bios-setup: warning: your embedding area is unusually small. core.img won't fit in it..
/usr/sbin/grub-bios-setup: warning: Embedding is not possible GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-bios-setup: error: will not proceed with blocklists

Offline

#4 2013-02-02 20:03:09

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

Re: GRUB on boot partition vs GRUB on root partition; how to recover?

That's because you tried to install GRUB to a partition instead of the entire drive (i.e. to the MBR).


https://wiki.archlinux.org/index.php/Be … Guide#GRUB

Note: Change /dev/sda to reflect the drive you installed Arch on. Do not append a partition number (do not use sdaX).

Last edited by DSpider (2013-02-02 20:05:59)


"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

#5 2013-02-02 20:49:44

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,110

Re: GRUB on boot partition vs GRUB on root partition; how to recover?

enn wrote:

I have everything on one partition (/dev/sda2) but the old boot partition is still there in the partition table (/dev/sda1).

I tried grub-install /dev/sda and got:

/usr/sbin/grub-bios-setup: warning: your embedding area is unusually small. core.img won't fit in it..
/usr/sbin/grub-bios-setup: warning: Embedding is not possible GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-bios-setup: error: will not proceed with blocklists

You have a weird partition table (grub have no place to put itself after the MBR); Normally the first partition begin not before sector 63. What's the output of fdisk -l /dev/sda. If /dev/sda1 is your small boot partition and is at the beginning of the disk, just delete it and that should work. Otherwise install an MBR in /dev/sda (I think you can do it with lilo -M or the file mbr.bin in syslinux or ms-sys) make your root partition bootable and force instal grub in your root partition (grub-install --force /dev/sda2) and make core.img immutable.You can also repartition with gparted.

Offline

#6 2013-02-02 20:57:05

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

Re: GRUB on boot partition vs GRUB on root partition; how to recover?

Installing GRUB to a partition ("/dev/sda2") is a bad idea.

https://wiki.archlinux.org/index.php/GR … nless_Disk

This kind of setup is prone to breakage, especially during updates, and is not supported by Arch devs.


"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

#7 2013-02-02 21:01:58

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,110

Re: GRUB on boot partition vs GRUB on root partition; how to recover?

DSpider wrote:

Installing GRUB to a partition ("/dev/sda2") is a bad idea.

https://wiki.archlinux.org/index.php/GR … nless_Disk

This kind of setup is prone to breakage, especially during updates, and is not supported by Arch devs.

All will be fine if you mark core.img as immutable, the sectors of core.img is embedded in the boot sector but if the file is immutable there is no risk that it will move.

Offline

#8 2013-02-02 22:17:20

enn
Member
Registered: 2010-10-29
Posts: 10

Re: GRUB on boot partition vs GRUB on root partition; how to recover?

You have a weird partition table (grub have no place to put itself after the MBR); Normally the first partition begin not before sector 63. What's the output of fdisk -l /dev/sda

It starts at sector 32:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          32      195583       97776   83  Linux
/dev/sda2          195584   250069679   124937048   83  Linux

Thank you, I'll try deleting /dev/sda1 and then running grub-install again.

Offline

Board footer

Powered by FluxBB