bugGNU GRUB - Bugs: bug #33209, grub-mkconfig does not set root...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #33209: grub-mkconfig does not set root correctly with lvm partitions

Submitted by:  René Mauricio Chávez Rodríguez <otamay>
Submitted on:  Mon 02 May 2011 04:11:36 PM UTC  
 
Category: Disk & PartitionSeverity: Major
Priority: 5 - NormalItem Group: Software Error
Status: FixedPrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: ClosedRelease: 
Release: Bazaar - trunkReproducibility: Every Time
Planned Release: None

Tue 10 May 2011 06:53:52 AM UTC, comment #5:

Fixed!

The patch works perfectly. Thank you!

René Mauricio Chávez Rodríguez <otamay>
Mon 09 May 2011 11:23:35 PM UTC, comment #4:

Typo new version attached

(file #23379)

Vladimir Serbinenko <phcoder>
Project Administrator
Mon 09 May 2011 09:59:58 PM UTC, comment #3:

Whoa =O.

The patch works, but only when vmlinuz kernel images are only in / lvm partition. (oart_msdos is inserted 7 times).

menuentry 'Gentoo GNU/Linux, with Linux 2.6.39-rc5-nvidia' --class gentoo --class gnu-linux --class gnu --class os {
load_video
set gfxpayload=keep
insmod lvm
insmod part_msdos
insmod part_msdos
insmod part_msdos
insmod part_msdos
insmod part_msdos
insmod part_msdos
insmod part_msdos
insmod ext2
set root='(vgentoo-root)'
search --no-floppy --fs-uuid --set=root 6a7250b9-e143-467b-95ba-5a05ec693335
echo 'Loading Linux 2.6.39-rc5-nvidia ...'
linux /vmlinuz-2.6.39-rc5-nvidia root=/dev/mapper/vgentoo-root ro quiet splash=silent,theme:emerge-world console=tty1 real_init=/sbin$
}

If there are, for example, a vmlinuz image in /boot, and another vmlinuz image in / lvm partition, grub-mkconfig does not set root variable and the search line in the vmlinuz on lvm menu entry.

menuentry 'Gentoo GNU/Linux, with Linux 2.6.39-rc5-nvidia' --class gentoo --class gnu-linux --class gnu --class os {
load_video
set gfxpayload=keep
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 8d488250-7be3-4db5-990d-5b7affdabb6f
echo 'Loading Linux 2.6.39-rc5-nvidia ...'
linux /vmlinuz-2.6.39-rc5-nvidia root=/dev/mapper/vgentoo-root ro quiet splash=silent,theme:emerge-world console=tty1 real_init=/sbin/e4rat-preload
}

menuentry 'Gentoo GNU/Linux, with Linux 2.6.39-rc5-nvidia' --class gentoo --class gnu-linux --class gnu --class os {
load_video
set gfxpayload=keep

echo 'Loading Linux 2.6.39-rc5-nvidia ...'
linux /vmlinuz-2.6.39-rc5-nvidia root=/dev/mapper/vgentoo-root ro quiet splash=silent,theme:emerge-world console=tty1 real_init=/sbin/e4rat-preload
}

Thank you for the patch!

René Mauricio Chávez Rodríguez <otamay>
Mon 09 May 2011 08:17:06 PM UTC, comment #2:

Please try the attached patch.

(file #23377)

Vladimir Serbinenko <phcoder>
Project Administrator
Mon 02 May 2011 04:19:26 PM UTC, comment #1:

For example, for a vmlinuz-2.6.38.4 kernel image located on / directory, being / in a logical volume named "root" inside a volume group named "vgentoo", an entry generated by grub-mkconfig is like:

Sorry for the bad explanation =/.

René Mauricio Chávez Rodríguez <otamay>
Mon 02 May 2011 04:11:36 PM UTC, original submission:

grub-mkconfig search for vmlinuz images in / and /boot directories to make the entries in grub.cfg .

When a vmlinuz kernel image is on / lvm partition, GRUB does not verify the partition where the kernel image is on, and sets the root of /boot partition.

For example, an entry like:

insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 8d488250-7be3-4db5-990d-5b7affdabb6f
echo 'Loading Linux 2.6.38.4 ...'
linux /vmlinuz-2.6.38.4

Should be like:

insmod lvm
insmod part_msdos
insmod ext2
set root='(vgentoo-root)'
search --no-floppy --fs-uuid --set=root 6a7250b9-e143-467b-95ba-5a05ec693335
echo 'Loading Linux 2.6.38.4 ...'
linux /vmlinuz-2.6.38.4

Where module lvm should be inserted, and root var and partition UUID should be changed.

René Mauricio Chávez Rodríguez <otamay>

 

Attached Files
file #23379:  vmlinuz2.diff added by phcoder (1KiB - text/x-diff)
file #23377:  vmlinuz.diff added by phcoder (1KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by phcoder (Updated the item)
  • -unavailable- added by otamay (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 10 May 2011 08:48:39 AM UTCphcoderStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Mon 09 May 2011 11:23:35 PM UTCphcoderAttached File-=>Added vmlinuz2.diff, #23379
    Mon 09 May 2011 08:17:06 PM UTCphcoderAttached File-=>Added vmlinuz.diff, #23377

    Back to the top


    Powered by Savane 3.1-cleanup1