LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-19-2012, 02:08 PM   #1
r4czek
LQ Newbie
 
Registered: Sep 2012
Posts: 2

Rep: Reputation: Disabled
GRUB2 menulist configuration, root in LVM


Hi, I hope this is right place to ask this question. I did everything I could, googled, read manuals and still I have problem. I'll be really grateful if you can help!

First, some info. Partitioning of my hdd:
sda1 - ntfs - Windows boot
sda2 - ntfs - Windows C:
sda3 - ntfs - Windows D:
sda4 - extended
-sda5 - ext4 - /boot
-sda6 - lvm

And inside sda6 there's LVM group calld G1 divided into volumes: home, root, tmp, usr, var, swap


So, here's my story:
I've just installed Debian Testing and GRUB2. Also disabled recovery mode for Debian in GRUB. After those operations I had two menu entries in GRUB:
-Debian GNU/Linux, with Linux 3.2.0-3-amd64
-Windows 7 (loader) (on /dev/sda1)

So far great! However, I'm a little bit pedant person and wanted to have just:
-Windows 7
-Debian Wheezy

Let's do it! Found this guide:
http://www.dedoimedo.com/computers/g...mozTocId584691

No problems with Windows 7, created 11_windows7, inside:
Quote:
#!/bin/sh -e
echo "Adding Windows 7"
cat << EOF
menuentry "Windows 7" {
set root=(hd0,1)
chainloader (hd0,1)+1
}
EOF
Tried to configure 12_debian:
Quote:
#!/bin/sh -e
cat << EOF
echo "Adding Debian Wheezy"
menuentry "Debian Wheezy" {
set root=(hd0,6)
linux /boot/vmlinuz-3.2.0-3-amd64
initrd /boot/initrd.img-3.2.0-3-amd
}
EOF
but with no success. After choosing "Debian Wheezy" in GRUB I get:
Quote:
error:file not found.
I guess that there's problem because root is "hided" inside LVM partition, am I right? I found some info about GRUB Naming convention (http://www.gnu.org/software/grub/man...ing-convention) and Device syntax (http://www.gnu.org/software/grub/man...#Device-syntax), but I'm a newbie and had no idea how to properly implement them.

Also, found interesting article here: https://wiki.archlinux.org/index.php/GRUB2#LVM and, accordingly tried:
Quote:
# (0) Arch Linux
cat << EOF
menuentry "Debian Wheezy" {
insmod lvm
set root=(G1-boot) #also tried G1-root
linux /boot/vmlinuz-3.2.0-3-amd64 root=/dev/mapper/G1-root ro
initrd /boot/initrd.img-3.2.0-3-amd
}
EOF
I'd appreciate every tip, every help, every tut and every manual =)

PS.: I wrote the whole story, because, surely, I've made a lot of mistakes during configuration and partitioning or something could have been done better or more professionally. Maybe you are able to find some mistakes =)
 
Old 09-20-2012, 07:31 AM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
You need to point Grub to your /boot, not the /-partition, since the kernel and initrd reside in /boot. So it should be
Code:
set root=hd(0,5)
and the kernel line should be appended with
Code:
root=/dev/VOLUME_GROUP/LOGICAL_VOLUME
if I am not mistaken.
 
Old 09-20-2012, 12:48 PM   #3
r4czek
LQ Newbie
 
Registered: Sep 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Tried, but without success. I used those combinations:
Quote:
#!/bin/sh -e
cat << EOF
echo "Adding Debian Wheezy"
menuentry "Debian Wheezy" {
set root=(hd0,5)
linux /boot/vmlinuz-3.2.0-3-amd64 root=/dev/G1/root
initrd /boot/initrd.img-3.2.0-3-amd
}
EOF
Quote:
#!/bin/sh -e
cat << EOF
echo "Adding Debian Wheezy"
menuentry "Debian Wheezy" {
set root=(hd0,5)
linux /boot/vmlinuz-3.2.0-3-amd64
initrd /boot/initrd.img-3.2.0-3-amd
}
EOF
Quote:
#!/bin/sh -e
cat << EOF
echo "Adding Debian Wheezy"
menuentry "Debian Wheezy" {
set root=hd(0,5)
linux /boot/vmlinuz-3.2.0-3-amd64
initrd /boot/initrd.img-3.2.0-3-amd
}
EOF
Quote:
#!/bin/sh -e
cat << EOF
echo "Adding Debian Wheezy"
menuentry "Debian Wheezy" {
set root=hd(0,5)
linux /boot/vmlinuz-3.2.0-3-amd64 root=/dev/G1/root
initrd /boot/initrd.img-3.2.0-3-amd
}
EOF
But now I'm getting not only "file not found" error, but also "you need to load the kernel first" error. =(
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert non LVM root partition to LVM? pinga123 Linux - Newbie 5 04-19-2012 12:08 AM
[SOLVED] how to get grub2 to work properly in mbr of multi-boot system with lvm ruggetier Linux - Distributions 2 01-27-2012 09:59 PM
Grub2 1.98 - Trying to revert to default configuration kabarBear Linux - Software 1 08-23-2010 04:53 AM
grub2 (grub-pc) intermittent problems mounting LVM partitions on bootup kevinbenko Linux - Software 8 11-04-2009 12:05 AM
Configuration problem of grub2 installed in Ext.HDD!! firewiz87 Linux - Software 5 08-24-2009 10:37 AM


All times are GMT -5. The time now is 02:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration