Fixing BOOT of Qubes OS

1,682 views
Skip to first unread message

Stanislav Serdyuk

unread,
Sep 15, 2017, 5:31:33 PM9/15/17
to qubes...@googlegroups.com
Good afternoon,


I had working qubes OS, everything worked as it should, and then I installed ubuntu on separate partition 😞

Ubuntu replaced Qubes bootloader with GRUB and now I cannot make Qubes working again


Qubes OS is located on encrypted partition, I can see it when I am inserting Qubes Install USB (boot located on sda3)


On qubes website I can see how to fix it if it's UEFI, but in my case it's in legacy boot


I can load rescue mode, and it is locating qubes os on partition and I have ability to mount /mnt/sysimage


I am not that professional to fix it further, I hope you can help me, please advise how to fix it.


I would simply reinstall Qubes, but I have important files inside of old system.


You are the great guys, and I really appreciate the work you are doing for us - simple users.

Thank you

And have a good day

damm swing

unread,
Sep 17, 2017, 9:31:03 AM9/17/17
to qubes-users
Remember you make it at your own risk!

1)Install Qubes in other hard disk or partition (In this option before you do anything clone your hard disk.).
2)In new Qubes create AppVMs on this same names, configurations and templates as in old Qubes.
3)In new Qubes delete private.img for all AppVMs in folder "/var/lib/qubes/appvms".
4)Copy private.img for all AppVMs in folder "/var/lib/qubes/appvms" from old Qubes to new Qubes.

In the future remember to make a backup! You were very lucky that Ubuntu installator did not overwrite your LUKS partition, because then it would be "game over".

Unman

unread,
Sep 17, 2017, 12:17:55 PM9/17/17
to Stanislav Serdyuk, qubes-users
You really don't need to reinstall Qubes.
You can load rescue mode and reinstall grub2 from there: the fact this
is legacy boot doesn't matter.
Before you reinstall grub, take a copy of the existing file for the
Ubuntu install - you'll find that in /boot/grub2/grub.cfg. When you
reinstall it *should* find the Ubuntu partition but just in case you
will have the information there and can manually add it later.

Have you looked at www.qubes-os.org/doc/multiboot ?

Oh, and do make sure you have a backup, as damn swing says.

unman

stas...@gmail.com

unread,
Sep 20, 2017, 7:15:21 PM9/20/17
to qubes-users

Guys, Thank you for your replies.

Unman, Ubuntu is not important to me.
Most important thing is to load Qubes again.
I have tried grub2-install /dev/sda3 - but I am getting an error saying that it's unreliable and system will not go further.
I also done grub2-install /dev/sda successfully, but when I am starting laptop - it gives me grub rescue message that cannot load system.

I don't have so much knowledge to resolve further.
Please advise how I can restore qubes loader on my laptop?

Thanks a lot!

TO the user: damm swing. Thanks for your suggestion, I will try that as the last option as I don't have a spare system to install qubes to.

Unman

unread,
Sep 21, 2017, 4:35:01 AM9/21/17
to stas...@gmail.com, qubes-users
First, have you backed up your data?
At a pinch you could do this by using the rescue disk - the data in your
qubes is stored in /var/lib/qubes - each qube has a separate directory
and the data is stored in the private.img files.
(I think you said you can access /mnt/sysimage using the rescue disk.)
You can either copy the private.img files off the system, or mount them
individually and copy off the data.

When you installed Qubes you had a separate /boot partition - probably
at /dev/sda1 - you can check this (if you are not sure) from rescue mode.
I assume that you overwrote the entries there when you installed Ubuntu?

What you need to do now is to generate a new grub configuration, make sure
it is installed to /dev/sda1 (or wherever) and then update grub.
What is the error message you are getting?

I know this seems daunting, but if you take it step by step you should
be fine, professional or not.

stas...@gmail.com

unread,
Sep 21, 2017, 12:01:34 PM9/21/17
to qubes-users
Hi Unman,
Yes, I overwrote all entries while installing Ubuntu.

Thanks a lot for your hints, problem is finally resolved after hours of reading :)

What I done

chroot /mnt/sysimage
cd boot
grub2-mkconfig
grub2-install /dev/sda
reboot

Old grub file was fine so I booted in now successfully.

Thanks guys for your help!

Reply all
Reply to author
Forward
0 new messages