VMware Cloud Community
rajeevnv
Contributor
Contributor

Unable to convert Linux box 'root not found error'

I am trying to convert a CentOs physical box using the vmconvertor standalone client 5.0.1.

But th econversion is failing with the error  'root not found error'

Any work around ?

Tx

Rnv

Reply
0 Kudos
4 Replies
a_nut_in
Expert
Expert

Are you using the root account to start the conversion?

Do remember to mark my post as "helpful" or "correct" if I've helped resolve or answer your query!
Reply
0 Kudos
ivivanov
VMware Employee
VMware Employee

Most likely for some reason the disk or LVM volume on which your root filesystem resides is not recognized properly (e. g. software RAID), and the conversion cannot continue without the root filesystem. More information should be available in the log files.

__________
It is worse!
Reply
0 Kudos
nmatchan
Contributor
Contributor

I have (make that had) the same problem trying to P2V a Centos6.3 machine and as stated in the previous post, this is LVM related.

The following links describe the problem and some work arounds:

http://www.no-x.org/?p=892

http://communities.vmware.com/thread/413602?decorator=print&displayFullThread=true

In short, the version of LVM on Centos6.3 returns a longer line of output text when compared to earlier versions. The 'standalone converter 5.0.1' pushes a file called 'wmware-sysinfo-lin64.tar.gz' (64 bit version) onto the 'source machine'. This archive contains several executable that determine the source machines configuration/capabilities.  The 'lvm2.cpp' executable is expecting one of the LVM parsed fields to be 6 bytes long, if this field is not six bytes in length (which it is not), then the Logical Volume is effectively ignored. The result of this action can be seen in my 'Source System' panel output below where only the /boot mount point is listed (located on a physical volume).

Source disks/volumes layout:

    Disk 1 - 136.7 GB

            (/boot) - 141.4MB used / 500MB total <ext4>

    Disk 2 - 931.46 GB

    Logical volumes

This would seem to require a code change on the lvm2.cpp file and a re-compile on a suitable platform.

One of my colleagues has knocked together a perl wrapper for the 'lvm' command which seems to get around this issue (my P2V now successful).

Using the 'root' userid and the bash shell, the procedure is:

    mv /sbin/lvm /usr/local/sbin/lvm

    touch /sbin/lvm

    chmod 755 /sbin/lvm

    vi /sbin/lvm

        < insert/paste the following blue perl code below and save >

#!/usr/bin/perl

if($ARGV[0] eq 'lvs')
{
                $cmd = "/usr/local/sbin/lvm @ARGV";
                $cmd =~ s/\|/\\\|/;
                $out = `$cmd`;
                $out =~ s/--\|/\|/g;
                print $out;
}
else
{
                $cmd = "/usr/local/sbin/lvm @ARGV";
                $cmd =~ s/\|/\\\|/;
                system($cmd);
}

       < save and exit vi >

Test the perl script by typing: /sbin/lvm

You should get the lvm prompt: lvm>

Assuming that all is working as expected, restart your P2V job in 'converter'. You should now see Logical Volumes listed under 'Data to copy' on the Options panel.

For anyone who may be interested in this, the following is from my colleague and relates to the 'lvm2.cpp' file:

FYI here are the LVM attribute bits and what they mean- http://www.tcpdump.com/kb/os/linux/lvm-attributes/intro.html

And in the code the regex was

boost::regex exp("^\\s*(\\S+)\\|(\\S+)\\|(\\S+)\\|(\\S{6})\\|(\\d+)\\s*$");

I changed it to

boost::regex exp("^\\s*(\\S+)\\|(\\S+)\\|(\\S+)\\|(\\S+)\\|(\\d+)\\s*$");

And also where they parse the Attributes, note they check again for 6 character length, so I commented that out (in red)

And they only look at the first character anyway (in blue)

LogicalVolume::LV_TYPE

LVM2Parser::GetLvType(const std::string &attr)

{

   LogicalVolume::LV_TYPE lvType = LogicalVolume::Normal;

   //if (attr.size() != 6) {

   //   return lvType;

   //}

   char type = attr[0];

   switch (type) {

   case 'm':

   case 'M':

      lvType = LogicalVolume::Mirror;

   case 's':

      lvType = LogicalVolume::Snapshot;

   case 'S':

      lvType = LogicalVolume::Invalid_snapshot;

   default:

      lvType = LogicalVolume::Normal;

   }

   return lvType;

}

We hope this helps people out as this has lead us on a merry chase for some time now.

Reply
0 Kudos
nmatchan
Contributor
Contributor

Another problem: After successfully completing the P2V process, the new VM proceeded to fail with a Kernal panic as the kernal image file (on LVM volume) could not be found. This was found to be caused by the 'converter standalone' app modifing/re-writing several files with new path information of where to find the kernal files. This may be correct for ealier versions of Centos but not version 6.

Our work around is, on the original Centos system:

      Create directory: /boot/backup

      Copy all files relevent to your kernal verion from /boot to /boot/backup

      Perform the P2V process

      Modify the new VM setting so that it can boot from CD/DVD (you may have to tell the VM's BIOS to boot from CD/DVD as well)

      Start the VM using the 'Centos Live' CD/DVD

      Once booted, locate and mount the P2V migrated /boot directory

      Copy everything in /boot/backup into /boot (coping the unmodified kernal files back into /boot)

      Restart Centos on the VM

There may be a simplier way of doing this but this worked for us. The aim of the above procudure is to return the relevent 'boot' files back to their pre-P2V contents.

Reply
0 Kudos