From everything I've read, it seems to come down to having initramfs "embedded into the kernel and loaded at an early stage of the boot process."1
For Mint you will have to configure /etc/crypttab
, then make use of update-initramfs
.2
From what I understand, this should serve as a guide to creating the initramfs image after installing Mint, which you seem to have installed already. Hopefully this covers everything, but be sure to research each part yourself.
Live boot Mint, mount
and chroot
to the partition you installed Mint on.3
Create and configure /etc/crypttab
to unlock at boot.4 This is where you add the path to your lvm where Mint is installed, which, based on your question, should be located in /dev/mapper/lv_os2
or /dev/<big encrypted LUKS>/lv_os2
5
Most examples I've seen of /etc/crypttab
look like the following:
root /dev/mapper/lv_os2 none luks
. The four fields, respectively are: of your choosing, path to the lvm where you installed Mint, none
setting the password to be manually entered during system boot, and luks
forces LUKS mode, but it doesn't seem necessary.
When no mode is specified in the options field and the block device
contains a LUKS signature, it is opened as a LUKS device; otherwise,
it is assumed to be in raw dm-crypt (plain mode) format.
Configure /etc/fstab
to mount the /dev/mapper/<name>
that you just created in /etc/crypttab
as the root directory /
. Something like:
/dev/mapper/<name> / <fs_vfstype> <fs_mntops>
See man fstab
.
Once you have /etc/crypttab
and /etc/fstab
configured to your liking, you can use update-initramfs
to build/update the boot image.
See man update-initramfs
. It may be best to use the specific kernel version displayed by uname -r
in Mint. The command should look something like update-initramfs -u -k 3.11.0-26-generic
except replace the kernel version with your own.
At this point, you might be able to boot into Fedora again and try the grub2-mkconfig -o /boot/grub/grub.cfg
option that detected Mint before. If that doesn't work then follow the multi-boot manual config in the GRUB manual.6
Particularly, this part:
In all the OSes install GRUB tools but disable installing GRUB in
bootsector, so you’ll have menu.lst and grub.cfg available for use.
Also disable os-prober use by setting:
GRUB_DISABLE_OS_PROBER=true
in /etc/default/grub
Hopefully this covers the majority of what you need to get Mint to boot.
You need to be certain whether the Windows loader is intact and readable by Linux or not in order to try Linux specific recovery. If you're certain that Linux Mint installation went fine and is working good, open the Terminal, and type
sudo os-prober
, alternatively, you can press TAB
key two times after writing os
to see what is the actual command for os-prober on Mint.
It should return an output like this:
/dev/sda1:Windows 7 (loader):Windows:chain
It means that Linux detects your Windows loader, so let's proceed further. Since Mint uses Grub 2.0, fire up Terminal and type
It should print some configuration related output. Search your Windows entry after ### BEGIN /etc/grub.d/30_os-prober ###. If the output shows such entry, type in Terminal
grub-mkconfig -o /boot/grub/grub.cfg
,or the location of your grub.cfg, depending upon the installation.
- Now type
grub-install /dev/sda
, where sda is the primary HDD for me.
Reboot your system normally, and select the Windows entry from Grub, it should boot.
If this doesn't work, then there must a problem with Windows loader, you need to recover it. Recovering Windows loader is trivial if Windows Installation Disk is provided. Boot into the installation Disk , proceed to the window where it shows Install, click the Repair option at the bottom of the same screen, wait for the Windows to do some searching, it will eventually show some output (irrelevant for now), click on Advanced Recovery, and find the Command Prompt from there. You can follow HTG guide here if you are uncertain where to go next. Open Command Prompt, and type
bootrec.exe /fixboot
bootrec.exe /fixmbr
Reboot the System and you should directly be able to boot into Windows. But now you can't boot into Linux Mint. To enable GRUB again, download the SuperGrub 2 disk, burn it, boot into it and it will show you a Grub Menu with OS it can find. You can boot into Mint from there, and repeat the aforementioned Grub steps to restore it.
If all else fails, Windows must be freshly installed. But, I'm always able to recover it from aforementioned techniques.
About SuperGrub 2 Disk :
Super GRUB2 Disk helps you to boot into most any Operating System (OS) even if you cannot boot into it by normal means...it’s a boot disk that will try to find all of your Operatings Systems and build a boot menu so that you can choose the one you want to boot from. From inside your booted Gnu/Linux you will be able to restore Grub by using one straight-forward command.
Link to SuperGrub 2 Disk :
Here. Choose the Stable one.
Best Answer
Even if
os-prober
had detected your two Linux installations, it wouldn't have been much use because it doesn't generate a GRUB2 configuration. It simply reports what it found in a machine-readable format.Unlike GRUB legacy, which without any tools required manual configuration, GRUB2 uses a combination of generated and manual configuration.
update-grub
is a wrapper for grub-mkconfig, the utility used to detect kernels in your /boot. Becausegrub-mkconfig
uses the /boot that's mounted (perhaps it can also mount /boot based on /etc/fstab) and your Linux installations use separate /boot partitions,grub-mkconfig
will only generate a configuration for the Linux distro that you're currently running. That's why from Debian, Mint was not detected, and visa versa.Luckily, you should have some GRUB2 configuration scripts in /etc/grub.d/ which you can use to manually add entries to the GRUB2 menu.
The fix
To get both Linux installations into the same GRUB2 menu, here's what you can do.
Choose a Linux installation to be the maintainer of GRUB
You'll need to choose which Linux system you want to update GRUB from. For instance, if you choose Debian, then promise to yourself to never run
update-grub
from Mint.Add custom menu entries for the other Linux installation
This can vary per Linux distro, but basically you'll need to edit the proper config file to add the menu entries for the other Linux installation. For instance, if you choose Debian to manage GRUB2, then you'll need to manually add the menu entries for Mint.
Run update-grub/grub-mkconfig
When you run
update-grub
, it will now use a combination of whatever it detects in /boot along with your manual configuration for the other Linux installation to produce a GRUB menu which can boot both OSes.Additional resources
Take a look at the GRUB2 documentation for Gentoo Linux. This is not a plug, it's just that it's more detailed than Debian's equivalent documentation, and may help point you in the right direction.