Problem Cloning Oracle Linux 9.2 - lvm corrupted when cloning

Discussions about using Linux guests in VirtualBox.
griff366
Posts: 9
Joined: 4. Nov 2023, 16:18

Re: Problem Cloning Oracle Linux 9.2 - lvm corrupted when cloning

Post by griff366 »

Thx :D
Replicated the solution in this forum post. It worked.
[SOLVED] After Clone virtual guest gets into emergency mode

WORKAROUND:
1. Open /etc/lvm/lvm.conf file with text editor
2. Searched "use_devicesfile" in file for: use_devices

Code: Select all

# use_devicesfile = 1
3. Uncomment this line and change the flag to 0 to disable using system.devices file.

Code: Select all

use_devicesfile = 0
4. Save and reboot

Now boots up correctly. All Logical Volumes are now available, mapped and working.


Only one thing bothers me. Is this storing up trouble for later?
I mean, just cloning a VM shouldn't cause this problem, so there is clearly some issue in the cloning of RedHat 9.2 variants in VirtualBox.
And if I carry on using the VM with this "fix" in place, am I likely to hit a worse problem later. There's no way to know...

Since I have the option, I will continue using Oracle Linux 8.8 until this cloning problem is resolved.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Problem Cloning Oracle Linux 9.2 - lvm corrupted when cloning

Post by scottgus1 »

Glad you're up and running!
griff366 wrote: 6. Nov 2023, 19:52 just cloning a VM shouldn't cause this problem,
It doesn't for OS's that don't depend on the disk UUID to be able to find the disks, like Windows:
Windows boot loader BCDedit wrote:device partition=\Device\HarddiskVolume2
No UUIDs, only the Windows version of \dev\sda, etc, so no boot trouble after a clone.

Change your Linux to not use UUIDs and voila! (Got a vague feeling I've mentioned this before, a few times...)
fth0
Volunteer
Posts: 5678
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Problem Cloning Oracle Linux 9.2 - lvm corrupted when cloning

Post by fth0 »

griff366 wrote: 6. Nov 2023, 19:52 I mean, just cloning a VM shouldn't cause this problem, so there is clearly some issue in the cloning of RedHat 9.2 variants in VirtualBox.
It's all in the other thread:

I described the technical details regarding VirtualBox in my post viewtopic.php?p=541827#p541827. VirtualBox must use another "VirtualBox hard disk UUID" to distinguish between both virtual hard disks (original + clone), which inevitably leads to a different "VirtualBox/Linux hard drive ID".

There will be alternative solutions on the LVM side, you just have to ensure that the hard drive ID doesn't get used in LVM to recognize the virtual hard disk.
Khanan
Posts: 1
Joined: 1. Jan 2024, 09:34

Re: Problem Cloning Oracle Linux 9.2 - lvm corrupted when cloning

Post by Khanan »

ISSUE: The cloned VM had a mismatched serial number for the hard disk, causing LVM to encounter recognition problems.

SOLUTION:

Identify the correct serial number of the hard disk using the command lsblk -o NAME,MODEL,SERIAL to list block devices along with their models and serial numbers. Locate the correct serial number for the cloned disk.

Update the serial number in the /etc/lvm/devices/systemdevices file to reflect the correct serial number for the cloned disk. IDTYPE=sys_wwid IDNAME=t10.ATA_VBOX_HARDDISK_VB<correct_serial_number> DEVNAME=/dev/sda2 PVID= PART=2

Replace <correct_serial_number> with the actual values obtained from the lsblk command.

In the provided example, the change was made

From:

IDTYPE=sys_wwid IDNAME=t10.ATA_VBOX_HARDDISK_VBa0cd5ac0-b51def01 DEVNAME=/dev/sda2 PVID=jTccnAUtUAACo2ye9I22IlFO0wThNegN PART=2

To:

IDTYPE=sys_wwid IDNAME=t10.ATA_VBOX_HARDDISK_VB569d205b-20417ce8 DEVNAME=/dev/sda2 PVID= jTccnAUtUAACo2ye9I22IlFO0wThNegN PART=2

This change ensures that the LVM system recognizes the correct serial number for the cloned hard disk based on the information obtained from lsblk.
aaT
Posts: 3
Joined: 20. Mar 2024, 22:46

Re: Problem Cloning Oracle Linux 9.2 - lvm corrupted when cloning

Post by aaT »

As a "forever newbie" on Linux, I appreciate reading your troubleshooting steps and hunches.

I too found that login to a user on a cloned Oracle Linux guest machine took a while and then kicked back out to the login screen. This does not happen when logging in as <root>

I too would expect that the VirtualBox clone should not remove any config code relating to non-root users.

For now, I will try learning about snapshots and also manually create a new VM while following the same steps that I did for the original installation. :(
aaT
Posts: 3
Joined: 20. Mar 2024, 22:46

Re: Problem Cloning Oracle Linux 9.2 - lvm corrupted when cloning

Post by aaT »

I also could not get the following VirtualBox Appliance to start after installation. I'll stick to manual creation of guest VM and Snapshots for now.

Oracle Database 23c Free VirtualBox Appliance
oracle. com/database/technologies/databaseappdev-vm.html
Post Reply