Re: How to Boot with LVM
On Thursday, September 10, 2015 at 10:00:06 AM UTC-5, Pascal Hambourg wrote:
> ray a écrit :
> > I have only been able to boot the HDD instance. When I navigate to
> > the SSD instance, nothing is there.
> Sorry, I should have mentionned that I never used rEFInd (fortunately
> never needed it) and don't know how it works and what it looks like.
> Could you describe what it displays step by step ?
An iso in loaded onto a stick using Rufus on Win7 on another box.
This stick is inserted to the target box which is then booted.
The rEFInd is asks a couple interface questions such as keyboard mappings.
The one and only screen comes up.
The top row is the list of OSs it has found. It found two (one will boot, the other not).
The second row provides a choice of functions to run rEFInd functions, or a shell.
When I select the first OS listed, it boots. Works well, in fact it boot twice as fist. Resetting the box results in a failed boot (without the stick).
When selecting the second choice, the box just hangs.
When the REFInd is run, then the first OS is selected, it boots. On reset, the box boots right up into the selected OS (still twice as fast, 15 sec. instead of 35).
> >> /dev/sdf is one of the SSD used for RAID 0 and LVM, right ?
> > /dev/sdf is a HDD, no md or LVM.
> I was confused because you wrote in a previous post :
> > sda, sdb 32GB + 32GB, RAID0 - md0, LVM, GParted shows 1MB reserved, 1 GB (EFI)
> > sdc, sdd 64GB + 64GB, RAID0- md1, md127, LVM, GParted shows 1MB reserved, 1 GB (EFI)
> > sde, sdf 120GB + 120GB, RAID0- md0, md126 LVM, GParted shows 1MB reserved, 1 GB (EFI)
> > sdg, sdh are 2 and 4 GB HD, sdg currently hosts debian8.+q++q
> So it looks like some device names changed.
Yes. I removed a pair of SDDs for testing and when I put them back in, the order had changed.
> >>> root@mc:/boot/efi/EFI# grub-install /dev/sdf
> >>> Installing for x86_64-efi platform.
> >>> Installation finished. No error reported.
> >> The device name is not used by grub-install with an EFI target.
> >> You could have tried to use the option --boot-loader-id I mentioned in
> >> a previous post.
> > Which device name is not used by grub-install?
> Whatever you type as the device name in the command line, /dev/sdf here.
> > I did not find a way to use --boot-loader-id. I googled this exact
> > phrase and did not find anything but this posting. How do I use it?
> It is describonned in grub-install manpage. Just type "man grub-install"
> in the command line to read it.
I found it as "--bootloader-id=".
> >>> root@mc:/boot/efi/EFI# file /boot/efi/EFI/debian/grubx64.efi
> >>> /boot/efi/EFI/debian/grubx64.efi: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows
> >>> root@mc:/boot/efi/EFI# efibootmgr --verbose | grep debian
> >>> Boot0000* debian HD(1,GPT,87471e98-b814-4aa9-b2bc-ea4669c75565,0x800,0x100000)/File(\EFI\debian\grubx64.efi)
> >> Looks as expected. You can check with blkid which partition has
> >> PARTUUID=87471e98-b814-4aa9-b2bc-ea4669c75565. If you wonder about the
> >> formard / in the boot entry pathname, that's because the UEFI uses
> >> MS-style path.
> > blkid shows PARTUUID=87471e98-b814-4aa9-b2bc-ea4669c75565 to be /dev/sdf1.
> This is consistent with /dev/sdf1 being mounted on /boot/efi.
> >>> A baffling point: In rEFInd the path is /boot/efi/EFI/debian/grubx64.efi
> >> How is it baffling ? The EFI system partition is mounted on /boot/efi
> >> and the path relative to the partition filesystem root is
> >> /EFI/debian/grubx64.efi. The EFI firmware does not care about where you
> >> mount the EFI system partition.
> > Baffling: Viewing with rEFInd, I see /boot/efi/EFI/debian/grubx64.efi
> What do you mean by "viewing with rEFInd" ? AFAIK, rEFInd is just a boot
> loader, and pathnames such as /boot/efi/EFI/debian/grubx64.efi are used
> only in a running system after the kernel takes over.
While in the rEFInd shell and ls -l in /boot, I see efi/EFI/debian/grubx64.
When in the Debian instance, ls -l in /boot only shows nothing in efi, where rEFInd shows /EFI/debian/grubx64 in there.
This is where my understanding of mounted get lost. /dev/sdf1 is mounted at /boot/efi so sdf1 must have EFI/debian/grubx64. But Debian doesn't see it.
I think this is related to my problem of using:
grub-install --bootloader-id=testcase /dev/sdf
so I also tried:
grub-install --bootloader-id=testcase /boot
grub-install --bootloader-id=testcase /boot/efi
But I get back a message:
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
OK, rereading your message and David's many times, I mounted /dev/sdf1 to /boot/efi and then ran grub-install and it worked.
I then ran update-grub. Entries, I then got a new EFI folder with additional entries - Debian and test.
> >>> After booting up into the HDD instance, I get:
> >> Booting how ? On its own or from rEFInd ?
> > This is after booting on its own.
> Whether you boot the HDD Debian instance from rEFInd, the GRUB EFI
> installed on HDD or any other boot loader should not make any difference
> in the mounted filesystems...
> >> What's mounted on /boot/efi ?
> > I am not sure what it means 'what's mounted on ...'.
> If "mount" or "df" show a line with /dev/sdf1 and /boot/efi, it means
> that /dev/sdf1 is mounted on /boot/efi.
Boot did not show up here. That is what eventually keyed me to the need to mount on it.
> > #mount | grep boot returns empty
> > #mount | grep efi returns efivarfs on /sys/firmware/efi/efivars (...)
> Looks like nothing is mounted on /boot/efi, explaining why it looks
> empty. But we have yet to explain why nothing is mounted.
> Can you check the contents of /etc/fstab ?
It took a while for this to sink in.
> > root@md:/home/rayj# df -h /boot/
> > Filesystem Size Used Avail Use% Mounted on
> > /dev/sdf2 1.4T 4.2G 1.3T 1% /
> Irrelevant. We are interested in /boot/efi, not /boot.
> > OK, a little more reading tells me /dev/sdf2 is mounted on /boot
> No, it is the root filesystem, mounted on /. There is no separate /boot.
Ok, now that I have captured what I have done, I will reboot.