* [PATCH] Fix root device detection for lvm2
@ 2010-06-02 19:07 sean finney
2010-07-01 21:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 5+ messages in thread
From: sean finney @ 2010-06-02 19:07 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1.1: Type: text/plain, Size: 381 bytes --]
If you have a single / filesystem on lvm2, the boot process will hang
waiting for a root filesystem that never appears. This patch modifies
the logic in deciding what the root device actually is, and allows the
initramfs to succesfully load the root filesystem.
The attached patch has been in use in the debian "grub2" packages for
quite a while, so I assume it's safe to use :)
[-- Attachment #1.2: 01_uuids_and_lvm_dont_play_along_nicely.diff --]
[-- Type: text/x-diff, Size: 611 bytes --]
Index: b/util/grub.d/10_linux.in
===================================================================
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -43,7 +43,8 @@
esac
if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
- || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then
+ || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
+ || [ "`grub-probe -t abstraction --device ${GRUB_DEVICE} | sed -e 's,.*\(lvm\).*,\1,'`" = "lvm" ] ; then
LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Fix root device detection for lvm2
2010-06-02 19:07 [PATCH] Fix root device detection for lvm2 sean finney
@ 2010-07-01 21:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-07-01 23:32 ` Colin Watson
0 siblings, 1 reply; 5+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-07-01 21:25 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 783 bytes --]
On 06/02/2010 09:07 PM, sean finney wrote:
> Index: b/util/grub.d/10_linux.in
> ===================================================================
> --- a/util/grub.d/10_linux.in
> +++ b/util/grub.d/10_linux.in
> @@ -43,7 +43,8 @@
> esac
>
> if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
> - || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then
> + || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
> + || [ "`grub-probe -t abstraction --device ${GRUB_DEVICE} | sed -e 's,.*\(lvm\).*,\1,'`" = "lvm" ] ; then
> LINUX_ROOT_DEVICE=${GRUB_DEVICE}
> else
> LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
>
Applied with some chages. Thanks
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Fix root device detection for lvm2
2010-07-01 21:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-07-01 23:32 ` Colin Watson
2010-07-01 23:44 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 5+ messages in thread
From: Colin Watson @ 2010-07-01 23:32 UTC (permalink / raw)
To: The development of GNU GRUB
On Thu, Jul 01, 2010 at 11:25:00PM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On 06/02/2010 09:07 PM, sean finney wrote:
> > Index: b/util/grub.d/10_linux.in
> > ===================================================================
> > --- a/util/grub.d/10_linux.in
> > +++ b/util/grub.d/10_linux.in
> > @@ -43,7 +43,8 @@
> > esac
> >
> > if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
> > - || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then
> > + || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
> > + || [ "`grub-probe -t abstraction --device ${GRUB_DEVICE} | sed -e 's,.*\(lvm\).*,\1,'`" = "lvm" ] ; then
> > LINUX_ROOT_DEVICE=${GRUB_DEVICE}
> > else
> > LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
>
> Applied with some chages. Thanks
The changes seem to have been to simplify the test to:
[ "x`grub-probe -t abstraction --device ${GRUB_DEVICE}`" = "xlvm" ]
Unfortunately this is an incorrect simplification. grub-probe can print
multiple abstractions, and does in the case of e.g. LVM on RAID. If it
is correct to avoid UUIDs for plain LVM, it is also correct to avoid
them for LVM on RAID.
--
Colin Watson [cjwatson@ubuntu.com]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Fix root device detection for lvm2
2010-07-01 23:32 ` Colin Watson
@ 2010-07-01 23:44 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-07-02 11:34 ` Colin Watson
0 siblings, 1 reply; 5+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-07-01 23:44 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 1485 bytes --]
On 07/02/2010 01:32 AM, Colin Watson wrote:
> On Thu, Jul 01, 2010 at 11:25:00PM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>
>> On 06/02/2010 09:07 PM, sean finney wrote:
>>
>>> Index: b/util/grub.d/10_linux.in
>>> ===================================================================
>>> --- a/util/grub.d/10_linux.in
>>> +++ b/util/grub.d/10_linux.in
>>> @@ -43,7 +43,8 @@
>>> esac
>>>
>>> if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
>>> - || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then
>>> + || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
>>> + || [ "`grub-probe -t abstraction --device ${GRUB_DEVICE} | sed -e 's,.*\(lvm\).*,\1,'`" = "lvm" ] ; then
>>> LINUX_ROOT_DEVICE=${GRUB_DEVICE}
>>> else
>>> LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
>>>
>> Applied with some chages. Thanks
>>
> The changes seem to have been to simplify the test to:
>
> [ "x`grub-probe -t abstraction --device ${GRUB_DEVICE}`" = "xlvm" ]
>
> Unfortunately this is an incorrect simplification. grub-probe can print
> multiple abstractions, and does in the case of e.g. LVM on RAID. If it
> is correct to avoid UUIDs for plain LVM, it is also correct to avoid
> them for LVM on RAID.
>
>
Ok I agree. The problem with original patch was that it would accept
ttttlvmuuu too. Feel free to fix.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Fix root device detection for lvm2
2010-07-01 23:44 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-07-02 11:34 ` Colin Watson
0 siblings, 0 replies; 5+ messages in thread
From: Colin Watson @ 2010-07-02 11:34 UTC (permalink / raw)
To: The development of GNU GRUB
On Fri, Jul 02, 2010 at 01:44:21AM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On 07/02/2010 01:32 AM, Colin Watson wrote:
> > The changes seem to have been to simplify the test to:
> >
> > [ "x`grub-probe -t abstraction --device ${GRUB_DEVICE}`" = "xlvm" ]
> >
> > Unfortunately this is an incorrect simplification. grub-probe can print
> > multiple abstractions, and does in the case of e.g. LVM on RAID. If it
> > is correct to avoid UUIDs for plain LVM, it is also correct to avoid
> > them for LVM on RAID.
>
> Ok I agree. The problem with original patch was that it would accept
> ttttlvmuuu too. Feel free to fix.
Fair enough. Done (r2503).
--
Colin Watson [cjwatson@ubuntu.com]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-07-02 11:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-02 19:07 [PATCH] Fix root device detection for lvm2 sean finney
2010-07-01 21:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-07-01 23:32 ` Colin Watson
2010-07-01 23:44 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-07-02 11:34 ` Colin Watson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.