FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 02-02-2009, 12:38 PM
Hans de Goede
 
Default PATCH: mkinitrd: handle lv root specified as /dev/dm-X properly

Hi all,

Some users (#471729) manage to end up with /dev/dm-X instead of /dev/Foo/Bar in
their /etc/fstab (don't ask how I dunno). Given that this is not the first time
AFAIK. I've written a patch to handle this properly (as long as the /dev/dm
numbering does not change).


This patch does 3 things:
1) Properly handle slave links, so that our sysfs slave walking code
actually walks the slaves properly
2) Check if a devicemapper device is an lv inside handledm
3) remove handlevordev, as this check is now done in handledm

I've tested this with various setups using mount by LABEL UUID /dev/mapper/XXX
/dev/Foo/Bar and /dev/dm-x and all work properly.


Regards,

Hans

--- /sbin/mkinitrd 2009-01-19 17:19:58.000000000 +0100
+++ mkinitrd 2009-02-01 20:56:39.000000000 +0100
@@ -326,6 +326,9 @@
;;
*)
slavestried="$slavestried $slavename"
+ if [ -L $slave ]; then
+ slave=$(readlink $slave)
+ fi
qpushd $slave
findstoragedriverinsys
qpopd
@@ -578,12 +581,23 @@
fi

let ncryptodevs++
- handlelvordev "/dev/$slavedev"
+ findstoragedriver "$slavedev"
;;
esac
done << EOF
$(dmsetup table -j $major -m $minor 2>/dev/null)
EOF
+ local name=$(dmsetup info --noheadings -c -j $major -m $minor -o name)
+ local vg=$(lvshow "/dev/mapper/$name")
+ if [ -n "$vg" ]; then
+ vg=`echo $vg` # strip whitespace
+ case " $vg_list " in
+ *" $vg "*) ;;
+ *) vg_list="$vg_list $vg"
+ [ -z "$nolvm" ] && find_base_dm_mods
+ ;;
+ esac
+ fi
}

handleiscsi() {
@@ -662,25 +676,6 @@
dmmods_found="y"
}

-handlelvordev() {
- [ -n "$1" ] || return 0
- local vg=$(lvshow $1)
- if [ -n "$vg" ]; then
- vg=`echo $vg` # strip whitespace
- case " $vg_list " in
- *" $vg "*) ;;
- *) vg_list="$vg_list $vg"
- for device in $(vgdisplay $vg) ; do
- findstoragedriver ${device##/dev/}
- done
- [ -z "$nolvm" ] && find_base_dm_mods
- ;;
- esac
- else
- findstoragedriver ${1##/dev/}
- fi
-}
-
handlenetdev() {
local dev=$1

@@ -1086,9 +1085,9 @@
fi
if [ "$rootfs" != "nfs" ]; then
if [ -n "$physdev" -a "$physdev" != "$rdev" ]; then
- handlelvordev "$physdev"
+ findstoragedriver "$physdev"
fi
- handlelvordev $rdev
+ findstoragedriver ${rdev##/dev/}
fi

# find the first swap dev which would get used for swsusp
@@ -1105,9 +1104,9 @@
vecho "Found swsusp device $suspdev for $swsuspdev"
fi
if [ -n "$suspdev" -a "$suspdev" != "$swsuspdev" ]; then
- handlelvordev "$suspdev"
+ findstoragedriver "$suspdev"
fi
- handlelvordev "$swsuspdev"
+ findstoragedriver "${swsuspdev##/dev/}"
fi
fi

@@ -1158,7 +1157,7 @@
# FIXME: label support

if [ "$loopfs" != "nfs" ]; then
- handlelvordev $loopdev
+ findstoragedriver ${loopdev##/dev/}
fi
fi

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 02-02-2009, 02:47 PM
Peter Jones
 
Default PATCH: mkinitrd: handle lv root specified as /dev/dm-X properly

Hans de Goede wrote:

Hi all,

Some users (#471729) manage to end up with /dev/dm-X instead of
/dev/Foo/Bar in their /etc/fstab (don't ask how I dunno). Given that
this is not the first time AFAIK. I've written a patch to handle this
properly (as long as the /dev/dm numbering does not change).


This patch does 3 things:
1) Properly handle slave links, so that our sysfs slave walking code
actually walks the slaves properly
2) Check if a devicemapper device is an lv inside handledm
3) remove handlevordev, as this check is now done in handledm

I've tested this with various setups using mount by LABEL UUID
/dev/mapper/XXX /dev/Foo/Bar and /dev/dm-x and all work properly.


This looks good to me.

--
Peter

RFC 882 put the dots in .com.

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 02-03-2009, 08:44 AM
Hans de Goede
 
Default PATCH: mkinitrd: handle lv root specified as /dev/dm-X properly

Thanks for the review, comitted.

Regards,

Hans


Peter Jones wrote:

Hans de Goede wrote:

Hi all,

Some users (#471729) manage to end up with /dev/dm-X instead of
/dev/Foo/Bar in their /etc/fstab (don't ask how I dunno). Given that
this is not the first time AFAIK. I've written a patch to handle this
properly (as long as the /dev/dm numbering does not change).


This patch does 3 things:
1) Properly handle slave links, so that our sysfs slave walking code
actually walks the slaves properly
2) Check if a devicemapper device is an lv inside handledm
3) remove handlevordev, as this check is now done in handledm

I've tested this with various setups using mount by LABEL UUID
/dev/mapper/XXX /dev/Foo/Bar and /dev/dm-x and all work properly.


This looks good to me.



_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 02:59 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org