I want to clone my system disk to a usb-stick, but it's slightly too small

  • Using OMV4 and I want to clone my system disk to a usb-stick so I can boot from it if need be. I'm using OMV-Extras/Kernel's boot to Clonezilla, but my 32GB stick is slightly smaller than my 32GB mSATA drive.


    ```
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    loop1 7:1 0 212.5M 1 loop /usr/lib/live/mount/rootfs/filesystem.squashfs
    sda 8:0 0 29.8G 0 disk
    ├─sda1 8:1 0 512M 0 part
    ├─sda2 8:2 0 21.5G 0 part
    └─sda3 8:3 0 7.8G 0 part
    sdb 8:16 0 953.9G 0 disk
    └─md127 9:127 0 953.8G 0 raid1
    sdc 8:32 0 953.9G 0 disk
    └─md127 9:127 0 953.8G 0 raid1
    sdd 8:48 1 29.3G 0 disk


    ```


    Any suggestions? I did see there are some options for shrinking, but that doesn't work and I get all kinds of messages I don't understand with the following.


    ```
    sudo /usr/sbin/ocs-onthefly -k1 -icds -g auto -e1 auto -e2 -r -j2 -sfsck -pa choose -f sda -t sdd
    ```

  • For example, with the command above:


    ```
    Source partition file system is vfat...
    Cloning the /dev/sda1 to /dev/sdd1...
    /dev/sdd1 NOT found!
    Failed to find this partition in this system: /dev/sdd1
    ```

  • What I suggest is to use dd.


    This will fail at the very end due to slight lack of space on the destination drive, but it is almost a 100% certainty that what is being cloned at that point in the process is empty unused disk space. I have done this a few times and it always worked.

    --
    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.

  • I had tried that first and wasn't able to boot of the thumb drive. Could try again. BTW: It looks like sda3 is the swap partition, so I don't think I'd want to cut that short...?

  • Unless your system RAM is unusually small you should be able to run without any swap at all. I do.

    --
    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.

  • I was able to boot into GParted Live, and shrink the partitions, and then this command seemed to work: `sudo /usr/sbin/ocs-onthefly -k1 -icds -g auto -e1 auto -e2 -r -j2 -sfsck -pa choose -f sda -t sdd`. However, I'm not able to boot off the of the disk. I don't know if this is a UEFI problem, but when I select it in my BIOS, the screen blinks and returns to the BIOS setup....

  • ╰─➤ lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sda 8:0 0 29.8G 0 disk
    ├─sda1 8:1 0 512M 0 part
    ├─sda2 8:2 0 20.5G 0 part /
    └─sda3 8:3 0 7.8G 0 part [SWAP]
    sdb 8:16 0 953.9G 0 disk
    └─md0 9:0 0 953.8G 0 raid1 /srv/dev-disk-by-label-tb
    sdc 8:32 0 953.9G 0 disk
    └─md0 9:0 0 953.8G 0 raid1 /srv/dev-disk-by-label-tb
    sdd 8:48 1 29.3G 0 disk
    ├─sdd1 8:49 1 512M 0 part /boot/efi
    ├─sdd2 8:50 1 20.1G 0 part
    └─sdd3 8:51 1 8.7G 0 part

  • Not clear to me what that command does. But it you are cloning only the partitions that does not clone the boot track. dd as I suggested gets it all.

    --
    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.

  • I tried dd as well with the same result. I think the problem now is UEFI.

    I can't help with UEFI. I do not use it here.

    --
    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.

Jetzt mitmachen!

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