On Fri, Jan 28, 2022 at 07:30:25AM -0600, Martin McCormick wrote:
> David Wright <deb...@lionunicorn.co.uk> writes:
> > I've not heard of that problem. You were prevented from zeroing the
> > entire device, which would have wiped the partition table anyway.
> > 
> > What I would want to check is that the OS isn't doing something
> > stupid, like trying to automount it, failing, and consequently
> > setting the device readonly. By OS, I really mean DEs, or
> > automounters in general.
> > 
> > You could also try zeroing it in another machine, ± any adapters
> > required. (Bear in mind that adapters do have readonly sliders.)
> 
>       I suspect this is the crux of the problem.  the adapter I
> connected is a card reader.  You put the SSD in a little plastic
> jacket that holds the SSD in such a way that the card reader can
> access the edge connector but the holder jacket has no electronics.
> There is a small notch in the plastic of the jacket on the left
> edge and the right front corner of the plastic carrier has a
> diagonal cut to prevent someone from putting it in upsidedown.
> 
>       Since I posted, there is good news but I still wonder if
> I am not going bonkers because after unplugging the Sony card reader
> and plugging it back in, I now am getting device /dev/sdg instead
> of /dev/sdh.  I was also able to do the following:
> 
>       #sudo fdisk /dev/sdg
> 
> which gave me the fdisk utility as before so I did what crazy
> people do which is to do the same thing as before, hoping for
> different results.
> 
>       By Joe, I got them.
> 
> I typed d to delete a partition and it put partition 2 up as the
> default candidate as before so I selected it and then typed d
> again which told me that only partition 1 was left so it was
> deleted.
> 
>       I had gotten this far before so wasn't too excited but type
> w and this time got the message stating that the partition table
> had been rewritten and fdisk then exited.
> 
>       Now, doing sudo fdisk -l /dev/sdg yields
> 
> 1wb5agz martin tmp $ sudo fdisk -l /dev/sdg
> Disk /dev/sdg: 28.8 GiB, 30908350464 bytes, 60367872 sectors
> Disk model: USB   HS-SD Card
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: dos
> Disk identifier: 0x680226ff
> 
>       The partitions are gone.  My latest screwball theory is
> that the Sony card reader went in to some sort of protective mode
> after the dd operation overwrote the device.  My unplugging the
> reader and plugging it back in reran the driver which reset the
> protective mode back to normal which may be why it all worked
> right this time.
> 
>       One last question:  Since the image will still be too
> large as it is, can tunefs be run on it or a copy of it to shrink
> about 4 gb of user space?  The good system I copied the image
> from only had about 12%  of the partition used so I should be
> able to transplant it to the smaller disk if tunefs can do that
> and still leave a bootable device.
> 
>       Thanks for all useful ideas.
> 
> Martin McCormick
>

I'd be tempted to set up a new Raspberry Pi OS lite system on the new card
[if you were using Raspbian before], expand it using raspi-config and then
copy the working image across to another system - and rsync between.

Or jsut say - meh - and install an up to date Raspberry Pi OS on the now
zeroed card and have done with it.

Raspberry Pi OS information from here is best endeavours provision only
and may be strictly off-topic :)

Andy C

All best, as ever,

Andy Cater 

Reply via email to