Menu

Trouble with LVM Partition Clone

tporg
2023-03-13
2023-04-13
  • tporg

    tporg - 2023-03-13

    I'm attempting to clone and restore images of partitioned disks, with one partition being LVM2. Using the Clonezilla version on the latest Parted Magic download (2023_02_26, CloneZilla 3.39.14-noarch-4_pmagic) I followed the prompts for Disk to Image cloning and created an image of the disk that I stored on a USB, and I don't recall getting any errors for this process. At the time I cloned this machine I was unaware that it was partitioned and that one partition was LVM2. I had previously cloned a handful of unpartitioned disks without any trouble, and it wasn't until I attempted to restore this image that I ran into problems. I've attempted to restore the image on a different machine a number of times, each time not receiving any errors during the restoration process that would make me suspect there's an issue. However, when attempting to boot after restoring I'm kicked to initramfs or grub2.0 and neither show any of the partitions that I thought would be restored. When I boot into recovery mode I do get an error here telling me that it can't find the specified LVM (image 1). If I look at Gparted in Parted Magic I can see the three partitions and the LVM2 member are indeed on the disk (image 2).

    I've tried restoring the image with both Parted Magic and the most recent Clonezilla distribution (stable-3.0.3-22) and have had no success. I'm wondering if the Clonezilla version on Parted Magic (which I used to clone the image) does not properly handle LVMs, or if there are some steps that I need to take either when cloning the original disk or restoring that disk. Any help is greatly appreciated.

     
  • Steven Shiau

    Steven Shiau - 2023-03-19

    So the error is about the restored OS can not boot successfully?
    If so, it looks like it's related to RAID (mdadm), and maybe you'd better to make sure your boot parameter. If it assigns some FakeRAID info related to hardware serial no. or UUID, you have to do some corresponding changes in the restored OS.

    Steven

     
  • tporg

    tporg - 2023-03-20

    Yes, the error is that the restored OS does not boot successfully. Clonezilla (both stable-3.0.3-22 and the verison on Parted Magic 2023_02_26, Clonezilla 3.39.14-noarch-4_pmagic) successfully restore the image without any errors. The partitions are restored to the disk and accessible via Grub and a live Ubuntu USB, but booting kicks me down to Busybox and throws an error saying that the LVM could not be found. From Busybox I can not see any of the partitions.

    What do you mean by "make sure your boot parameter"? Is this a parameter that Clonezilla takes during the cloning/restoring process, or something in the bios? I spent a lot of time attempting to mount the individual partitions based on UUID, but had no luck getting the machine to boot. Each time I was kicked back down to Busybox or Grub and I would receive the same error telling me that the LVM could not be found, even though the LVM and the other two partitions were accessible via Grub.

     
  • tporg

    tporg - 2023-03-20

    I just checked to see if the machine I cloned had a RAID setup, and it does not (I've tried this process with two separate machines, each setup by the same person some time ago, and have run into the same issues). I'm not sure why the mdadm errors are thrown. Is it possible that I made a mistake in the original cloning process?

    For what it's worth, the machines I am cloning are older Lenovo ThinkCentre M910q, each setup with three partitions: nvme0n1p1 (mounted to/ boot/efi), nvme0n1p2 (mounted to /boot), and nvme0n1p3 (the LVM mounted to /). I spent several days trying to get these machines to recognize Clonezilla live as a bootable OS (several separate versions including the most recent stable release and a few releases from around the time these machines would have been new ~2016), but had no luck. It wasn't until I tried the Parted Magic Clonezilla distribution that I could actually clone these machines. I wonder if Parted Magic does something to their clonezilla distribution that could be causing these issues.

     
  • Steven Shiau

    Steven Shiau - 2023-03-21

    Normally if Clonezilla successfully finishes the cloning/restoring job for you, and the restored OS can not boot, the issue is normally from the restored OS. Unless when restoring/cloning, there are some errors.
    Since you mentioned there is no FakeRAID included, we can ignore that.
    If you cloning the OS from older machine to the newer one, the Linux kernel from the older machine might not support your newer hardware.
    In the initramfs shell, you can try to find the available device detected by the Linux kernel, run these commands:
    1. cat /proc/partitions
    2. lvscan
    3. ls -l /dev/mapper/*
    What are the results?

    Steven

     
  • tporg

    tporg - 2023-03-21

    I went ahead and attempted to restore the image again and took some pictures of the clonezilla output. I wasn't able to grab everything since it can move pretty fast. I've attached the images as a zip file, including images of the commands you specified.

    The command you specified didn't show much:

    (initramfs) cat /proc/partitions
    major minor #blocks name

    (initramfs) lvscan
    sh: lvscan: not found

    (initramfs) ls -l /dev/mapper/*
    crw------- 1 10, 236 /dev/mapper/control

    The linux kernel from the older machine is 5.4.0-144-generic and cat /proc/cmdline returns

    (initramfs) cat /proc/cmdline
    BOOT_IMAGE=/vmlinuz-5.4.0-144-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro

     

    Last edit: tporg 2023-03-21
  • tporg

    tporg - 2023-03-21

    The original zip was too large, so here's a few more images I captured during the restoration process. They show some information on how Clonezilla handles the LVM.

     
  • tporg

    tporg - 2023-03-23

    The restoration images are indeed restorable. I have successfully restored both a Ubuntu OS and Windows 10 OS onto a different machine. However, the restoration is only successful on a similar Lenovo Thinkcentre. So, I imaged a Lenovo Thinkcentre m910q with a 7th gen i7 vPro processor and attempted to restore it on a Dell Optiplex 7000 micro with a 12th gen i7-12700. This was unsuccesful, but restoring the image to a different Lenovo Thinkcentre m910q was successful. I am not savy enough with these things to know if this is a manufacturer specific issue or if this is a hardware architecture specific issue. I've ordered a new Lenovo to see if this problem occurs with newer Lenovo hardware.

     
  • Steven Shiau

    Steven Shiau - 2023-03-26

    In that case, I believe the Ubuntu OS you have does not support the the hardware on the restored machine you have.
    You might need to upgrade it to have newer Linux kernel to support it.

    Steven

     
  • tporg

    tporg - 2023-04-03

    I was able to restore the images to a brand new Lenovo Thinkcentre M80q with a 10th gen i7-10700T. I didn't find any information on supported hardware for the cloned Ubuntu and Kernel versions, but I agree that it seems the 12th gen i9s I have don't look to support the older kernel versions.

     
  • Steven Shiau

    Steven Shiau - 2023-04-09

    OK, so have your issue been solved?

    Steven

     
  • tporg

    tporg - 2023-04-13

    It has been solved in the sense that I successfully cloned the machines I wanted to. I'm still not sure why exactly the cloning process failed on newer machines, but I'm sure you're correct that the older Linux kernel needed to be updated for the newer hardware.

     
    👍
    1

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.