If you want a command line version it is a comparatively simple task.
1. Analyse partition structure.
2. Create partitions on a new device e.g. using fdisk.
3. Use rsync to copy files (excluding virtual files).
This is not what SD Copier actually does but equivalent.
To make a usable tool you should implement safeguards which is probably the hardest part of the task.
I have in the past done similar (without the safety check).
If you want new PARTUUID this is also simple and I have a script to do this but it could be included.
In practice the simplest for most normal OS would be to create a new SD from an image and rsync.
I used to use a similar procedure to update after modifying a SD Card (excluding a few files e.g. hostname) but now use SD Copier and fix hostname etc. after.
1. Analyse partition structure.
2. Create partitions on a new device e.g. using fdisk.
3. Use rsync to copy files (excluding virtual files).
This is not what SD Copier actually does but equivalent.
To make a usable tool you should implement safeguards which is probably the hardest part of the task.
I have in the past done similar (without the safety check).
If you want new PARTUUID this is also simple and I have a script to do this but it could be included.
In practice the simplest for most normal OS would be to create a new SD from an image and rsync.
I used to use a similar procedure to update after modifying a SD Card (excluding a few files e.g. hostname) but now use SD Copier and fix hostname etc. after.
Statistics: Posted by Milliways — Tue Apr 23, 2024 12:42 pm