04-02-2019, 04:40 PM
(03-30-2019, 04:15 PM)wood Wrote: You can always make your partitions smaller and just block copy the individual partition devices. As long as you make sure the partition table stays the same, things line up.By the way, it's a very bad habit. It begs for troubles with GPT, that already is used by Rockchip for example (and broadly used on PCs). Partition table shouldn't "stay the same" on reinstantiations as per the specification, because every instantiation of a GPT partition should produce a unique GUID, not matching any other GUID on this planet. Once you reset the GUID, CRC changes etc. This is not the only reason, but it's enough to say that dd-ing is just lame here, and is the worst thing that one could think out. Because when you "snapshot" something and move it wherever, you put something else instead, and it will need to have the same GUIDs for partition IDs - wrong, or you need to change the GPT header and Partition Array (and their mirrors), which dd-ing of course doesn't do. It's easy to overlook this duplicating and end up with two systems having the same GUIDs for unique partition IDs. If you move on another SD card, things get even worse, well at least because GPT puts a duplicate of the GPT header and Partition Array on the end of the device. what dd-ing? While it looks rather innocent, sooner or later, it will give you lemons. Even now it's seen here, how people get their eMMCs "shrunk" "unrecoverably" because of stupid old utilities go nuts facing with GPT. One needs to either make "snapshotting" on the file hierarchy level or have some script/utility that would take care of proper reinstantiating partitions. Unfortunately, with this "just dd it" habit, it will be a long way to go until everybody gets these simple things.
A long time ago I used to do this to snapshot the bootblock, boot, and root partitions of some systems that had to be rebuilt frequently. Since the layout never changed, I would just dd sda and set bs and count to copy to the end of the root partitions block. As long as it was going back to the same device/block layout. recovery was just another dd call.
ANT - my hobby OS for x86 and ARM.