Autor: John Morris Data: Dla: dng Temat: Re: [DNG] Solving simple problems in amazingly complicated ways
On Thu, 2020-03-12 at 21:45 +0000, Rainer Weikusat via Dng wrote: > - the sole purpose of this text is for the amusement of people who
> ever
> had to find a (preferably simple) solution for a complicated problem
> -
>
> Problem I had to deal with since yesterday: Some Debian 10 system (use
> of systemd mandated) installation I've created was to be captured by a
> certain image capturing tool running on Windows. As it turned out to
> be,
> this capturing tool has no support for Linux swap partitions and thus,
> tries to capture them by doing a sector-by-sectory copy of random junk
> which won't ever be of any use again.
>
> Proposed solution: Turn that into an ext4 filesystem, record the UUID,
> run a script at boot to convert it back to a swap partition. This
> could
> have been solved by suitable manipulation of /etc/rcS-symlinks but the
> mere thought of something as unsophisticated at that would cause
> systemd
> developers to start spinning until the reach escape velocity, never to
> be seen again - and who could possibly want that.
How about a simpler solution?
On shutdown:
1. Capture the label and UUID of the swap partition.
2. Do a swapoff.
3. Zero out the swap partition.
4. Remake it with the same label and UUID.
It will still get a sector by sector copy but assuming it is compressed
it will be of trivial size.