On 7/1/21 7:55 PM, David Wright wrote:
On Mon 28 Jun 2021 at 13:36:35 (-0700), David Christensen wrote:I do not set the 'discard' (trim) option in fstab(5). If and when I want to erase unused blocks (such as before taking an image), I use fstrim(8).Can you elaborate on a couple of things: How do you "take an image". Is this equivalent to a conventional dd if=/dev/sda …, or to some other process?
I wrote a script. To "take an image", the script invokes dd(1) and pipes the output to gzip(1), copying raw device octets to a file. To "restore an image", the process is reversed.
When I copy an entire conventional drive or partition, all the free blocks/unused sectors are carefully transferred to the copy.
Same here.
What improvement does erasing unused blocks achieve?
Zero blocks are readily compressed, reducing the size of the image file. David