On Fri 27 Jul 2018 03:25:18 NZST +1200, Freek de Kruijf wrote:

> dev=sdX
> ssize=$(/usr/sbin/blockdev --getss /dev/$dev)
> [ $ssize -ne 512 ] && echo "Sector size not equal 512" && exit 1
> size=$(/usr/sbin/blockdev --getsz /dev/$dev)
> dd if=/dev/zero of=/dev/$dev obs=1 seek=$(($size - 2)) count=2

You'll need to use obs=512 instead of obs=1, if your intention is to
clear the last 2 blocks of th SD card.
If your intention was to clear the last 2 bytes of the card you'll need
to correct your calculation of the seek= parameter ($size * 512).

HTH,

Volker

-- 
Volker Kuhlmann
http://volker.top.geek.nz/      Please do not CC list postings to me.
-- 
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]

Reply via email to