I’m not coming up with a lot of useful (clear) results when searching for a solution to this issue.

Is it OK to simply dd the 128GB disk to the 32GB disk using count to stop after the 16GB partition was cloned?

A bit more context: I had to clone a 16GB eMMC and only had a 128GB SD around. Now I purchased a 32GB eMMC and want to clone it again. The partition holds a root filesystem for an ARMv8 device. I don’t have the 16GB eMMC anymore, that would have been the easy way out.

  • Lucy :3@feddit.org
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    Could be - just try it ig. And even if not, just create a new partition on the 32 GB disk and then dd it over.

      • Lucy :3@feddit.org
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        If it’s normal files, yeah. If the partition is complicated to replicate, or encrypted etc., then just dd’ing the partition would be easier

      • azron@lemmy.ml
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        Is the system Linux? If so, then yes you can. Rsync it on to the newly created device get the uiid and fix up the fstab and boot loader configs and you are back in business.

    • InFerNo@lemmy.mlOP
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      It’s not an active partition/disk I want to clone. Clonezilla seems like something I need to boot into?

      • IsoKiero@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        You can run clonezilla on your shell session, just apt install conezilla (or whatever variant you’re using) and it can do the trick. Dd will almost surely work too, but that leaves a ton of responsibility to you instead of making any sanity checks on the way. That makes dd very powerful tool and it has saved my ass a multiple times, but if you already have a working partitioning schema clonezilla has a ton of options to make your life a lot simpler and a likely a bit faster than dd.

      • Taleya@aussie.zone
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        Use a clonezilla boot usb. I did exactly what you’re trying with clonezilla: 16gb partition on a 128gb ssd to a 64gb ssd. The clone disk is in a production machine rn and has been for two months.

      • hushable@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        Yes, Clonezilla runs off a live USB. If it is large enough it can also store the partition you want to clone, making the whole process a lot simpler.

  • avi2022@masto.ai
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months ago

    @InFerNo if it’s not a boot drive, you can use gparted to copy the partition over - it’s copy and paste, literally. Then set flags using gparted as well. If it’s a boot drive you’ll need an additional step after to use boot-repair to fix the boot sector and load grub onto it.

    It’s really simpler than it sounds, I’ve used it a few times myself. You can also use an #Ubuntu iso to execute this process after booting from it to ensure the 16GB partition is not in use when trying to copy it.

    #Linux

  • Kazumara@discuss.tchncs.de
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months ago

    Is it OK to simply dd the 128GB disk to the 32GB disk using count to stop after the 16GB partition was cloned?

    I think it would work, but it seems a little overcomplicated, you can just use the partition paths as if and of of dd directly, as long as the output partition is not smaller than the input partition.

    If you make the target partition larger than the source partition, and you intend to use the full partition going forward you will additionally need to resize the filesystem to fit the new 32GB partition, for example with resize2fs.

    • Ekky@sopuli.xyz
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      This is the way!

      Way simpler than using any GUI tool or somehow recreating the partition and manually copying the files.

  • friend_of_satan@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    If I understand the problem correctly it has a pretty simple solution that I have done before. Make a new partition on the destination and dd if=/dev/diskAsB of=/dev/diskXsY where A is the source disk and B is the source partition and X is the destination disk and Y is the destination partition. You may have to run fsck on the destination afterwards and maybe a gpt repair tool.

    Honestly though, since it’s and ext filesystem, if it were me I’d just mount the source and dest and rsync.

  • seaQueue@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    Is the 16gb partition the first partition? If so I’d just dd the 128gb drive at the 32gb drive then fix the partition table and remove the others.

    If it’s not the first drive use gparted to copy it to the new drive.