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.

  • Kazumara@discuss.tchncs.de
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    14 minutes 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. For example dd if=/dev/sdc1 of=/dev/sdd1 bs=4M status=progress

    Your method would also copy the partition table I suppose, which might be something you want under specific circumstances, but then it would be a little harder to get the count right, just taking the size of partition 1 would be wrong, because there is some space before it (where the partition table lives) and dd would start at 0. You’d need to add up the start position and the size of partition 1 instead.

    Personally I would prefer making a new partition table on the new eMCC, and create a target partition on it. Then you clone the content of the partition (i.e. the file system). This way the file system UUID will still be the same, and the fstab should still work because these days it usually refers to mounts by filesystem UUID in my experience.

    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 larger partition, for example with resize2fs.

    • Ekky@sopuli.xyz
      link
      fedilink
      arrow-up
      1
      ·
      21 minutes ago

      This is the way!

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

  • 7U5K3N@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    2
    ·
    28 minutes ago

    Gnome-disk-utility or “disks” in Linux will clone a partition and then restore it to another disk.

  • zelifcam@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    edit-2
    1 hour ago

    I’d use clonezilla

    E: It’s not that it can’t be done other ways, it’s just clonezilla will work and has worked for nearly 2 decades. Also there’s no information provided above about the data. So clonezilla is nice if it’s a complicated scenario.

    Plus, it’s a nice tool to throw in the toolbox once you know how to use it.

    E. Why do you feel like you have to use something like dd for this particular task? Less than 16 GB of data? Ya probably could have copied it over manually by now.

    • InFerNo@lemmy.mlOP
      link
      fedilink
      arrow-up
      3
      ·
      1 hour ago

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

  • avi2022@masto.ai
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    1 hour 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

  • Lucy :3@feddit.org
    link
    fedilink
    arrow-up
    3
    ·
    1 hour 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.

      • azron@lemmy.ml
        link
        fedilink
        arrow-up
        3
        arrow-down
        1
        ·
        56 minutes 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.