Kiwi OEM mdraid root

113 views
Skip to first unread message

Dorian Grey

unread,
Apr 29, 2013, 1:31:23 PM4/29/13
to kiwi-...@googlegroups.com
Hello everyone.

I need to deploy my OEM KIWI image with recovery partition on a mdraid mirror. Is there a native way of doing it in KIWI?

Thanks in advance

Marcus Schäfer

unread,
Apr 29, 2013, 3:58:03 PM4/29/13
to kiwi-...@googlegroups.com
Hi,

> I need to deploy my OEM KIWI image with recovery partition on a mdraid
> mirror. Is there a native way of doing it in KIWI?

Do you mean an ata raid (aka fake raid) controlled mirror or a plain
software raid mirror ? In case of an ata raid system it depends on
whether 'dmraid -s' knows about it. if yes you can deploy on the
devices kiwi will find in this case

For a full software raid image you can setup your kiwi type to
create a raid in degraded mode with the following attribute

<type ... mdraid="mirroring">

you can use mdadm after deployment to add and rebuild the raid to
be fully functional

Hope that helps

Regards,
Marcus
--
Public Key available
gpg --keyserver gpg-keyserver.de --recv-keys 0xCCE3C6A2
-------------------------------------------------------
Marcus Schäfer (Res. & Dev.) SUSE LINUX Products GmbH
Tel: 0911-740 53 0 Maxfeldstrasse 5
FAX: 0911-740 53 479 D-90409 Nürnberg
GF: Jeff Hawn,Jennifer Guild, Felix Imendörffer
HRB: 21284 (AG Nürnberg) Germany
http://www.suse.de
-------------------------------------------------------

Иван Крутских

unread,
Apr 30, 2013, 4:16:01 AM4/30/13
to kiwi-...@googlegroups.com
Yes, thank you, that seams to be the thing! Thou I don't recall this attribute from documentation... 

But a problem persists: everything is working as planed on a kvm vm with 2 virtio disk vda and vdb. But when I try to dd the same image to a disk on a physical server ( double intel ssd: sda sdb, 5 wd hdd) I get a 
Found boot device : /dev/sda(b), 
Cannot mount root device 
reboot in 120 s.

What can be сausing this?






2013/4/29 Marcus Schäfer <m...@suse.de>

--
You received this message because you are subscribed to a topic in the Google Groups "kiwi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kiwi-images/9KU3d1MLJt8/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to kiwi-images...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Marcus Schäfer

unread,
Apr 30, 2013, 5:29:36 AM4/30/13
to kiwi-...@googlegroups.com
Hi,

> Yes, thank you, that seams to be the thing! Thou I don't recall this
> attribute from documentation...

right, I just wrote about it here on the list and missed to add it
to the docs. I will do that asap and added a hint to this bug
https://bugzilla.novell.com/show_bug.cgi?GoAheadAndLogIn=1&id=815206

> But a problem persists: everything is working as planed on a kvm vm
> with 2 virtio disk vda and vdb. But when I try to dd the same image to
> a disk on a physical server ( double intel ssd: sda sdb, 5 wd hdd) I
> get a
> Found boot device : /dev/sda(b),
> Cannot mount root device
> reboot in 120 s.
> What can be сausing this?

Hmm, I need the log file to check that. Could you boot with the
kernel boot parameter:

kiwidebug=1

in that case you will get a shell instead of a reboot exception
while in that shell copy the file:

/var/log/boot.kiwi

to some storage, e.g a usb stick and send it along.

Thanks

Regards,
Marcus
--
Public Key available
gpg --keyserver pgp.mit.edu --recv-keys 0xCCE3C6A2

Иван Крутских

unread,
Apr 30, 2013, 10:03:36 AM4/30/13
to kiwi-...@googlegroups.com
Okay, all is done. 


2013/4/30 Marcus Schäfer <m...@suse.de>
boot.kiwi

Marcus Schäfer

unread,
Apr 30, 2013, 10:17:50 AM4/30/13
to kiwi-...@googlegroups.com
Hi,

> Okay, all is done.

thanks, Oh Oh I see you are using the recovery system in
software raid mode. Problem is that it try to mount the raid
before it was assembled... me bad, this was not well tested
as it seems

I will build such an image and fix this
give me a bit of time for this

Иван Крутских

unread,
Apr 30, 2013, 10:23:34 AM4/30/13
to kiwi-...@googlegroups.com
Thank you! I'll try a system without a rescue image for now...


2013/4/30 Marcus Schäfer <m...@suse.de>

Иван Крутских

unread,
Apr 30, 2013, 11:43:34 AM4/30/13
to kiwi-...@googlegroups.com
Yes. I can confirm that image without recovery partition works just fine


2013/4/30 Иван Крутских <stei...@gmail.com>

Marcus Schäfer

unread,
May 2, 2013, 6:11:23 AM5/2/13
to kiwi-...@googlegroups.com
Hi,

> Yes. I can confirm that image without recovery partition works just
> fine
>
> 2013/4/30 Иван Крутских <[1]stei...@gmail.com>
>
> Thank you! I'll try a system without a rescue image for now...

next kiwi version will have that fixed. Here is the commit

commit ed822a3210581d47c622bb9044bde01ba780eb69
Author: Marcus Schäfer <m...@suse.de>
Date: Thu May 2 12:06:33 2013 +0200

- fixed setup of recovery in a raid image. The meta information
telling the system how big the recovery partition should be
is now stored in the kiwi initrd and not in the image as it
was before. According to this the broken mount code at that
place could be removed

Thanks for the feedback

Иван Крутских

unread,
May 2, 2013, 5:49:05 PM5/2/13
to kiwi-...@googlegroups.com
Thanks a lot! I sure would like to contribute to kiwi project, since I believe it to be a suse/sles killer feature and I have plans to  empliment it in a number of my projects. Still, I have some strange issues on my 12.3 notebook, thou the same kiwi setup assembles well on a 12.3 suse vm. Maybe it's a minor issue, but would you mind taking a look at the log file? Once again- maybe I'm just being overworked and missing some stupid issue...


2013/5/2 Marcus Schäfer <m...@suse.de>
root-12.3.log

Marcus Schäfer

unread,
May 3, 2013, 5:11:48 AM5/3/13
to kiwi-...@googlegroups.com
Hi,

> Thanks a lot! I sure would like to contribute to kiwi project, since I
> believe it to be a suse/sles killer feature and I have plans to
> empliment it in a number of my projects. Still, I have some strange
> issues on my 12.3 notebook, thou the same kiwi setup assembles well on
> a 12.3 suse vm. Maybe it's a minor issue, but would you mind taking a
> look at the log file? Once again- maybe I'm just being overworked and
> missing some stupid issue...

no problem

according to the log file there is some md raid active on the build
machine and kiwi was not able to build the raid on any other free
device. I would say this could be caused by an interrupted build.
normally kiwi cleans up the environment but it still might happen
under certain circumstances.

You should check the environment for:

a) active mdraids done by kiwi and stop it

mdadm --stop /dev/mdX

b) clean LVM maps if any

vgchange -a n Vgroup

c) clean partition maps if any

kpartx -d /dev/loopX

d) clean loop maps

losetup -d /dev/loopX

at the end "losetup -a" should show nothing and /dev/mapper
should not show any active maps. Of course only for those parts
created by kiwi in some run before

If you can't get it clean the last option is a reboot

Иван Крутских

unread,
May 6, 2013, 4:16:41 AM5/6/13
to kiwi-...@googlegroups.com
okay, I can confirm that everything works ot of the box, thanks a lot! But another question is : can /boot and recovery partition also be defined as a md raid 1 with missing device? Grub2 boots okay from such a setup- a already tested that manualy.


2013/5/3 Marcus Schäfer <m...@suse.de>

Marcus Schäfer

unread,
May 6, 2013, 9:43:32 AM5/6/13
to kiwi-...@googlegroups.com
Hi,

> okay, I can confirm that everything works ot of the box, thanks a lot!

thanks for the feedback

> But another question is : can /boot and recovery partition also be
> defined as a md raid 1 with missing device? Grub2 boots okay from such
> a setup- a already tested that manualy.

Hmm, this is something I intentionally prevented because the ability
of the bootloader to read from the raid is a hack and only works for
mirrored raid. Additionally if you use a non grub supported filesystem
you need an extra boot partition. In case of kiwi's recovery feature
the recovery partition also has a bootloader installed into the recovery
partition. Thus I don't want them to live inside the raid

The recovery feature does not obsolete a good backup strategy :)

Regards,
Marcus
--
Public Key available
gpg --keyserver gpg-keyserver.de --recv-keys 0xCCE3C6A2
Reply all
Reply to author
Forward
0 new messages