You are not logged in.

#1 2012-03-03 05:37:14

freebullets
Member
Registered: 2011-11-10
Posts: 31

Problems Getting GRUB2 to Work with LVM Boot Partition

I'm having major problems getting GRUB2 working with my LVM boot partition. It says, "Welcome to GRUB!" then

error: no such device: [uuid of boot logical volume]
Entering rescue mode...

This means that it can't find the boot partition, right?

"grub-install --modules=lvm --boot-directory=/mnt /dev/sda" outputs:

/usr/sbin/grub-probe: error: Couldn't find PV pv1. Check your device.map.
/mnt/grub is not readable <-- it should be
/usr/sbin/grub-probe: error: Couldn't find PV pv1. Check your device.map.
Installation finished. No error reported.

I've spent many hours trying to figure out what's wrong. If you need any more info, just ask.

Last edited by freebullets (2012-03-03 07:56:18)

Offline

#2 2012-03-03 06:33:49

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: Problems Getting GRUB2 to Work with LVM Boot Partition

Well, what is your lvm structure and what instructions were you following when you set it up?

Offline

#3 2012-03-03 07:21:17

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: Problems Getting GRUB2 to Work with LVM Boot Partition

Can you try packages at re-install with the packages at https://www.dropbox.com/s/jep9t8edsgx3yt6 ?

Offline

#4 2012-03-03 07:55:24

freebullets
Member
Registered: 2011-11-10
Posts: 31

Re: Problems Getting GRUB2 to Work with LVM Boot Partition

/dev/zero wrote:

Well, what is your lvm structure and what instructions were you following when you set it up?

I have a volume group that contains the logical volumes, "lv-boot" and "lv-root." They show up as "/dev/mapper/volgroup0-lv--boot" and "/dev/mapper/volgroup0-lv-root." I can't remember what I did exactly. GRUB2 isn't getting to the boot menu, so I assume that means it can't find the boot partition. It has the UUID of the boot logical volume, so it seems to me that it doesn't have the LVM module loaded or something.

the.ridikulus.rat wrote:

Can you try packages at re-install with the packages at https://www.dropbox.com/s/jep9t8edsgx3yt6 ?

Sorry, I should of mentioned this is a 32-bit machine. Where did those packages come from?

Last edited by freebullets (2012-03-03 08:00:09)

Offline

#5 2012-03-03 09:17:51

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: Problems Getting GRUB2 to Work with LVM Boot Partition

Offline

#6 2012-03-03 09:35:07

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: Problems Getting GRUB2 to Work with LVM Boot Partition

freebullets wrote:
/dev/zero wrote:

Well, what is your lvm structure and what instructions were you following when you set it up?

I have a volume group that contains the logical volumes, "lv-boot" and "lv-root." They show up as "/dev/mapper/volgroup0-lv--boot" and "/dev/mapper/volgroup0-lv-root." I can't remember what I did exactly. GRUB2 isn't getting to the boot menu, so I assume that means it can't find the boot partition. It has the UUID of the boot logical volume, so it seems to me that it doesn't have the LVM module loaded or something.

I see. I do use LVM with grub2, but /boot is not part of the LVM, it is on a separate ext2 partition.

Is it not correct that when trying to boot directly from an LVM, you need to put an "insmod lvm(2?)" somewhere in your grub.cfg? - do you have such a line?

If that fails, I would suggest just do what I do: always make it as easy as possible for grub to find your boot partition.

Offline

#7 2012-03-03 09:51:44

freebullets
Member
Registered: 2011-11-10
Posts: 31

Re: Problems Getting GRUB2 to Work with LVM Boot Partition

the.ridikulus.rat wrote:

That doesn't seem to affect me. The only thing wrong I see with my grub.cfg file is it doesn't have an "insmod lvm" line in it. I don't think GRUB2 is even able to read the cfg file since it's on the boot partition. Since GRUB2 is falling to the recovery console, surely that means the problem is happening before it can read anything from the boot partition?

/dev/zero wrote:
freebullets wrote:
/dev/zero wrote:

Well, what is your lvm structure and what instructions were you following when you set it up?

I have a volume group that contains the logical volumes, "lv-boot" and "lv-root." They show up as "/dev/mapper/volgroup0-lv--boot" and "/dev/mapper/volgroup0-lv-root." I can't remember what I did exactly. GRUB2 isn't getting to the boot menu, so I assume that means it can't find the boot partition. It has the UUID of the boot logical volume, so it seems to me that it doesn't have the LVM module loaded or something.

I see. I do use LVM with grub2, but /boot is not part of the LVM, it is on a separate ext2 partition.

Is it not correct that when trying to boot directly from an LVM, you need to put an "insmod lvm(2?)" somewhere in your grub.cfg? - do you have such a line?

If that fails, I would suggest just do what I do: always make it as easy as possible for grub to find your boot partition.

There isn't an LVM line in my grub.cfg. It doesn't seem like GRUB2 is seeing the boot partition though. The grub.cfg file is stored on the boot partition. I could have just as easily put the boot partition on a hard drive level partition, but I decided to go the LVM route for the challenge. Apparently this challenge is too great for me.

Last edited by freebullets (2012-03-03 09:58:25)

Offline

#8 2012-03-03 19:26:42

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: Problems Getting GRUB2 to Work with LVM Boot Partition

freebullets wrote:

There isn't an LVM line in my grub.cfg. It doesn't seem like GRUB2 is seeing the boot partition though. The grub.cfg file is stored on the boot partition. I could have just as easily put the boot partition on a hard drive level partition, but I decided to go the LVM route for the challenge. Apparently this challenge is too great for me.

I just noticed your issue is covered in the wiki. Look up the grub2 page and go to the LVM section.

Offline

#9 2012-03-03 19:45:04

freebullets
Member
Registered: 2011-11-10
Posts: 31

Re: Problems Getting GRUB2 to Work with LVM Boot Partition

/dev/zero wrote:
freebullets wrote:

There isn't an LVM line in my grub.cfg. It doesn't seem like GRUB2 is seeing the boot partition though. The grub.cfg file is stored on the boot partition. I could have just as easily put the boot partition on a hard drive level partition, but I decided to go the LVM route for the challenge. Apparently this challenge is too great for me.

I just noticed your issue is covered in the wiki. Look up the grub2 page and go to the LVM section.

Didn't work.

Also, I should probably mention that I used Super GRUB2 Disk, enabled LVM support, and it booted fine, but of course that isn't a permanent solution.

Last edited by freebullets (2012-03-03 19:48:11)

Offline

#10 2012-03-03 19:56:05

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: Problems Getting GRUB2 to Work with LVM Boot Partition

Have you rebuilt your Linux image using mkinitcpio -p linux adding HOOKS="...lvm2..." in /etc/mkinitcpio.conf?

Offline

#11 2012-03-03 19:56:56

freebullets
Member
Registered: 2011-11-10
Posts: 31

Re: Problems Getting GRUB2 to Work with LVM Boot Partition

Kaustic wrote:

Have you rebuilt your Linux image using mkinitcpio -p linux adding HOOKS="...lvm2..." in /etc/mkinitcpio.conf?

Yup.

Offline

#12 2012-03-11 10:55:09

mathfeel
Member
Registered: 2010-05-08
Posts: 36

Re: Problems Getting GRUB2 to Work with LVM Boot Partition

Kaustic wrote:

Have you rebuilt your Linux image using mkinitcpio -p linux adding HOOKS="...lvm2..." in /etc/mkinitcpio.conf?

initramfs is used only after the kernel is booted. This is before.

I am having the same issue. My LVM setup is like this:

VG-ROOT
VG-VAR
VG-HOME

/boot is under VG-ROOT, which has uuid b4e767...

Grub fail to boot with the error:

error: no such device: b4e767fb...
Entering rescue mode...
grub rescue>

Cheers!

M

Offline

Board footer

Powered by FluxBB