[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Repair bootable USB stick



On 2020-02-09 14:27, Thomas Schmitt wrote:
   dd if=/dev/zero bs=512 count=2 of=/dev/sdc

When I want to zero-fill a USB flash drive:

1 1M = 1024*1024 byte blocks read and write much faster than 512 byte blocks.

2.  I zero-fill the whole flash drive (by omitting 'count'):

    a.  Get rid of any leftovers from any source, known or unknown.

    b.  Verifies fast.

    c.  Once I have written an image:

        i.  I know that non-zero bytes came from the image.

        ii. If I take an image later, zeroes compress nicely.

3. Debian provides human-readable /dev/disk/by-id device nodes. Using them reduces the chance that I will blow away the wrong drive.


So, I would suggest the following (adjust device node to suit):

# time dd if=/dev/zero bs=1M of=/dev/disk/by-id/usb-SanDisk_Ultra_Fit_xxxxxxxxxxxxxxxxxxxx-0\:0


Optional:

4.  'status=progress'

5.  'time dd ....'


David


Reply to: