Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Aug 2015 09:13:59 -0600 (MDT)
From:      Warren Block <wblock@wonkity.com>
To:        Paul Kraus <paul@kraus-haus.org>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: USB stick and some help with it.
Message-ID:  <alpine.BSF.2.20.1508040910580.51177@wonkity.com>
In-Reply-To: <30011532-52BE-4C42-B062-5D1212EBE655@kraus-haus.org>
References:  <55BF6AA0.2030802@bananmonarki.se> <30011532-52BE-4C42-B062-5D1212EBE655@kraus-haus.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 3 Aug 2015, Paul Kraus wrote:

> On Aug 3, 2015, at 9:20, Bernt Hansson <bah@bananmonarki.se> wrote:
>
>> Have an old usbstick that i bought 5-6 years ago it's a datatraveler 150.
>>
>> I used dd to transfer a cd image to it and now i can't "clean" it of the stick.
>>
>> Tried dd if=/dev/random of=/dev/da1 bs=1m count=100 but dd just taunting me with this:
>>
>> dd: /dev/da1: Input/output error
>> 1+0 records in
>> 0+0 records out
>> 0 bytes transferred in 65.558710 secs (0 bytes/sec)
>
> I ran into this a bit ago with an SSD. Use gpart to add a partition map.
>
> gpart add gpt /dev/da1

Well, that particular combination of commands will not work.

If the memory stick still works (they do go bad sometimes), the most 
likely reason that writing fails is due to GEOM preventing it to protect 
an existing partition table.  gpart can be used to remove that.  This is 
important, because if there was GPT partitioning, writing a new MBR does 
not remove the backup GPT table at the end of the disk.  'gpart destroy' 
will remove that.

   gpart destroy -F /dev/zzqxy1

Substitute the device name as needed, but make sure you have the right 
one, as that command will remove the partitions and the partitioning 
metadata.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.20.1508040910580.51177>