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