You are not logged in.

#1 2019-06-23 09:10:45

Hamsterkill
Member
Registered: 2009-05-05
Posts: 67

Error during zeroing causing disk to be detected wrong

I was zeroing a 240GB SSD in an external enclosure using dd, but it threw an input/output error after about 16GB. Now, fdisk and dd only detect the drive as 16GBs and claim out of space at that point when I try to zero again. Running dmesg shows the actual size of the drive is detected, still, and is reported correctly by lsblk. I obviously don't care about the data on this drive, but I would like to be able to use the full size again. Running smartctl doesn't work on the drive in the current state, either. Does anyone know of a way to fix the way these applications are seeing the disk?

Offline

#2 2019-06-23 10:01:26

seth
Member
Registered: 2012-09-03
Posts: 51,213

Re: Error during zeroing causing disk to be detected wrong

Running smartctl doesn't work on the drive in the current state, either.

Eewww…
Did it work before? What exat model is the disk? dmesg?

sudo hdparm --dco-identify /dev/sdX

Since you don't care  about the data, you can attempt hdparm to restore the factory defaults, but BE VERY CAREFUL and READ EVERY COMMAND you pass to hdparm THRICE and make sure to UNDERSTAND WHAT EACH COMMAND DOES as well as any POTENTIAL HARM on misuse!
The program has the absolute capacity to brick your drive!

Edit: also

sudo hdparm -N /dev/sdX

Last edited by seth (2019-06-23 10:02:56)

Offline

#3 2019-06-23 10:27:06

Hamsterkill
Member
Registered: 2009-05-05
Posts: 67

Re: Error during zeroing causing disk to be detected wrong

seth wrote:

Running smartctl doesn't work on the drive in the current state, either.

Eewww…
Did it work before?

Pretty sure it used to.

What exat model is the disk? dmesg?

It's a PNY Prevail Elite 240GB that I stuck in an external USB enclosure recently. After the intial dd failure, it was giving me -110 errors in dmesg (which I understand to be power-related), so I pulled it out of the external enclosure and am using it via a Kingwin GZ-connect as the SATA-USB bridge as it allows a separate power connector.

dmesg now shows:

[12413.747202] usb 1-8: new high-speed USB device number 6 using xhci_hcd
[12413.971283] usb 1-8: New USB device found, idVendor=05e3, idProduct=0718, bcdDevice= 0.41
[12413.971286] usb 1-8: New USB device strings: Mfr=0, Product=1, SerialNumber=2
[12413.971288] usb 1-8: Product: USB Storage
[12413.971289] usb 1-8: SerialNumber: 000000000033
[12413.981147] usb-storage 1-8:1.0: USB Mass Storage device detected
[12413.981346] scsi host11: usb-storage 1-8:1.0
[12414.998048] scsi 11:0:0:0: Direct-Access     SSD2SC24 0GE2DA16B-T      0041 PQ: 0 ANSI: 0
[12414.998307] sd 11:0:0:0: Attached scsi generic sg4 type 0
[12414.998741] sd 11:0:0:0: [sde] 468862128 512-byte logical blocks: (240 GB/224 GiB)
[12415.000279] sd 11:0:0:0: [sde] Write Protect is off
[12415.000280] sd 11:0:0:0: [sde] Mode Sense: 03 00 00 00
[12415.002293] sd 11:0:0:0: [sde] No Caching mode page found
[12415.002294] sd 11:0:0:0: [sde] Assuming drive cache: write through
[12415.011302] sd 11:0:0:0: [sde] Attached SCSI disk
[12445.159236] audit: type=1131 audit(1561279858.754:81): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
sudo hdparm --dco-identify /dev/sdX
$ sudo hdparm --dco-identify /dev/sde

/dev/sde:
 HDIO_DRIVE_CMD(dco_identify) failed: Inappropriate ioctl for device

Edit: also

sudo hdparm -N /dev/sdX
$ sudo hdparm -N /dev/sde

/dev/sde:
 HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device

And because I didn't show it earlier:

$ sudo fdisk -l /dev/sde

Disk /dev/sde: 15.68 GiB, 16817700864 bytes, 32847072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Last edited by Hamsterkill (2019-06-23 10:28:31)

Offline

#4 2019-06-23 10:43:02

seth
Member
Registered: 2012-09-03
Posts: 51,213

Re: Error during zeroing causing disk to be detected wrong

That drive has 16GB modules…

I'd try w/ a direct sata connection and if it still show this behavior to update/flash/reset the firmware (as it apparently doesn't respond to smart & hdparm ioctls and you can only access one module which is now basically an sd card)

Offline

#5 2019-06-23 10:47:58

Hamsterkill
Member
Registered: 2009-05-05
Posts: 67

Re: Error during zeroing causing disk to be detected wrong

I'll give it a try when I can. Thanks.

Offline

#6 2019-06-23 11:22:13

frostschutz
Member
Registered: 2013-11-15
Posts: 1,418

Re: Error during zeroing causing disk to be detected wrong

dmesg seems to be showing correct size and dmesg usually does not lie

$ blockdev --getsize64 /dev/sde
240057409536

if that's a different size then... that was old output in the dmesg? wrong device name?

otherwise bad luck, if possible try without usb enclosure that can be a failure point as well

Offline

#7 2019-06-23 11:44:20

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Error during zeroing causing disk to be detected wrong

A lot of the controller chips in external enclosures don't handle SMART very well (or at all). Connect the drive directly instead if possible.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

Board footer

Powered by FluxBB