How to remove sw raid for VMware Converter to work

VMWare converter is very powerful tool to provide physical to virtual conversion. It’s quite easy to make P2V of Windows base servers. The last versions of VMware Converter claim to support P2V of Linux based servers. This is true, but there are limits. Linux server running sw raid (mdadm) is one of them. Here is breif HOWTO:

  • stop all important services
  • disable these services
  • break the mirror
  • strip mdadm info from the disk
  • change the partition type from fd (Linux raid auto) to 83 (Linux)
  • chroot into single disk instance
  • rename mdadm.conf
  • edit fstab to replace root mountpoint to /dev/sdX
  • config the grub to point to /dev/sdX
  • build new initrd
  • poweroff source server
  • remove the proper disk
  • boot up with one disk only

These are the steps we performed on SUSE 10 server:

sles10:~ # service oracle-xe stop
...
sles10:~ # chkconfig oracle-xe off
...
sles10:~ # mdadm --fail /dev/md0 /dev/sdb1
sles10:~ # mdadm --remove /dev/md0 /dev/sdb1
sles10:~ # mdadm --zero-superblock /dev/sdb1
sles10:~ # fdisk /dev/sdb
sles10:~ # mount /dev/sdb1 /mnt/
sles10:~ # mv /etc/mdadm.conf{,.old}
sles10:~ # chroot /mnt/
sles10:/# vim /etc/fstab
sles10:/# vim boot/grub/menu.lst
sles10:/# mkinitrd
sles10:~ # poweroff

Comments:

David Hrbáč -

Ranju, It is the very same as on physical. Delete one of virtual disks, and go ahead to destroy SW raid. Remember to create snapshot first… Regards, David

Ranju -

I ran into this issue couple of days back when I was trying to convert a Linux Debian (Lenny) which had a software RAID on it. I did cold cloning and it worked, but I ended up with 2 hard drives. How difficult is it to break the mirror after conversion? I am not overly familiar with Linux so any guidance would be appreciated. Cheers, Ranju

Mark -

I tried these steps because i’m in e same boat with vmware converter. However at boot time everything hangs. I’ve got 3 partitons (sdb1 sdb2 sdb3) with /boot on sdb1 and / on sdb2. Sdb3 is swap. It continues looking for the software mirror at boot time. Can you detail the steps a bit more? Thx

David Hrbáč -

Sorry to reply today. I guess I’m too late?

Mike -

No, it’s not too late! :) Please answer Mark’s question if you have an answer so others (like myself) who find this post later can benefit. Thanks!

David Hrbáč -

What steps did you take? All of them? What’s the distro?

Scott -

I think there is an error in the list of commands at the bottom. The mv of mdadm.conf should be after the chroot. Because we are turning /dev/sdb into the new single disk. We need to change the mdadm.conf on the new single disk.

Mike -

Only 1 year and 3 months later and I’m ready to respond. :| The distro I’m running is Ubuntu 11.04. I’m running this in a VM to test and make sure I can do it before I do it on the live environment. I’m not sure if there are any “Important services” that I should be stopping. I ran “chkconfig –list | grep on” and here is what I have: apache2, apparmor, dns-clean, grub-common, killprocs, mdadm, networking, ondemand, pppd-dns, rc.local, rsync, sendsigs, sudo, umountfs, umountnfs.sh, umountroot, urandom I didn’t kill any of those. Should I? I’ve taken all of the steps up to running fdisk to change the partition system type to 83 (Linux). I get this message back after writing the change to disk: Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at th enext reboot ora fter you run partprobe(8) or kpartx(8) Syncing disks. So then I run partprobe and it says: [ 5450.462886] end_request: I/O error, dev fd0, sector 0 [ 5450.482827] end_request: I/O error, dev fd0, sector 0 I’m assuming that is just related to the virutal floppy disk drive (that I don’t care about, but is there by default for VMware images). So, I’m thinking that’s okay. However, I then continue on to the chroot step, and I get this error message: chroot: failed to run command `/bin/bash’ : No such file or directory So I googled that and found that I need to add some directories and files to the /mnt/ so that I can chroot to it. I complete that, and then run chroot. That works now, but there is nothing in the chrooted environment. So, I"m guessing that after I break the raid, I should be seeing the files on the /dev/sdb1 partition that I’m mounting at /mnt/, but I don’t. Am I missing something?

Mike -

Sorry, I realize I forgot to specify my partition structure. /dev/sda1 -> linux_raid_member /dev/sda2 -> swap partition /dev/sdb1 -> linux_raid_member /dev/sdb2 -> swap partition /dev/md0 -> ext4 -> “/” mount point No separate /boot partition. The OS and all related files are under “/” which lives on the /dev/md0 partition, which is comprised of /dev/sda1 + /dev/sdb1

F IRIM -

No it is not… I get the same error with 6.2 as well

Jeremy Martin -

The new version of VMware converter 6.2 will do a software raid natively!

Saulius -

VMware converter 6.2 Version have the same problem :( not working

Risma -

why VMware converter 6.2 Version get error ?