Find the answer to your Linux question:
Results 1 to 7 of 7
I have been working on virtualizing one of our physical servers recently, and in the process, I want to undo the RAID1 configuration since it isn't necessary in a virtual ...
  1. #1
    Just Joined!
    Join Date
    Nov 2007
    Location
    Salt Lake City, UT, USA
    Posts
    32

    How to undo a software RAID1

    I have been working on virtualizing one of our physical servers recently, and in the process, I want to undo the RAID1 configuration since it isn't necessary in a virtual environment. The physical server is currently configured with a simple two physical disk software RAID 1 (/dev/sda , /dev/sdb). Our virtual environment is all VMWare right now, so naturally my first P2V was with VMware Converter. It does not support software RAID configurations, I read later on. Next, I tried the Vizioncore (Quest Software now) product, vConverter ...and had a slew of problems with it before I gave up. They claim it can do software RAID conversions, and their support was pretty good in general, but during the one available window we had before Christmas to down the source server, we were unable to get it working.

    During my down-time window, I also tried my "by-hand" approach which roughly consisted of these steps:

    1. Reboot source server (SLES10 SP2 x64) with Ubuntu 10 liveCD, into Ubuntu OS.
    2. Mount source server partitions from first drive (sda) in the md array as read only: mount -r /dev/sda3 /mnt/sda ...and... mount -r /dev/sda1 /mnt/sda/boot/
    3. Create target VM with single disk, boot with Ubuntu 10 liveCD, into Ubuntu OS, then partition and make filesystems identical to source server.
    4. Rsync all files on mounted filesystems to destination VM with liveCD.
    5. When file copy is complete, eject liveCD from source server, reboot normally.
    6. Destination server then is put on an isolated network (to avoid having a duplicate system/IP). The system is still running its Ubuntu liveCD.
    7. I run mount -o bind /dev /mnt/sda/dev ...and... mount -o bind /proc /mnt/sda/proc ...then... chroot /mnt/sda
    8. I delete /etc/mdadm.conf .
    9. I modify /boot/grub/menu.lst and change all entries of md0 to sd3 (root partition).
    10. I modify /etc/mtab and /etc/fstab and change all previous entries pointing to md0 to sda3, and prune all entries that were pointing to the old physical devices sda or sdb.
    11. I reinstall grub, per some instructions at this site Article: Ubuntu how to re-install grub using chroot.


    I rehearsed this on a test VM and did it successfully. Unfortunately, on the production conversion, it didn't work out quite so well.

    I have the data copied over via rsync, and can easily copy over the database I need- the hard parts of the web server config is what I didn't want to re-do. So, anyway, I've got this target system with all the data, but I can't get it to boot up very far.

    Target partition config:
    /dev/sda1 /boot (type 83)
    /dev/sda2 swap (type 82)
    /dev/sda3 / (type 83)

    When I first boot to the hard disk, the expected GRUB menu shows up and gives me my regular two options (regular and failsafe). I allow it to boot regular, and when I hit ESC key to watch the progress, I see it failing:

    ........
    Loading raid1
    md: raid1 personality registered for level 1
    Loading edd
    BIOS EDD facility v0.16 2004-Jun-25, 1 devices found
    Loading raid0
    md: raid0 personality registered for level 0
    Loading xor
    raid5: automatically using best checksumming function: pIII_sse
    pIII_sse : 139378.000 MB/sec
    raid5: using function: pIII_sse : (139378.000 MB/sec)
    Loading raid5
    md: raid5 personality registered for level 5
    md: raid4 personality registered for level 4
    Loading linear
    md: linear personality registered for level -1
    Loading ata-piix
    Loading reiserfs
    mdadm: No devices listed in conf file were found.
    mdadm: No devices listed in conf file were found.
    Waiting for device /dev/sda3 to appear:...............................not found -- exiting to /bin/sh
    $


    Any ideas? Two things that come to mind that are different between my test system and my production system are that I did this all within VMware on my test system and thus all controllers/devices would be identical, and that my production box is SLES10 SP2 while my test system is newer SP3 . Might the kernel in SP2 get upset and fail to see the VMWare default SCSI controller properly (LSI Logic Parallel)?

  2. #2
    Linux Newbie
    Join Date
    Dec 2009
    Posts
    241
    2 Questions:
    - Have you done point 8?
    deleted mdadm.conf?

    - Can the system see /dev/sda3 ?
    ls /dev/sda*

    ? can you mount it successful

  3. #3
    Just Joined!
    Join Date
    Nov 2007
    Location
    Salt Lake City, UT, USA
    Posts
    32
    Yep- mdadm.conf is gone.

    While booted to the Ubuntu liveCD, I can mount /dev/sda3 and /dev/sda1 just fine. When I try to boot to the hard drive itself, it loads GRUB but eventually errors out to the point in the first post.

    ....edit:

    I cannot see any sda devices from the $ prompt that I get to after seeing the error. plenty of fd0* devices, pty* devices, tty* devices, and ram* devices among others.
    Last edited by bknorr; 01-03-2011 at 10:23 PM. Reason: I keep changing my mind!

  4. #4
    Linux Newbie
    Join Date
    Dec 2009
    Posts
    241
    Hi,
    I've checked your procedure again...
    Have you done the:
    mount /dev/sda3 /mnt/sda
    Before or after point 7?

  5. #5
    Just Joined!
    Join Date
    Nov 2007
    Location
    Salt Lake City, UT, USA
    Posts
    32
    Thanks for the replies so far!

    In regards to step 7, yes, I've mounted /dev/sda3 /mnt/sda prior to doing mount -o bind /dev /mnt/sda/dev .

    Could this be that the kernel in SLES10SP2 does not see the hard drive controller properly? When I was thinking about this last night, it would be just like I just swapped the hard drive to another completely different server and expecting all the hardware to work the same- is this too much to ask of SP2?

  6. #6
    Linux Newbie
    Join Date
    Dec 2009
    Posts
    241
    Yes, I am also sure that theres a problem, that the controller can't be detected ...
    What I don't get is that it was working with the raid.
    A Software-raid also needs to see the sda devices before it can start.
    Maybe a error in mdadm "removes" them again ... although I don't believe that.

    That-for I guess that something with grub is wrong.
    maybe: mount /dev/sda1 /mnt/sda/boot
    is missing since you use a separate boot partition.

    I can't even take a look at the grub config file at my system because my Computer has Grub 2
    doesn't use menue.lst anymore
    And I use LVs so theres not one /dev/sd* in my config

    Sry, seems I can't help you

  7. #7
    Just Joined!
    Join Date
    Nov 2007
    Location
    Salt Lake City, UT, USA
    Posts
    32
    Alright, it's working now.

    I used the original SLES10SP2 install DVD and did a repair. Many errors later that I bypassed and it's working now.

    Whew!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...