Mandriva Linux Archives: cooker@mandrivalinux.org
Mandriva Linux: cooker@mandrivalinux.org
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- From: Andrey Borzenkov
- Subject: [Cooker] Re: [PATCH REVIEW] mkinitrd, lvm, UUID
- Date: 4 Jan 2008 19:47:01 -0000
Andreas Hasenack wrote: > This is about https://bugzilla.mandriva.com/show_bug.cgi?id=36457 > > Summary: > a) lvm tools don't work on UUID=... style devices > -> "lvdisplay UUID=c52cc68a-fcff-4a11-b034-31023bf5025c" won't work > > b) lvm tools don't work with devices outside /dev/mapper/* or > /dev/<volumegroupname>/* > -> "lvdisplay /dev/dm-5" won't work, even if /dev/dm-5 is a literal > copy of /dev/mapper/vg0-root for example > > c) nash's mount command, used in the initrd, doesn't do mount by UUIDs > -> "mount -t ext3 -o ro UUID=c52cc68a-fcff-4a11-b034-31023bf5025c > /sysroot" won't work > > d) mkinitrd was doing stat(1) on some UUID=... "devices" instead of the > real device. stat(1) doesn't support UUID. > > > [b] is working as intended, according to the #lvm IRC channel: > <agk_> dmsetup uses the device-mapper namespace to refer to devices > <agk_> it does not use /dev > <ahasenack> ok, that's why "dmsetup info vg0-root" works > <ahasenack> but not /dev/vg0/root, at most only /dev/mapper/vg0-root > <agk_> if someone sent me a patch to enhance dmsetup to accept /dev > names, I'd accept it > <agk_> but noboduy has yet > <agk_> it would involve looking up the major/minor of the supplied > /dev/dm-5 inode > <ahasenack> and searching for a match in the device-mapper namespace > <agk_> then changing the command into 'dmsetup -j <major> -m <minor> > ...' > <ahasenack> is this namespace the same issue why lvdisplay doesn't > work on /dev/dm-5? > <agk_> lvdisplay uses a different namespace agin > <agk_> vg/lv > <agk_> "/dev" is an optional prefix that lvm2 simply deletes > <agk_> so lvdisplay /dev/vg/lv becomes lvdisplay vg/lv which is > processed > <agk_> - the arg is not treated as a file > <ahasenack> and since dm-5 is not a logical volume name, it fails > <agk_> we added special processing so /dev/mapper/* would work > > > Bottom line: if you use LVM on / and mount by UUID (new with 2008.1), > your system won't boot. > > > Attached are patches to try to workaround this: > > - nash-mount-by-uuid.patch: adds mount-by-uuid to nash's builtin mount > command (fixing [c]) The getpathbyspec() part looks fine; I missed this one because at the time mkswap did not support UUID so resume=UUID= did not work at all. I do not quite like mount changes. mkrootdev already supports UUID. Just let rootdev=/dev/root if fstabrootdev=(LABEL|UUID) for all cases; nash will handle it automatically already. Actually this will allow you to remove the LABEL block in mountCommand. > - mkinitrd-4.2.17-uuid_lvm.patch: deals with [a], [b] and [d] > looks fine with one comment - you can actually set different prefix for LVM namespace like # Where do you want your volume groups to appear ? dir = "/dev/lvm" so this will be not valid: + rootdev=/dev/mapper/$rootvg-`echo $lv | cut -d : -f 2` because mapper goes inside of dir: {pts/0}% sudo lvdisplay --- Logical volume --- LV Name /dev/lvm/test/v1 .. {pts/0}% LC_ALL=C ll /dev/mapper /dev/lvm/mapper /dev/lvm/mapper: total 0 crw------- 1 root root 10, 62 Dec 29 17:20 control brw------- 1 root root 253, 0 Jan 4 22:12 test-v1 brw------- 1 root root 253, 1 Jan 4 22:36 test-v2 /dev/mapper: total 0 crw-rw---- 1 root root 10, 62 Dec 29 17:19 control personally I consider this a bug - dir should affect only volume names not /dev/mapper - but well ... and IMHO placing VG name directly under /dev is wrong as well (what about having group zero or like?) > The good: my system boots again, and a plain installation (without lvm) > works too. > The bad: didn't test RAID on / yet, nor LVM1 (and I won't test LVM1). > The ugly: feels sort of hackish, we should find a way to deal with all > these "dm"s in one good way. Who knows what other surprises are there.
- Replies:
- Re: [Cooker] Re: [PATCH REVIEW] mkinitrd, lvm, UUID
- From: Olivier Thauvin
- Re: [Cooker] Re: [PATCH REVIEW] mkinitrd, lvm, UUID
- From: Andreas Hasenack
- Re: [Cooker] Re: [PATCH REVIEW] mkinitrd, lvm, UUID
- From: Andreas Hasenack
- Re: [Cooker] Re: [PATCH REVIEW] mkinitrd, lvm, UUID
- References:
- [Cooker] [PATCH REVIEW] mkinitrd, lvm, UUID
- From: Andreas Hasenack
- [Cooker] [PATCH REVIEW] mkinitrd, lvm, UUID
- Prev by Date: [Cooker] [PATCH REVIEW] mkinitrd, lvm, UUID
- Next by Date: Re: [Cooker] wrong /lib/modules/$(uname -r)/{build,source} links
- Previous by thread: [Cooker] [PATCH REVIEW] mkinitrd, lvm, UUID
- Next by thread: Re: [Cooker] Re: [PATCH REVIEW] mkinitrd, lvm, UUID
- Index(es):
Search the archive:
To (un)subscribe from/to the lists:
Fund the Mandriva Linux project
