SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-07-04 18:26:57

audune
Member
Registered: 2012-06-22
Posts: 20

Did dd kill my disk?

Hi all. I did sudo dd if=/dev/zero of=/dev/sdg bs=1M to wipe an external drive and now it seems broken. Cannot create partition table, get input/output errors. Did I do anything wrong? Can I do anything to fix it?

Offline

Be excellent to each other!

#2 2013-07-04 18:28:28

arkanabar
Member
Registered: 2009-11-29
Posts: 19

Re: Did dd kill my disk?

gparted has been able to reformat thumb drives for me when I've loaded them with dd.

Offline

#3 2013-07-04 18:36:18

audune
Member
Registered: 2012-06-22
Posts: 20

Re: Did dd kill my disk?

gparted does occasionally show the disk, but fails to create partition table.

Offline

#4 2013-07-04 19:27:36

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 12,497

Re: Did dd kill my disk?

man cfdisk snippet:

COMMANDS
       cfdisk commands can be entered by pressing the  desired  key  (pressing
       Enter  after  the  command  is  not  necessary).  Here is a list of the
       available commands:

 ...

       W      Write partition table to disk (must  enter  an  upper  case  W).
              Since  this might destroy data on the disk, you must either con‐
              firm or deny the write by entering `yes' or `no'.  If you  enter
              `yes',  cfdisk  will  write  the partition table to disk and the
              tell the kernel to re-read the partition table  from  the  disk.
              The  re-reading  of  the  partition  table does not work in some
              cases, for example for  device-mapper  devices.   In  particular
              case  you  need  to  inform kernel about new partitions by part‐
              probe(8), kpartx(8) or reboot the system.

...might help you get out of this jam with a working hard drive...


I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#5 2013-07-04 20:59:40

audune
Member
Registered: 2012-06-22
Posts: 20

Re: Did dd kill my disk?

Thanks guys. Still no luck.
I enter "sudo cfdisk /dev/sdb" and get:

fatal error: cannot read disk drive
press any key to exit cfdisk

If started with no disk specified "sudo cfdisk", it only shows my other drives. Not the damaged one.

Last edited by audune (2013-07-04 21:01:53)

Offline

#6 2013-07-04 21:23:08

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 12,497

Re: Did dd kill my disk?

Note:  I understand the next question will sound like "Help Desk 101".  I'm just trying to be thorough.

Have all the previous attempts been done without disconnecting the USB drive?  If so, you might want to try unplugging it, and maybe even rebooting the system.


I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#7 2013-07-05 05:27:38

audune
Member
Registered: 2012-06-22
Posts: 20

Re: Did dd kill my disk?

Thanks for being thorough. Yes I unplugged and rebooted, and tried it on 4 different machines. I guess it doesn't look good. It's a 1TB passport drive powered through micro USB.

gparted

Last edited by audune (2013-07-05 06:02:39)

Offline

#8 2013-07-05 09:58:31

brontosaurusrex
#! Red Menace
Registered: 2012-06-15
Posts: 1,176

Re: Did dd kill my disk?

audune; Are you starting gparted as "sudo" ?

Offline

#9 2013-07-05 10:03:29

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,602

Re: Did dd kill my disk?

Try to create a valid MBR on the disk using syslinux

1. Install package syslinux

sudo apt-get install syslinux

This installs a valid mbr image in file /usr/lib/syslinux/mbr.bin

2. now use dd to copy that bin image to the disk

sudo dd if=/usr/lib/syslinux/mbr.bin /dev/sdx

WARNING: Replace sdx with the correct device name.

3. now run gparted on the disk.

hth

Last edited by xaos52 (2013-07-05 10:04:21)

Offline

#10 2013-07-05 10:54:08

audune
Member
Registered: 2012-06-22
Posts: 20

Re: Did dd kill my disk?

You gave me hope xaos52. Unfortunately I get this:

sudo dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdb
dd: writing `/dev/sdb': Input/output error
0+1 records in
0+0 records out
0 bytes (0 B) copied, 0.0402689 s, 0.0 kB/s

Will try some more...

Offline

#11 2013-07-05 11:40:05

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,602

Re: Did dd kill my disk?

Post output of

dmesg|grep sdb

please, preferably after a reboot and with the external disk plugged in.

Offline

#12 2013-07-05 13:10:12

audune
Member
Registered: 2012-06-22
Posts: 20

Re: Did dd kill my disk?

dmesg|grep sdb


[   18.561239] sd 4:0:0:0: [sdb]  Sense Key : Aborted Command [current]
[   18.561244] sd 4:0:0:0: [sdb]  Add. Sense: No additional sense information
[   18.561249] sd 4:0:0:0: [sdb] CDB: Read(10): 28 00 00 00 00 78 00 00 08 00
[   18.561259] end_request: I/O error, dev sdb, sector 120
[   18.601362] sd 4:0:0:0: [sdb]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE


was repeated many times in terminal

Offline

#13 2013-07-05 14:27:48

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,602

Re: Did dd kill my disk?

Have you tried on another USB port?

If you experience the same problem, try this in a terminal window

    sudo badblocks -wvs /dev/sdX

While that is running, open another terminal window and watch your logfile

    run sudo tail -f /var/log/syslog

Check for loops - if it repeats the same sector over and over again, then the error is irrecoverable.

Warning: running badblocks on a 1 TB USB HD can take a long time. Say 24 hours at least.

hth

Offline

#14 2013-07-05 17:11:40

kbmonkey
#! Die Hard
Registered: 2011-01-14
Posts: 836
Website

Re: Did dd kill my disk?

audune wrote:

[   18.561259] end_request: I/O error, dev sdb, sector 120

That certainly looks like either a drive failure or a faulty usb cable. It may just be coincidence that it happened during your dd venture. To test the drive health, install gsmartcontrol - most modern drives come with built-in SMART technology that reports on a drive's health status. You can probe this.

gksu gsmartcontrol

Although it is debatable if your drive will show up in this tool if it broken beyond detection - but the /dev/sdb assignment you get makes this hopeful.

Offline

#15 2013-07-05 19:41:38

audune
Member
Registered: 2012-06-22
Posts: 20

Re: Did dd kill my disk?

Thanks guys. At least I'm learning something from this. I cannot run gsmartcontrol, I get :  GLib-CRITICAL **: g_str_has_prefix: assertion `str != NULL' failed
Does that just mean that i can't find the program? Will now try badblock scan overnight.
I did wipe a harddisk some years ago with a tool from UBCD or Hirens boot cd or something. Cannot rememger the name of the program, But it also killed my disk. Is wiping a risky task? Is the dd method a good one? Seems to be reccommended by many which is why I chose it. From now on I will encrypt the drives from start so I don't have to wipe them.

Offline

#16 2013-07-06 09:13:35

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,602

Re: Did dd kill my disk?

Here is what I do to swipe a disk:
1. wipe the filesystem(s) with

sudo mkfs.ext4 /dev/sdxn

replace x by the drive name.
replace n by the partition number. repeat for every partition on the device.

2. create a file with random data in your current dir using dd

dd if=/dev/random of=./random.data count=500 bs=1M

3. fill every partition on the disk with this script:

mkdir -p /media/sdxn
mount /dev/sdxn /media/sdxn
for n in 1..10000; do
cp ./random.data /media/sdxn/$n
done

run  the script as root for each partition on the device.

4. repeat 1 to clear the disk space.

Result: empty disk with random data without touching the mbr. use gparted to repartition.

PS: I wrote this from the top of my head - does one say that in English? - so it may need some minor corrections.

gsmartcontrol works for my system - waldorf upgraded to sid.
Will check if it works on a fresh waldorf install.

Good luck

Offline

#17 2013-07-06 09:21:38

audune
Member
Registered: 2012-06-22
Posts: 20

Re: Did dd kill my disk?

Thanks for the tip!
I got gsmartcontrol working, but it says my drive is not supported. Still running "badblocks", apparently without loops so far.

Offline

#18 2013-07-06 09:52:00

Forthy
#! CrunchBanger
From: Warwickshire, UK
Registered: 2012-01-16
Posts: 184

Re: Did dd kill my disk?

xaos52 wrote:

PS: I wrote this from the top of my head - does one say that in English?


It's usually 'off' rather than 'from', but that would be pedantic  tongue

Awesome tip, thanks.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo