Does LVM need a /boot to install Grub?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read this

Does LVM need a /boot to install Grub?

Postby Incentive I.C on Sat Jun 14, 2014 12:20 am

I have read that it needs a /boot meaning i guess it cannot install on MBR. I basically get this error eveytime grub tries to install

"WARNING!! Install the GRUB boot loader on a hard disk

Unable to install GRUB in /dev/sda2
Executing 'grub-install /dev/sda2' failed.

This is a fatal error."

Replace the /dev/sda2 with whatever the /boot might be. Trying to do this in a Virtualbox by the way. Any help would be greatly appreciated.
The best way to learn from it is break it OS's (is there a plural for OS?) included.
User avatar
Incentive I.C
Level 4
Level 4
 
Posts: 325
Joined: Mon Aug 27, 2012 9:20 pm

Linux Mint is funded by ads and donations.
 

Re: Does LVM need a /boot to install Grub?

Postby WinterTroubles on Sat Jun 14, 2014 2:46 pm

I have no expertise and have never installed in a VM, but, I have obviously installed on a regular machine so thought it worth mentioning this observation just in case it sounds relevant...
"WARNING!! Install the GRUB boot loader on a hard disk

Unable to install GRUB in /dev/sda2
Executing 'grub-install /dev/sda2' failed.



/dev/sda2 is a partition

On a regular non VM install you would usually install to /dev/sda which is the actual hard disk. The MBR does not reside within a partition, but, in a 'file' that sits outside of the partitions that the user creates.

I'm not sure if the above is relevant for a VM, but, thought it worth mentioning.
Linux noob...lurking in the corner...reading quietly...absorbing hopefully...possibly learning..

Mint17Cinn32bit

http://www.copy.com 15 GB free storage + 5GB referral bonuses available
User avatar
WinterTroubles
Level 5
Level 5
 
Posts: 797
Joined: Fri Apr 11, 2014 6:25 am
Location: UK

Re: Does LVM need a /boot to install Grub?

Postby Incentive I.C on Sat Jun 14, 2014 4:16 pm

WinterTroubles wrote:I have no expertise and have never installed in a VM, but, I have obviously installed on a regular machine so thought it worth mentioning this observation just in case it sounds relevant...
"WARNING!! Install the GRUB boot loader on a hard disk

Unable to install GRUB in /dev/sda2
Executing 'grub-install /dev/sda2' failed.



/dev/sda2 is a partition

On a regular non VM install you would usually install to /dev/sda which is the actual hard disk. The MBR does not reside within a partition, but, in a 'file' that sits outside of the partitions that the user creates.

I'm not sure if the above is relevant for a VM, but, thought it worth mentioning.


Thanks. I have installed Mint before in a VBox. No LVM at the time and it installed just fine no complaints from Grub. Just somthing worth mentioning i guess.
The best way to learn from it is break it OS's (is there a plural for OS?) included.
User avatar
Incentive I.C
Level 4
Level 4
 
Posts: 325
Joined: Mon Aug 27, 2012 9:20 pm

Re: Does LVM need a /boot to install Grub?

Postby WinterTroubles on Sat Jun 14, 2014 4:20 pm

Then my observation was pointless and irrelevant :oops: Apologies.
Linux noob...lurking in the corner...reading quietly...absorbing hopefully...possibly learning..

Mint17Cinn32bit

http://www.copy.com 15 GB free storage + 5GB referral bonuses available
User avatar
WinterTroubles
Level 5
Level 5
 
Posts: 797
Joined: Fri Apr 11, 2014 6:25 am
Location: UK

Re: Does LVM need a /boot to install Grub?

Postby clfarron4 on Sat Jun 14, 2014 5:00 pm

Incentive I.C wrote:I have read that it needs a /boot meaning i guess it cannot install on MBR.


If you are using LVM on LUKS or LVM on LUKS (encrypted LVM) then you need a separate /boot.

I'm pretty sure you don't need a separate /boot if you are running plain LVM, though I think a couple of tweaks are needed (the ArchWiki is down right now, so I can't help an further).
Problems? Tell us EXACTLY what you've done and what you expected to happen, IN DETAIL. That will save us questions, and we should get along better,

I have dysgraphia. This means I might have understood you incorrectly through no fault of my own.
User avatar
clfarron4
Level 5
Level 5
 
Posts: 510
Joined: Thu Sep 19, 2013 6:20 pm

Re: Does LVM need a /boot to install Grub?

Postby srs5694 on Sat Jun 14, 2014 5:59 pm

WinterTroubles wrote:/dev/sda2 is a partition

On a regular non VM install you would usually install to /dev/sda which is the actual hard disk. The MBR does not reside within a partition, but, in a 'file' that sits outside of the partitions that the user creates.


VM != LVM

A virtual machine (VM) is a simulation of a computer, which enables you to run one OS inside another one, such as Windows inside Linux, Linux inside OS X, or even Linux within Linux.

The Logical Volume Manager (LVM) is a Linux tool that supplements or replaces regular disk partitions. LVM is much more flexible than regular partitions; it enables you to split filesystems across physical disks, add a large filesystem that's larger than any one chunk of free space (with the cost of fragmenting the filesystem), and so on.

You're right that, on a BIOS-based computer, GRUB's first stage normally resides in the MBR, which exists outside of any partition or filesystem. GRUB also relies on other code that's stored elsewhere, including inside normal filesystems, and that does create certain limitations -- GRUB needs a way to read the filesystem that holds its configuration and support files. GRUB includes a number of drivers to do this. I'm pretty sure that an LVM driver is among those that GRUB provides, but I personally have never tried an installation in which the GRUB files reside inside an LVM. For that matter, most distributions that use LVM rely on a separate /boot partition to hold the kernel and GRUB support files.

In sum, a BIOS-mode GRUB relies on code stored several places, which normally includes both the MBR and files in the Linux /boot directory. The details vary depending on the installation, though.
srs5694
Level 6
Level 6
 
Posts: 1020
Joined: Mon Feb 27, 2012 1:42 pm

Re: Does LVM need a /boot to install Grub?

Postby WinterTroubles on Sat Jun 14, 2014 6:32 pm

srs5694

I was distracted and misread the subject line, I'm a fool and possibly illiterate.. Thank you for pointing this out with such clarity.. I'm now off to look for a very large hole to hide in until time ends or my desire to learn about Linux goes away :oops: :lol:
Linux noob...lurking in the corner...reading quietly...absorbing hopefully...possibly learning..

Mint17Cinn32bit

http://www.copy.com 15 GB free storage + 5GB referral bonuses available
User avatar
WinterTroubles
Level 5
Level 5
 
Posts: 797
Joined: Fri Apr 11, 2014 6:25 am
Location: UK

Re: Does LVM need a /boot to install Grub?

Postby Incentive I.C on Sun Jun 15, 2014 9:13 pm

I think i found something that might get it to work. Just got to find the page again. Once i try it I will post if it works or not.
The best way to learn from it is break it OS's (is there a plural for OS?) included.
User avatar
Incentive I.C
Level 4
Level 4
 
Posts: 325
Joined: Mon Aug 27, 2012 9:20 pm

Re: Does LVM need a /boot to install Grub?

Postby Incentive I.C on Tue Jun 17, 2014 1:01 am

Is this what LVM is suppose to look like set up? How would you resize it as Gparted doesn't seem to know how...
I made the boot differently this time and that seems to have gotten it to work.
Attachments
LVM SCREEN SHOT 2.png
LVM SCREENSHOT.png
The best way to learn from it is break it OS's (is there a plural for OS?) included.
User avatar
Incentive I.C
Level 4
Level 4
 
Posts: 325
Joined: Mon Aug 27, 2012 9:20 pm

Re: Does LVM need a /boot to install Grub?

Postby Incentive I.C on Tue Jun 17, 2014 1:40 am

Don't know if this is a side affect from how i set it up but the package manager is having trouble installing. Its stick on running-post installation trigger initramsfs-tools

in details: update-initramfs: Generating /boot/initrd.img-3.13.0-24 generic

Is this because of the boot partition? My goal is to get a fully working LVM on Vbox before even thinking about taking the time to put it on the actually drive. All the problem i am having thank goodness i decied to do that :)
The best way to learn from it is break it OS's (is there a plural for OS?) included.
User avatar
Incentive I.C
Level 4
Level 4
 
Posts: 325
Joined: Mon Aug 27, 2012 9:20 pm

Re: Does LVM need a /boot to install Grub?

Postby WharfRat on Thu Jun 19, 2014 9:01 am

Incentive I.C

The lvm is assembled and activated by initrd after udev is started. Therefore you can't access a /boot partition on a logical volume since the mapper device hasn't yet been pieced together.

The grub kernel line will have a reference to the device mapper like root=/dev/mapper/mint--vg-root Instead of a partition UUID.

So yes, you have to have /boot residing on a partition that grub can access to start the kernel and initram.

Good luck :wink:
Image
User avatar
WharfRat
Level 12
Level 12
 
Posts: 4099
Joined: Thu Apr 07, 2011 8:15 pm

Re: Does LVM need a /boot to install Grub?

Postby Incentive I.C on Tue Jun 24, 2014 12:26 pm

WharfRat wrote:Incentive I.C

The lvm is assembled and activated by initrd after udev is started. Therefore you can't access a /boot partition on a logical volume since the mapper device hasn't yet been pieced together.

The grub kernel line will have a reference to the device mapper like root=/dev/mapper/mint--vg-root Instead of a partition UUID.

So yes, you have to have /boot residing on a partition that grub can access to start the kernel and initram.

Good luck :wink:


So basically I have to have a boot partition that is not in LVM? I tried that and Grub won't even install.
The best way to learn from it is break it OS's (is there a plural for OS?) included.
User avatar
Incentive I.C
Level 4
Level 4
 
Posts: 325
Joined: Mon Aug 27, 2012 9:20 pm

Re: Does LVM need a /boot to install Grub?

Postby WharfRat on Tue Jun 24, 2014 1:53 pm

I don't know exactly how you're doing this as the default installation option for lvm will create a /boot. but did you mount /boot before doing what you're doing :?:
Image
User avatar
WharfRat
Level 12
Level 12
 
Posts: 4099
Joined: Thu Apr 07, 2011 8:15 pm

Re: Does LVM need a /boot to install Grub?

Postby eanfrid on Tue Jun 24, 2014 2:20 pm

You can have /boot inside an LVM volume but AFAIK it must de done afterwards, in a second step, because grub did not load its own lvm module. You have in this second step to add to /etc/default/grub the parameter:
Code: Select all
GRUB_PRELOAD_MODULES="lvm"

and issue a "sudo update-grub". You will then be able to move /boot inside the LVM volume.
Main desktop: Debian GNU/Linux Wheezy 64bit w/custom 3.14 longterm kernel - MATE 1.8.1
(i5 2400@3.7GHz - 16GB DDR3 - HD6770 w/radeon driver - SSD+RAID1)
True private storage on SpiderOak
User avatar
eanfrid
Level 7
Level 7
 
Posts: 1784
Joined: Mon Apr 30, 2012 2:49 am
Location: FR

Re: Does LVM need a /boot to install Grub?

Postby Incentive I.C on Tue Jun 24, 2014 3:55 pm

WharfRat wrote:I don't know exactly how you're doing this as the default installation option for lvm will create a /boot. but did you mount /boot before doing what you're doing :?:


The default installation option wipes everything. I not sure if the boot was mounted during the installation but i think gparted said LVM was mounted so i guess boot was mounted as well

I am following this http://forums.linuxmint.com/viewtopic.php?f=42&t=40961
The best way to learn from it is break it OS's (is there a plural for OS?) included.
User avatar
Incentive I.C
Level 4
Level 4
 
Posts: 325
Joined: Mon Aug 27, 2012 9:20 pm

Re: Does LVM need a /boot to install Grub?

Postby WharfRat on Tue Jun 24, 2014 5:31 pm

I'd be interested in seeing the grub entry for this. I read through the installation procedure, but I still don't follow how it can boot before the logical volumes are setup :?

I don't think the chroot is necessary any more as my petra 16 has lvm2 installed and I know I didn't install it since I'm not utilizing lvm on this particular setup.

Boot the live media and mount your root to /mnt.
Code: Select all
sudo -i
mount /dev/mapper/mint--vg-root /mnt


Use whatever name you used for the vg-lv.

Code: Select all
grep vmlinuz /mnt/boot/grub/grub.cfg
Image
User avatar
WharfRat
Level 12
Level 12
 
Posts: 4099
Joined: Thu Apr 07, 2011 8:15 pm

Re: Does LVM need a /boot to install Grub?

Postby Incentive I.C on Fri Jun 27, 2014 2:21 am

WharfRat wrote:I'd be interested in seeing the grub entry for this. I read through the installation procedure, but I still don't follow how it can boot before the logical volumes are setup :?

I don't think the chroot is necessary any more as my petra 16 has lvm2 installed and I know I didn't install it since I'm not utilizing lvm on this particular setup.

Boot the live media and mount your root to /mnt.
Code: Select all
sudo -i
mount /dev/mapper/mint--vg-root /mnt


Use whatever name you used for the vg-lv.

Code: Select all
grep vmlinuz /mnt/boot/grub/grub.cfg


Alright will do. Just keep in mind this is on a VirtualBox so I don't know if that could cause any different effects with the command.
The best way to learn from it is break it OS's (is there a plural for OS?) included.
User avatar
Incentive I.C
Level 4
Level 4
 
Posts: 325
Joined: Mon Aug 27, 2012 9:20 pm

Linux Mint is funded by ads and donations.
 

Return to Installation & Boot

Who is online

Users browsing this forum: Google Adsense [Bot] and 17 guests