Solved

Linux Drive mappings

Posted on 2016-08-10
32
48 Views
Last Modified: 2016-09-11
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
Comment
Question by:atorex
  • 16
  • 12
  • 4
32 Comments
 
LVL 11

Expert Comment

by:un1x86
ID: 41751966
Hi

Does GRUB load at all? Can you select an Image at GRUB? What are the load parameters? root=/....
0
 

Author Comment

by:atorex
ID: 41751968
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
 

Author Comment

by:atorex
ID: 41751972
the error reads
/dev/rootvg/rootvg_lv01 does not exist
/dev/rootvg/rootvg_lv02 does not exist
/dev/rootvg/swap does not exist
0
 
LVL 11

Expert Comment

by:un1x86
ID: 41751980
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
 
LVL 11

Expert Comment

by:un1x86
ID: 41751994
Also please provide some information

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

Output of:
lvmdiskscan
pvscan
0
 
LVL 11

Expert Comment

by:un1x86
ID: 41752014
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
 

Author Comment

by:atorex
ID: 41752120
This is EL7 with grub2 no menu.lst

here are the rest of the info requested.
Archive.zip
0
 
LVL 11

Expert Comment

by:un1x86
ID: 41752143
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
 

Author Comment

by:atorex
ID: 41752182
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
 
LVL 11

Expert Comment

by:un1x86
ID: 41752190
hmm weird.

What are the boot parameters? root= ?
0
 

Author Comment

by:atorex
ID: 41752293
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
 
LVL 11

Expert Comment

by:un1x86
ID: 41752858
Did you try adding the kernel parameter xen_blkfront.sda_is_xvda=1 to the boot image?
0
 

Author Comment

by:atorex
ID: 41752925
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
 
LVL 11

Expert Comment

by:un1x86
ID: 41753425
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
 
LVL 11

Expert Comment

by:un1x86
ID: 41753473
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
 

Author Comment

by:atorex
ID: 41753590
I will try this ASAP and see if that resolves it.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:atorex
ID: 41753695
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
 
LVL 11

Expert Comment

by:un1x86
ID: 41753708
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
 

Author Comment

by:atorex
ID: 41753898
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
 
LVL 11

Expert Comment

by:un1x86
ID: 41753901
have you mounted all the filesystems?
0
 

Author Comment

by:atorex
ID: 41753902
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
 
LVL 11

Expert Comment

by:un1x86
ID: 41753908
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
 

Author Comment

by:atorex
ID: 41753909
No I mounted just mounted xvda1 on /boot
0
 

Author Comment

by:atorex
ID: 41754257
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
 
LVL 39

Expert Comment

by:noci
ID: 41758562
How about the /boot/grub/device.map ?
or grub.cfg there?

There are/might be references to /dev/sda there too.
0
 

Author Comment

by:atorex
ID: 41759176
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
 
LVL 39

Expert Comment

by:noci
ID: 41760145
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
 
LVL 39

Expert Comment

by:noci
ID: 41778978
atorex can you provide more info on what you get on the interactive use.
0
 

Author Comment

by:atorex
ID: 41779655
Hi, sorry I'm not sure what you mean by the interactive use?
0
 
LVL 39

Expert Comment

by:noci
ID: 41780768
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
 

Accepted Solution

by:
atorex earned 0 total points
ID: 41785952
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
 

Author Closing Comment

by:atorex
ID: 41793200
No solution was found, I made a decision to move the environment to another Hypervisor where the issue is not present.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

#Citrix #XenApp #Citrix Scout #Citrix Insight Services #Microsoft VMMAP #Microsoft ADEXPLORE #Microsoft RAMMAP #Microsoft TCPVIEW #Microsoft AUTORUNS #Microsoft PROCESS EXPLORER #Microsoft PROCESS MONITOR
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now