TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: R.WIESER
from: =?UTF-8?Q?BJ=C3=B6RN_LUND
date: 2019-03-06 09:44:00
subject: Re: Zeroeing out unused s

On 2019-03-06 07:50, R.Wieser wrote:
> Hello all,
>
> I'm intending to do a raw backup (alike DD do if I'm not mistaken) of the SD
> card on a Windows machine and than zipping it.  For that reason I would like
> to clear all unused sectors before making the copy, as than the zipping will
> result in the smallest possible file.
>
> Q: Does Stretch have a program available which can do that, and if so which
> is it ?

Find where your partition ends
(some clever use of fdisk is likely needed)

use dd and 'seek' option to offset the output, use /dev/zero as input

dd if=/dev/zero of=/your/card seek=some_offset

Now - I've never done it - so I don't guarantee it will work.
And I doubt that the space saved is worth the effort.

But in theory, it should be doable



--
--
Björn

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.