Cloning OS - Instructions Unclear

  • I am migrating my OMV to a new case. Currently OS is on a USB 3 thumb drive but new case doesn't have USB 3 (only 2).


    Current thumb drive is 64GB and overkill. I have a 8GB USB thumb drive. Instructions here... https://openmediavault.readthe…ackup#cloning-flash-media


    I'm having two issues.

    1. Firstly it asks to select a source drive letter in Win32 Disk Imager. But OMV shows up as two drive letters in Windows (D: & F: in my case). It's not clear in Windows which one is the OMV OS since windows doesn't recognise the file system. I can't even do it by size as the sizes aren't shown anywhere. Selecting a random one starts the image process.
    2. Even though I selected "Read Only Allocated Partitions" the resulting image is the full 64GB

    In reality, my OMV used space is under 8GB, though this and other methods for cloning to smaller drives online (Ease US etc) refuse to make the clone from 64GB to 8GB drive.


    I'd rather not install from fresh and loose my config. I have Greyhole working in the background (independent of OMV), and it took me a long time to get it setup correctly.

    CPU i7-2600 | 11 GB RAM | Mobo Asus P8Z68-V LX | HP NC550SFP 10GbE 2-Port PCI-E-2.0x8 (SFP+ DAC) 802.3ad Bonding | US-16-XG + UDM Pro

    • OMV 6.4.6-1 (Shaitan). Installed and booting via USB 3 SATA SSD
    • SAMBA shares, doubling as landing zone for Greyhole redundant storage pool file system service.
    • 3.25 Drives (in TB) - 1,1,1,0.3,2 - 2TB drive dedicated to Timemachine.

    Einmal editiert, zuletzt von square_eyes ()

  • In your use case there is no practical difference between plugging any speed USB drive into either a USB2 or USB 3 port.


    Cloning a drive of any size onto a smaller drive will be challenging, and I strongly suggest not using a Windows OS environment to attempt it.


    In my experience with this the best approach has been to use gparted or parted in Linux to shrink all the partitions down to a combined total size below the size of the target drive, if necessary move the partitions to be contiguous to each other and have them start at the beginning of the disk, and then use dd in Linux to clone the drive. The cloning operation will likely end with an error, but in most cases unused space failing to copy will not cause problems.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • OK will try that. Though FYI my new case won't boot with the old USB 3 in the 2 port. I assumed this was because it was USB 3. Maybe it's another reason.

    CPU i7-2600 | 11 GB RAM | Mobo Asus P8Z68-V LX | HP NC550SFP 10GbE 2-Port PCI-E-2.0x8 (SFP+ DAC) 802.3ad Bonding | US-16-XG + UDM Pro

    • OMV 6.4.6-1 (Shaitan). Installed and booting via USB 3 SATA SSD
    • SAMBA shares, doubling as landing zone for Greyhole redundant storage pool file system service.
    • 3.25 Drives (in TB) - 1,1,1,0.3,2 - 2TB drive dedicated to Timemachine.
  • gderf Using gparted I was able to shrink my USB 3.0 partitions (os/swap), and make all 3 (boot/os/swap) contiguous - total size is now smaller than available space on the other drive (it still functions too). Using DD, I was able to complete a clone to the 8GB USB 2.0 flash drive. But the new drive doesn't boot. On inspection, there are errors about it having partition sizes bigger than the volume.


    What DD command should I be using? I feel like I'm nearly there but the info online is varied and complex.


    Note: I investigated purchasing a bigger USB 2.0 drive to save time but they are not common and actually quite expensive. For the price I could get a used computer with USB 3.0! But I'm really trying to recycle here. I actually pulled this box out of a dumpster many years ago so I've become quite attached to keeping it alive :)

    CPU i7-2600 | 11 GB RAM | Mobo Asus P8Z68-V LX | HP NC550SFP 10GbE 2-Port PCI-E-2.0x8 (SFP+ DAC) 802.3ad Bonding | US-16-XG + UDM Pro

    • OMV 6.4.6-1 (Shaitan). Installed and booting via USB 3 SATA SSD
    • SAMBA shares, doubling as landing zone for Greyhole redundant storage pool file system service.
    • 3.25 Drives (in TB) - 1,1,1,0.3,2 - 2TB drive dedicated to Timemachine.

    4 Mal editiert, zuletzt von square_eyes ()

  • dd if=/dev/sda of=/dev/sdb bs=1M


    where:


    /dev/sda is the source device

    /dev/sdb is the target device.


    You need to discover and use the correct device names and do keep in mind that there is no error checking. The target device will be completely overwritten with no possibility of recovering it if you made a mistake.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • TL;DR:


    Some thoughts @OP:

    Your previous pen was 64Gb USB3, which most likely was created with a GPT table.

    (You can check this on Windows with CLI "diskpart" (some info about this here)


    If you cloned it (even if resized), the GPT partition table is still marked on the pen.

    On older computers (motherboards, etc even RPis) the partition table needs to be Legacy as in MBR.

    Currently OS is on a USB 3 thumb drive but new case doesn't have USB 3 (only 2).

    Current thumb drive is 64GB and overkill

    Though FYI my new case won't boot with the old USB 3 in the 2 port

    I actually pulled this box out of a dumpster many years ago

    Using DD, I was able to complete a clone to the 8GB USB 2.0 flash drive. But the new drive doesn't boot.

    What you can try is, even with a USB3 pen, create a bootable non-UEFI system (old Hiren's boot CD for eg. or Live Linux) and try to launch it on MB boot.

  • gderf that was basically the command I tried, but with BS=8 && sync - have tried yours but I think Soma has a good point. Maybe I'll retry the dd clone then change the partition to MBR so my motherboard sees it.


    I'm a little unclear on what to do to make the USB 3 bootable, also that sounds like it's more risky at this point as it messes with my working original OS drive.

    CPU i7-2600 | 11 GB RAM | Mobo Asus P8Z68-V LX | HP NC550SFP 10GbE 2-Port PCI-E-2.0x8 (SFP+ DAC) 802.3ad Bonding | US-16-XG + UDM Pro

    • OMV 6.4.6-1 (Shaitan). Installed and booting via USB 3 SATA SSD
    • SAMBA shares, doubling as landing zone for Greyhole redundant storage pool file system service.
    • 3.25 Drives (in TB) - 1,1,1,0.3,2 - 2TB drive dedicated to Timemachine.
  • Same thing... GEOM error on boot. Converterd to MBR and that didn't help.

    CPU i7-2600 | 11 GB RAM | Mobo Asus P8Z68-V LX | HP NC550SFP 10GbE 2-Port PCI-E-2.0x8 (SFP+ DAC) 802.3ad Bonding | US-16-XG + UDM Pro

    • OMV 6.4.6-1 (Shaitan). Installed and booting via USB 3 SATA SSD
    • SAMBA shares, doubling as landing zone for Greyhole redundant storage pool file system service.
    • 3.25 Drives (in TB) - 1,1,1,0.3,2 - 2TB drive dedicated to Timemachine.
  • I may be over simplifying but I can't fathom why an app/service couldn't clone partitions/boot info from a larger drive, if they have been prepared (shrunk and contiguous) to fit on the smaller drive. There seems to be a myriad of tools, none of which tackle this use case.


    Ease US Free can do this with Windows disks (e.g. cloning OS drive to smaller SSD - assuming data size fits), but it's not equiped aparently for Linux OS drives.

    CPU i7-2600 | 11 GB RAM | Mobo Asus P8Z68-V LX | HP NC550SFP 10GbE 2-Port PCI-E-2.0x8 (SFP+ DAC) 802.3ad Bonding | US-16-XG + UDM Pro

    • OMV 6.4.6-1 (Shaitan). Installed and booting via USB 3 SATA SSD
    • SAMBA shares, doubling as landing zone for Greyhole redundant storage pool file system service.
    • 3.25 Drives (in TB) - 1,1,1,0.3,2 - 2TB drive dedicated to Timemachine.

    Einmal editiert, zuletzt von square_eyes ()

  • Partitions can be shrunk and cloned but the most basic use of dd is to clone entire disks. So, if the source disk is larger than the target disk expect the possibility of difficulties, regardless of how much or how little data there is on the source disk.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • So can it be done? If so... how?

    CPU i7-2600 | 11 GB RAM | Mobo Asus P8Z68-V LX | HP NC550SFP 10GbE 2-Port PCI-E-2.0x8 (SFP+ DAC) 802.3ad Bonding | US-16-XG + UDM Pro

    • OMV 6.4.6-1 (Shaitan). Installed and booting via USB 3 SATA SSD
    • SAMBA shares, doubling as landing zone for Greyhole redundant storage pool file system service.
    • 3.25 Drives (in TB) - 1,1,1,0.3,2 - 2TB drive dedicated to Timemachine.
  • gderf - Yeah but I think my motherboard requires MBR, as Soma suggested, and using Ease US to convert it hasn't worked.


    Now, I even purchased a 64GB USB 2.0 drive, and got the same result. So I'm in the unfortunate position of opportunity cost trying to get the 8GB work, giving up after days, and finding the bigger drive didn't work either.


    Which is hilarious because I could have rebuilt the whole NAS by now.


    I'm just really surprised that of all the tools and the users online having similar issues, there is none that clones a drive to a smaller drive, giving the user a chance to select the preferred partition table. I'm sure it's not simple, but it must be doable.

    CPU i7-2600 | 11 GB RAM | Mobo Asus P8Z68-V LX | HP NC550SFP 10GbE 2-Port PCI-E-2.0x8 (SFP+ DAC) 802.3ad Bonding | US-16-XG + UDM Pro

    • OMV 6.4.6-1 (Shaitan). Installed and booting via USB 3 SATA SSD
    • SAMBA shares, doubling as landing zone for Greyhole redundant storage pool file system service.
    • 3.25 Drives (in TB) - 1,1,1,0.3,2 - 2TB drive dedicated to Timemachine.
  • Maybe I'll retry the dd clone then change the partition to MBR


    using Ease US to convert it hasn't worked.

    AFAIK, this won't work.

    As soon as you rewrite the partition table, your partitions will be lost.


    One different approach: create the new PEN with the same ISO you use in the old system, (usually, it's able to detect Legacy/UEFI boot and act accordingly) and test it on the MB that you want to use.


    Make the installation of the OS and create the same partitions of the old system (boot/root/home, etc ) with enough/bigger space that you need.

    Configure network and update the kernel to the same as the old system has.


    After this is done, you can boot a Live Linux , delete the files from the new root and then copy/sync every single file from the old OS root to the new OS.

    Check fstab, grub, etc to see if it points to the proper place (UUIDs, or /dev/sdX, etc).

    I haven't touched a Linux with grub for more than 10 years, :)


    Reboot, and fingers crossed


    It's a "get hands dirty" type of fix but, I did it in raspbian and it's running (but there's no grub stuff, so really simple)


    Just food for thoughts...

  • Soma... thanks for the suggestion. It didn't work and I was unable to work out why.


    I did actually break my original USB somehow (pretty sure not by being careless with dd!).


    So I thought I was in for a rebuild. Also using a boot-repair bootable USB I somehow fried the mobo of the old machine I was trying to migrate to. So my efforts switched to restoring a bootable USB from my backup, using the current OMV machine (hopes of building a budget gaming PC are long gone at this point).


    After much distress and head banging... I was able to get the restored backup booting on my current/non-fried NAS. First I had to flash the bios, then boot-repair progressed (which had been previously been giving me vram errors), finally allowing me to get to work on making the new USB bootable. Boot-repair asked me to make tiny unformatted grub boot partition. It worked its magic and I was able to boot into Debian. I had a kernel panic at first, so booted into advanced mode, and selected an older version (kernel 5.7), and then it fully booted.


    I'm permanently booting off 5.7 now, since 5.10 isn't stable. I saw another user on here having similar issues with 5.10... so am going to assume it's unrelated to my recovery process.


    Can't believe I'm back up and running.


    I have one last issue... When I browse to samba shares they are read only. I checked and it doesn't seem to be user/perms in the GUI - these haven't been changed. Could there be some file system restrictions linked to the restoration?

    CPU i7-2600 | 11 GB RAM | Mobo Asus P8Z68-V LX | HP NC550SFP 10GbE 2-Port PCI-E-2.0x8 (SFP+ DAC) 802.3ad Bonding | US-16-XG + UDM Pro

    • OMV 6.4.6-1 (Shaitan). Installed and booting via USB 3 SATA SSD
    • SAMBA shares, doubling as landing zone for Greyhole redundant storage pool file system service.
    • 3.25 Drives (in TB) - 1,1,1,0.3,2 - 2TB drive dedicated to Timemachine.

    2 Mal editiert, zuletzt von square_eyes ()

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!