Recrecting boot loader after re-partitioning.

I used multi-boot system with Windows as a startup bootloader, and connnection to Linux using EasyBCD.

Everything worked great until I changed the partition layout, so that my Linux partition moved from /dev/sda10 to /dev/sda9.

I reconfigured EasyBCD for /dev/sda9 and the boot goes straight to … grub rescue. Try to boot from grub-rescue: the only command recognised is “set”, while commands like “linux”, “initrd”, even “boot” and “help” are rejected as invalid!

Boot from LiveCD. The Linux partition is allright, as I can read it after mounting. Now try to recover boot loader
on linux partition. Bootloader compains about multipartitioning, but continues and allows to set it up. Assign custom partition /dev/sda9 and booloader finishes without an error. Reboot - exactly same effect.

Try to do it another way. Again boot from LiveCD, find /boot/grub2/grug.cfg (or something like that) and change all occurencied of /dev/sda10 to /dev/sda9. Run update-grub --refresh to update booloader
on Linux partition with new parameters - update-grub fails. Try to mount partition
as root, using mount /dev/sda9 / -o remount,rw, it is accepted, but doesn’t help with update-grub.

I have no recue disk and can’t find a way to boot to my Linux partition. I only can use LiveCD for accessing it.

Any ideas?

PS. How easy it was with LILO and what a shame that LILO is no longer supported!

The text file /etc/fstab file determines where partitions are mounted. It indicates a part number for Partition, which must be right. I am not sure which one moved, but if /home was no longer mounted, your openSUSE would not start. Changing Partitions numbers must be made to the fstab file or your mounts will not work and for important ones like /home or SWAP, you will not be able to start. Root / must be there or nothing really works which is where the folder /etc resides. For anything else, you can add the mount option nofail to get past them not mounting.

Thank You,

Unfortunately I have no idea how easyBCD works. Where Linux bootloader was installed before changing partitions? I assume you have grub2, in this case please show output of “cat /etc/default/grub_installdevice”

Re-posting, as it did not make to the web-side.

On 2013-06-24 04:36, arvidjaar wrote:
>
> Unfortunately I have no idea how easyBCD works. Where Linux bootloader
> was installed before changing partitions? I assume you have grub2, in
> this case please show output of “cat /etc/default/grub_installdevice”

EasyBCD does not matter, it is just loading grub. It is grub who doesn’t
find things because they moved.

So, /boot/grub/menu.lst or equivalent for grub2, /etc/fstab, and perhaps
initrd, all of them have to be redone. And perhaps device.map.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Of course it matters exactly because it is loading grub. One needs to re-install grub so that EasyBCD finds it again, and for this one has to know how it finds it.

It is grub who doesn’t
find things because they moved.

So, /boot/grub/menu.lst or equivalent for grub2, /etc/fstab, and perhaps
initrd, all of them have to be redone. And perhaps device.map.

It stops far too early for anything above. What has to be done first is grub2-install (assuming it is grub2) on the right device. But to do it properly you also need to a) do something in EasyBCD so it now starts loading newly installed grub and b) possibly tell openSUSE it has to use new bootloader location in the future.

On 2013-06-25 04:46, arvidjaar wrote:

> It stops far too early for anything above. What has to be done first is
> grub2-install (assuming it is grub2) on the right device. But to do it
> properly you also need to a) do something in EasyBCD so it now starts
> loading newly installed grub and b) possibly tell openSUSE it has to use
> new bootloader location in the future.

As he gets to grub rescue currently, easybcd is doing its part
correctly, IMO.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Of course it does. For the instance of grub that was installed before. Now grub has to be reinstalled (even if only to update pointer to /boot/grub location). Will easybcd still work after grub is reinstalled?

On 2013-06-25 12:46, arvidjaar wrote:
>
> robin_listas;2567134 Wrote:
>>
>> As he gets to grub rescue currently, easybcd is doing its part
>> correctly, IMO.
>
> Of course it does. For the instance of grub that was installed before.
> Now grub has to be reinstalled (even if only to update pointer to
> /boot/grub location). Will easybcd still work after grub is reinstalled?

My guess is “yes” :slight_smile:

Same as grub would work. Think of it this way: you have two systems with
grub on each. You can, from the first grub, load a kernel on the second
system. Or you can call the second grub from the first grub; you simply
point the first one to the boot sector of the second one. From that
point, anything you change in the second one is irrelevant to the first
one, as all it does is load the boot sector and pass control over to it.
it doesn’t really read settings or anything from it.

Well, easyBCD acts the same, it is a boot loader after all. It “should”
just work (as far as anything windows “just work”, that is :wink: )

Caveat: it doesn’t work with W8, I heard. Or perhaps doesn’t if secure
boot is involved.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

As best I understand it, “easybcd” is just a tool to manage the BCD (Boot Configuration Data) of Windows. I have never used it. But I have directly used BCDEDIT to accomplish the same thing.

In order to boot linux from Windows, one needs to copy the boot sector to a file, and then enter that file into the BCD with the appropriate Windows parameters.

Whenever grub is reinstalled, the data in that boot-sector file will be out of date. So that file needs to be recreated. I would use “dd” on linux for that, but I presume that EasyBCD will do that. At a minimum, EasyBCD would need to be run from Windows to update the boot-sector file whenever grub is reinstalled.

On 2013-06-25 14:26, nrickert wrote:
>
> arvidjaar;2567146 Wrote:
>> Will easybcd still work after grub is reinstalled?
>
> As best I understand it, “easybcd” is just a tool to manage the BCD
> (Boot Configuration Data) of Windows. I have never used it. But I have
> directly used BCDEDIT to accomplish the same thing.

I did not manage to do it directly, so I used easyBCD instead.

> In order to boot linux from Windows, one needs to copy the boot sector
> to a file, and then enter that file into the BCD with the appropriate
> Windows parameters.
>
> Whenever grub is reinstalled, the data in that boot-sector file will be
> out of date. So that file needs to be recreated. I would use “dd” on
> linux for that, but I presume that EasyBCD will do that. At a minimum,
> EasyBCD would need to be run from Windows to update the boot-sector file
> whenever grub is reinstalled.

I’m not aware of the need to copy the boot sector, I don’t understand
why it would need it. But if it does, surely rerunning easybcd would do it.

Obviously, if the linux (grub) boot sector changed, and bcd is using a
copy, it will fail; so it has to be copied again.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)