From owner-freebsd-questions@freebsd.org Tue Aug 4 15:14:02 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD9149B3473 for ; Tue, 4 Aug 2015 15:14:02 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F7781371 for ; Tue, 4 Aug 2015 15:14:02 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id t74FE0VZ058425 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 4 Aug 2015 09:14:00 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id t74FDxYb058422; Tue, 4 Aug 2015 09:14:00 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Tue, 4 Aug 2015 09:13:59 -0600 (MDT) From: Warren Block To: Paul Kraus cc: FreeBSD Questions Subject: Re: USB stick and some help with it. In-Reply-To: <30011532-52BE-4C42-B062-5D1212EBE655@kraus-haus.org> Message-ID: References: <55BF6AA0.2030802@bananmonarki.se> <30011532-52BE-4C42-B062-5D1212EBE655@kraus-haus.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Tue, 04 Aug 2015 09:14:00 -0600 (MDT) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2015 15:14:02 -0000 On Mon, 3 Aug 2015, Paul Kraus wrote: > On Aug 3, 2015, at 9:20, Bernt Hansson 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.