I’ve spent considerable time configuring my Linux system (1) and I would like to have the exact same system on another PC (2).
What would be the best way to do that?
Hardware on (2) is different, but tested compatible with the kernel.
(2) has a smaller drive size, so simply dd’ing the entire drive from a live USB won’t work.

Here’s what I’m planning:

  • install same distro on (2), using the same username as on (1)
  • create a list of installed packages on (1)
  • install same packages on (2) using the package manager
  • copy /home and /etc from (1) to an external EXT4 drive
  • boot (2) from a live USB and mount the external drive
  • delete /home and /etc on (2), then copy them over from (1)

Will this cause permission issues? Is there a quicker way?

  • aarch0x40@piefed.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    5 days ago

    You could just use dd to copy the old drive over the new one then resize the partitions.  Or you could partition the new drive and dd copy the slices you want to cut over then resize the filesystems.

    • mech@feddit.orgOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      5 days ago

      Can I dd from a bigger drive to a smaller one and expect all the data to come with it?
      (Assuming of course there’s not more data on the bigger drive than will fit on the smaller)

      • y0din@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        5 days ago

        No, dd won’t work reliably when copying from a larger drive to a smaller one. To do this, you would need to resize and align the partitions first, handling each partition individually, or use a different cloning method.

        A better approach is to use something like Clonezilla. In advanced mode, it allows you to clone from a bigger disk to a smaller one, provided that the used space on the source drive does not exceed the capacity of the target drive. Without this, it won’t be possible with any tool, not just dd.

        Here’s a tutorial for Clonezilla advanced mode:

        https://clonezilla.org/clonezilla-live/doc/11_lite_server/advanced/09-advanced-param.php

        (edit added link, and saw the second post just before me with the same answer, not trying to steal from it @[email protected], sorry!, you posted while I wrote mine, so please feel free to ignore this, feels so dumb to just delete posts)