Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 68
  • Last Modified:

Linux Drive mappings

Hi I have a Linux VM exported from an ESX environment, I have an Oracle VM environment that I have imported the OVF in to the OVM, after the import the VM fails to boot failure to find the boot partition, doing some investigations I found that the drive UUID/Name change from ESX to OVM and I'm having issues fixing them.
Could anyone help, the Linux system is Red Hat 7.1 using LVM.
0
atorex
Asked:
atorex
  • 16
  • 12
  • 4
1 Solution
 
Chris SandriniSenior System EngineerCommented:
Hi

Does GRUB load at all? Can you select an Image at GRUB? What are the load parameters? root=/....
0
 
atorexAuthor Commented:
Grub loads, I can boot in to rescue mode what I have found is that the hard drives in ESX were sda, sac and so on, in Oracle VM they are xvda, xvdc and so on, I attempted to regenerate a new initramfs but that didn't resolve the issue.
0
 
atorexAuthor Commented:
the error reads
/dev/rootvg/rootvg_lv01 does not exist
/dev/rootvg/rootvg_lv02 does not exist
/dev/rootvg/swap does not exist
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Chris SandriniSenior System EngineerCommented:
Did you try to boot in rescue mode
chroot /dev/sysimage

and try to restore the volume?

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/mdatarecover.html

Probably it is wise to take a backup before you do that.
0
 
Chris SandriniSenior System EngineerCommented:
Also please provide some information

Content of:
/etc/fstab
/boot/grub/menu.lst
/etc/lvm/lvm.conf

Output of:
lvmdiskscan
pvscan
0
 
Chris SandriniSenior System EngineerCommented:
Just one think you could try

add the following kernel parameter when booting.

Group Select the image
Press "a"

and add

xen_blkfront.sda_is_xvda=1

Open in new window

0
 
atorexAuthor Commented:
This is EL7 with grub2 no menu.lst

here are the rest of the info requested.
Archive.zip
0
 
Chris SandriniSenior System EngineerCommented:
Hi

Run the following command

blkid /dev/xvda1

Take the UUID from there and replace it in /etc/fstab

UUID=bebd2d82-5b15-4707-9c56-07d544ce6708 /boot                   xfs     defaults        1 2

Open in new window


What is the content of

/etc/default/grub
0
 
atorexAuthor Commented:
it has the correct UUID, that was one of the first things I looked at, I even changed from the UUID to /dev/xvda1 but same issue, the below is blkid result.

/dev/xvda1: UUID="bebd2d82-5b15-4707-9c56-07d544ce6708" TYPE="xfs"
/dev/xvda2: UUID="7xbP6O-0enC-baqv-r8Yd-x9PU-eINb-P5NeDs" TYPE="LVM2_member"
/dev/xvdb: UUID="WNDecr-dbBt-83bR-86jJ-JeFP-X5tZ-JrAGt1" TYPE="LVM2_member"
/dev/xvdc1: UUID="8cf2ae7f-9871-4a86-b6ca-f357d2fbe2c8" TYPE="xfs"
/dev/mapper/rootvg-swap: UUID="f22816ec-4a33-4fb9-8932-9c24b4acc390" TYPE="swap"
/dev/mapper/rootvg-rootvg_lv01: UUID="5a318542-7955-4a57-a286-a4c54282b869" TYPE="xfs"
/dev/mapper/rootvg-rootvg_lv02: UUID="88efeaba-bee4-483f-af9b-031d9734fde7" TYPE="xfs"
/dev/mapper/infravg-infravg_auditlv: UUID="f72151b3-7854-4ee9-b7ad-c7bf86eb3037" TYPE="xfs"
/dev/mapper/infravg-infravg_swaplv01: UUID="bcce57d0-6e57-4d54-8f96-4bee0b7fc969" TYPE="swap"
/dev/mapper/rootvg-rootvg_lv06: UUID="2efb0307-5ea6-425e-9574-c138acf5ff3a" TYPE="xfs"
/dev/mapper/rootvg-rootvg_lv05: UUID="fa1d8613-465d-43db-9ceb-1e89880fd736" TYPE="xfs"
/dev/mapper/rootvg-rootvg_lv04: UUID="65651d72-c136-453b-b441-c3f8b0a9205a" TYPE="xfs"
/dev/mapper/rootvg-rootvg_lv03: UUID="0227619f-10e0-4e59-859a-78e415ac85a6" TYPE="xfs"
/dev/mapper/rootvg-rootvg_localadmlv: UUID="17b88595-0b3e-40fd-8a00-76ee45ba0088" TYPE="xfs"
/dev/mapper/rootvg-rootvg_hometjxlv: UUID="3be4e201-30e3-4207-b8ea-3acd843ffa36" TYPE="xfs"
/dev/mapper/rootvg-rootvg_toolslv: UUID="f9228d1c-cd7e-4251-9601-5142b957e6c8" TYPE="xfs"
/dev/mapper/rootvg-rootvg_storixlv: UUID="49fbf86c-aff0-400c-93fe-7c3a3d997f5a" TYPE="xfs"
0
 
Chris SandriniSenior System EngineerCommented:
hmm weird.

What are the boot parameters? root= ?
0
 
atorexAuthor Commented:
boot parameters from menu.lst?

this is a strange one, if I load the same ova on to another VMWare server it boots with no issues the only difference from VMWare to OVM is the dive designation of sda and so on to xvda and so on, my assumption is that is the issue but don't see where the break is happening everything appears to be normal!!
0
 
Chris SandriniSenior System EngineerCommented:
Did you try adding the kernel parameter xen_blkfront.sda_is_xvda=1 to the boot image?
0
 
atorexAuthor Commented:
No I have not yet, will do that in the morning, I did however load the OVA to a Virtual Box and had the same error, I then changed the the drive bus from SCSI to SATA and the system booted with no issues, I have loaded many OVF/OVA and never seen anything like this before, I will do the parameter test and update.

Regards,
Atorex
0
 
Chris SandriniSenior System EngineerCommented:
I have seen several such issues before but mostly they were fixed by changing the UUID and making sure it is trying to boot from the correct disk (grub2.conf).

Can you please mount the boot partition and then show me the content of grub2.conf?

chroot /dev/sysimage
mount /dev/xvda1 /boot

Open in new window


thanks
0
 
Chris SandriniSenior System EngineerCommented:
I just reproduced it here and was seeing similar issues with changing from SCSI to SATA. It got it running by

- Booting in rescue mode

Then running

chroot /mnt/sysimage
dracut -f /boot/initramfs-$(uname -r).img $(uname -r)
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-install /dev/sda (<--- you need to chose /dev/xdva)

Open in new window

0
 
atorexAuthor Commented:
I will try this ASAP and see if that resolves it.
0
 
atorexAuthor Commented:
I did the steps provided but had the same issue after a reboot, perhaps I'm missing something.

So I powers the VM up on the boot list I chose rescue mode.
entered root password and executed the chroot, however there is no sysimage in the /mnt directory the rest of the commands ran with no errors.
What am I missing, I tried it twice same results?
0
 
Chris SandriniSenior System EngineerCommented:
Hi

Not quite.

- Mount RHEL7 ISO
- Boot from CDROM
- Choose Troubleshoot
- Choose Rescue
- Choose Continue
- Once you have the shell
- Mount /mnt/sysimage

Then do the steps above.
0
 
atorexAuthor Commented:
Using the boot CD when I run the dracut command I get get an error Kernel version 3.1.x.x has no module directory /lib/modules/3.10.x.x
cat: write error: broken pipe
0
 
Chris SandriniSenior System EngineerCommented:
have you mounted all the filesystems?
0
 
atorexAuthor Commented:
so its looking for kernel module 3.10.0-229.el7.x86_64
the module in lib/modules is 3.10.0-229.4.2.el7.x86_64
0
 
Chris SandriniSenior System EngineerCommented:
then try with

dracut -f /boot/initramfs-3.10.0-229.4.2.el7.x86_64.img 3.10.0-229.4.2.el7.x86_64
0
 
atorexAuthor Commented:
No I mounted just mounted xvda1 on /boot
0
 
atorexAuthor Commented:
After several tries on OVM with no success I attempted to fix it on Virtual Box and it completed successfully after the first try, so your process is good and I'm not going mad, my issue is the xvda drive name that is messing with me, I will continue to try other options!!


regards,
Atorex
0
 
nociSoftware EngineerCommented:
How about the /boot/grub/device.map ?
or grub.cfg there?

There are/might be references to /dev/sda there too.
0
 
atorexAuthor Commented:
Yes device.map does contain drive mapping I did change them to xvda and so on but that didn't seem to change anything at all, there is no drive designation in grub.cfg.

Regards,
Atorex
0
 
nociSoftware EngineerCommented:
the device mapping translates device names to relative numbers grub uses (hd0, hd1 etc.)
You may need to setup grub again to get it to use the right devices.

But before you go there, grub can also be used interactively during boot. (It has tab completion).
So you can go interactive, and use f.e.
linux (hd0,0)/{tab} ... etc. to find the right strings for the grub.cfg.  

Just to find the where the stuff is.... and verify a configuration.
And lvm volumes are managed differently in grub2, it can eb accessed directly using the lvm module of grub and using lvm/VG-LV designator.

very early in  grub.cfg this should be setup. look for insmod and lvm/.... references.
Also grubenv might f.e. be a file that is included.
0
 
nociSoftware EngineerCommented:
atorex can you provide more info on what you get on the interactive use.
0
 
atorexAuthor Commented:
Hi, sorry I'm not sure what you mean by the interactive use?
0
 
nociSoftware EngineerCommented:
during boot you can press a key then it will not auto boot the first entry but you can select one.
You can the also activate an interactive mode where you get a prompt and can issue grub commands.

(and have tabcompletion to save ontyping, or hinting on what should follow.)
In this interactive mode you can test the commands you need to put in the final grub.cfg.
0
 
atorexAuthor Commented:
I have decided to move this VM to an ESX server where the dive issues are not present, I had limited time to complete this and was not time effective to continue the research on the OVM.
0
 
atorexAuthor Commented:
No solution was found, I made a decision to move the environment to another Hypervisor where the issue is not present.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 16
  • 12
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now