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

Submitter:  René Mauricio Chávez Rodríguez <otamay>
Submitted:  Mon 02 May 2011 04:11:36 PM UTC
   
 
Category:  Disk & Partition Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Closed Release:  Bazaar - trunk
Release:  Reproducibility:  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>
Group 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>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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
  • -email is unavailable- added by phcoder (Updated the item)
  • -email is unavailable- added by otamay (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-05-10 phcoder StatusNone Fixed
        Open/ClosedOpen Closed
    2011-05-09 phcoder Attached File- Added vmlinuz2.diff, #23379
    2011-05-09 phcoder Attached File- Added vmlinuz.diff, #23377

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code