29
submitted 20 hours ago by mech@feddit.org to c/linuxquestions@lemmy.zip

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?

you are viewing a single comment's thread
view the rest of the comments
[-] aarch0x40@piefed.social 9 points 19 hours ago* (last edited 19 hours 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.org 1 points 19 hours 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 9 points 19 hours ago* (last edited 19 hours 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 @ProfessorNeurus@programming.dev, sorry!, you posted while I wrote mine, so please feel free to ignore this, feels so dumb to just delete posts)

[-] aarch0x40@piefed.social 3 points 19 hours ago* (last edited 19 hours ago)

You would want the source partitions to be equal to or smaller than the target.  You would need to resize them first

this post was submitted on 20 Dec 2025
29 points (100.0% liked)

Linux Questions

3018 readers
86 users here now

Linux questions Rules (in addition of the Lemmy.zip rules)

Tips for giving and receiving help

Any rule violations will result in disciplinary actions

founded 2 years ago
MODERATORS