Problem with shredding HDD

I am trying to shred my HDD which is connected to my computer with a USB 3.0 disk station.

The shredding keeps getting interrupted and it is showing some error with wrong offset. The drive regularly changes device file /dev/sdX (/dev/sdc to /dev/sdd) back and forth.
Because of this the shred program cannot finish. I got really close to finish once before it switched device file.

I have a disk that does that. When it happens, I wiggle the disk data cable, and it is good for a few months before it happens again.

Apparently, on some kinds of error, the device is disconnected and then reconnected. That’s probably what you are seeing.

Then it is shred that is causing this behaviour, or perhaps elsewhere.
I’ll use watch to monitor fdisk-l to check if it happens without using shred.

I suspect the problem occurs when accessing the drive. I have been monitoring fdisk and the device has not yet switched device file.

I have a 2TB HDD that needs shredding. It would probably take above 24hours (even at only default 3 iterations) Would suck if it would falter halfway through. Though I could try one single iteration, hope it manage to finish, and then try again.

D***. I got 10% shredding before it switched device file
shred: /dev/sdc: error writing at offset 49790891008: I/O-error

Not sure what I could do short of plugging the drive directly to internal SATA.

Somehow I have gotten a /dev/sdd4 written with aproc 191GB. Thinking perhaps I should just use dd to zero out the drive.

And I cannot delete the “partition” /dev/sdd4
"Operation not permitted on disk /dev/sdd

The partitioning on your disk /dev/sdd is either not readable or not supported by the partitioning tool parted used to change the partition table."

Hi
Overheating the USB 3.X port perhaps, switch to a USB 2.0 port and see if it occurs? Disk power down, not a green device, if so look at the hdparms.

The drive itself is hot, but nothing else I can detect.
It should not power down. It is a Western Digital Black 1TB HDD.


**mintaka:/home/djviking #** hdparm /dev/sdd

/dev/sdd:
 multcount     =  0 (off)
 readonly      =  0 (off)
 readahead     = 1024 (on)
 geometry      = 121601/255/63, sectors = 1953525168, start = 0

**mintaka:/home/djviking #** hdparm -C /dev/sdd

/dev/sdd:
 drive state is:  active/idle

hdparm has many DANGEROUS options…

Got to almost 20% before it got I/O-Error again. I think I will give up, this is just ridiculous.
I’ll put the drive in my server directly on SATA and then try again.

Hi
But what about the system your connecting to, could be the USB port/power cannot handle the sustained speed for two or three hours…

When the device it plugged in, how much power is it using;


lsusb -vv|grep power
lsusb -vv|grep bHubContrCurrent

You can forget about the grep to locate the specific port.

Check power management of the HDD;


hdparm -B /dev/sdX

If it’s 128 or greater it should be fine. There are also -M and -S read options -I for everything.

On Idle. Not running any shred yet on the drive.


**mintaka:/home/djviking #** lsusb -vv|grep power
    Per-port **power** switching
   Port 1: 0000.0100 **power**
   Port 2: 0000.0100 **power**
   Port 3: 0000.0100 **power**
   Port 4: 0000.0100 **power**
   Port 5: 0000.0100 **power**
   Port 6: 0000.0100 **power**
   Port 7: 0000.0100 **power**
   Port 8: 0000.0103 **power** enable connect
    No **power** switching (usb 1.0)
   Port 1: 0000.0503 highspeed **power** enable connect
   Port 2: 0000.0100 **power**
    No **power** switching (usb 1.0)
   Port 1: 0000.02a0 5Gbps **power** Rx.Detect
   Port 2: 0000.02a0 5Gbps **power** Rx.Detect
    No **power** switching (usb 1.0)
   Port 1: 0000.0100 **power**
   Port 2: 0000.0100 **power**
    Per-port **power** switching
   Port 1: 0000.0100 **power**
   Port 2: 0000.0100 **power**
   Port 3: 0000.0100 **power**
   Port 4: 0000.0100 **power**
   Port 5: 0000.0100 **power**
   Port 6: 0000.0100 **power**
    No **power** switching (usb 1.0)
   Port 1: 0000.0507 highspeed **power** suspend enable connect
   Port 2: 0000.0100 **power**
    Per-port **power** switching
   Port 1: 0000.02a0 5Gbps **power** Rx.Detect
   Port 2: 0000.02a0 5Gbps **power** Rx.Detect
   Port 3: 0000.02a0 5Gbps **power** Rx.Detect
   Port 4: 0000.02a0 5Gbps **power** Rx.Detect
    No **power** switching (usb 1.0)
   Port 1: 0000.02a0 5Gbps **power** Rx.Detect
   Port 2: 0000.02a0 5Gbps **power** Rx.Detect
   Port 3: 0000.0263 5Gbps **power** suspend enable connect
   Port 4: 0000.02a0 5Gbps **power** Rx.Detect
   Port 5: 0000.02a0 5Gbps **power** Rx.Detect
   Port 6: 0000.0203 5Gbps **power** U0 enable connect
    Per-port **power** switching
   Port 1: 0000.0100 **power**
   Port 2: 0000.0100 **power**
   Port 3: 0000.0100 **power**
   Port 4: 0000.0100 **power**
    No **power** switching (usb 1.0)
   Port 1: 0000.0100 **power**
   Port 2: 0000.0100 **power**
   Port 3: 0000.0507 highspeed **power** suspend enable connect
   Port 4: 0000.0100 **power**
   Port 5: 0000.0100 **power**
   Port 6: 0000.0100 **power**
   Port 7: 0000.0100 **power**
   Port 8: 0000.0100 **power**
   Port 9: 0000.0103 **power** enable connect
   Port 10: 0000.0100 **power**
   Port 11: 0000.0100 **power**
   Port 12: 0000.0100 **power**
   Port 13: 0000.0103 **power** enable connect
   Port 14: 0000.0100 **power**
   Port 15: 0000.0100 **power**

**mintaka:/home/djviking #** lsusb -vv|grep bHubContrCurrent
  **bHubContrCurrent**      0 milli Ampere
  **bHubContrCurrent**      0 milli Ampere
  **bHubContrCurrent**      0 milli Ampere
  **bHubContrCurrent**      0 milli Ampere
  **bHubContrCurrent**      0 milli Ampere
  **bHubContrCurrent**      0 milli Ampere
  **bHubContrCurrent**    400 milli Ampere
  **bHubContrCurrent**      0 milli Ampere
  **bHubContrCurrent**    100 milli Ampere
  **bHubContrCurrent**      0 milli Ampere

**mintaka:/home/djviking #** hdparm -B /dev/sdc  

/dev/sdc:
 APM_level      = not supported

**mintaka:/home/djviking #** hdparm -M /dev/sdc   

/dev/sdc:
 acoustic      = 254 (128=quiet ... 254=fast)
**mintaka:/home/djviking #** hdparm -I /dev/sdc    

/dev/sdc:

ATA device, with non-removable media
        Model Number:       WDC WD1001FALS-00J7B0                    
        Serial Number:      WD-WMATV4034899
        Firmware Revision:  05.00K05
        Transport:          Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5
Standards:
        Supported: 8 7 6 5  
        Likely used: 8
Configuration:
        Logical         max     current
        cylinders       16383   16383
        heads           16      16
        sectors/track   63      63
        --
        CHS current addressable sectors:   16514064
        LBA    user addressable sectors:  268435455
        LBA48  user addressable sectors: 1953525168
        Logical/Physical Sector size:           512 bytes
        device size with M = 1024*1024:      953869 MBytes
        device size with M = 1000*1000:     1000204 MBytes (1000 GB)
        cache/buffer size  = unknown
Capabilities:
        LBA, IORDY(can be disabled)
        Queue depth: 32
        Standby timer values: spec'd by Standard, with device specific minimum
        R/W multiple sector transfer: Max = 16  Current = 0
        Recommended acoustic management value: 128, current value: 254
        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6  
             Cycle time: min=120ns recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4  
             Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
        Enabled Supported:
           *    SMART feature set
                Security Mode feature set
           *    Power Management feature set
           *    Write cache
           *    Look-ahead
           *    Host Protected Area feature set
           *    WRITE_BUFFER command
           *    READ_BUFFER command
           *    NOP cmd
           *    DOWNLOAD_MICROCODE
                Power-Up In Standby feature set
           *    SET_FEATURES required to spinup after power up
                SET_MAX security extension
                Automatic Acoustic Management feature set
           *    48-bit Address feature set
           *    Device Configuration Overlay feature set
           *    Mandatory FLUSH_CACHE
           *    FLUSH_CACHE_EXT
           *    SMART error logging
           *    SMART self-test
           *    General Purpose Logging feature set
           *    64-bit World wide name
           *    Segmented DOWNLOAD_MICROCODE
           *    Gen1 signaling speed (1.5Gb/s)
           *    Gen2 signaling speed (3.0Gb/s)
           *    Native Command Queueing (NCQ)
           *    Host-initiated interface power management
           *    Phy event counters
                DMA Setup Auto-Activate optimization
           *    Software settings preservation
           *    SMART Command Transport (SCT) feature set
           *    SCT Read/Write Long (AC1), obsolete
           *    SCT Write Same (AC2)
           *    SCT Features Control (AC4)
           *    SCT Data Tables (AC5)
                unknown 206[12] (vendor specific)
                unknown 206[13] (vendor specific)
Security:  
        Master password revision code = 65534
                supported
        not     enabled
        not     locked
        not     frozen
        not     expired: security count
                supported: enhanced erase
        194min for SECURITY ERASE UNIT. 194min for ENHANCED SECURITY ERASE UNIT.  
Logical Unit WWN Device Identifier: 50014ee05710fa3f
        NAA             : 5
        IEEE OUI        : 0014ee
        Unique ID       : 05710fa3f
Checksum: correct

From what I could read from lsusb I think this is the drive:


Bus 004 Device 039: ID 174c:5106 ASMedia Technology Inc. Transcend StoreJet 25M3
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0  
  bDeviceProtocol         0  
  bMaxPacketSize0         9
  idVendor           0x174c ASMedia Technology Inc.
  idProduct          0x5106 Transcend StoreJet 25M3
  bcdDevice            0.01
  iManufacturer           2 ASMedia
  iProduct                3 AS2105
  iSerial                 1      WD-WMATV4034899
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           44
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0  
    bmAttributes         0xc0
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0  
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength           22
  bNumDeviceCaps          2
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000002
      Link Power Management (LPM) Supported
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x00
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat        2047 micro seconds
Device Status:     0x000d
  Self Powered
  U1 Enabled
  U2 Enabled


Hi
Interesting that is says APM is on in the list, yet says not supported in the -B option…

I have a 320GB device WD Black and it’s set to 128, I also have a 1TB WDC WD10JPVX-75JC3T0 which is also at 128.

I wonder if it can be set? What about spindown -S option.

Could it have something with that the drive is connected through a USB 3.0 disk dock.

Not sure what the -S option is all about.


**mintaka:/home/djviking #** hdparm -S /dev/sdc   
  -S: bad/missing standby-interval value (0..255)
**mintaka:/home/djviking #** hdparm -S 1 /dev/sdc  

/dev/sdc:
 setting standby to 1 (5 seconds)

I am running shred again. At 26% at alive…

Yes, I was able to get through one single pass with the shredder
shred: /dev/sdc: pass 1/1 (random)…932GiB/932GiB 100%

On Wed 31 Aug 2016 09:36:01 PM CDT, DJViking wrote:

Yes, I was able to get through one single pass with the shredder
shred: /dev/sdc: pass 1/1 (random)…932GiB/932GiB 100%

Hi
So if you unplug and power down the device (sdc), does it retain the -S
option or not?

So, maybe it was just luck,?


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
openSUSE Leap 42.1|GNOME 3.16.2|4.1.27-27-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

When I power down the USB docking station the device file /dev/sdX is gone so can’t check any hdparm -S on it.

It was probably just luck. I have been able to get through one pass before, but then I was running with default 3 iterations and it failed on the second pass.