2

I recently acquired two 750gb HDDs. Not knowing the previous owner, I used dd to format them. Formatting them was easy, (dd bs=8M if=/dev/zero of=/dev/sdb) it went without a hitch, and I figured I'd boot the live USB I had.

The live usb booted, but neither drive is visible. Can't mount with mount -a or with mountall. I cannot see them in Gparted and they appear as 0GB in my BIOS. Using Ubuntu 14.04, 64 bit How can I revive them? Why did this happen?

Hellreaver
  • 505
  • 2
  • 8
  • 22
  • 5
    You know that dd's nickname is "diskdestroyer"? Is lsblk showing the drive? – Byte Commander Mar 20 '15 at 11:36
  • 1
    I have repaired a USB flash drive that was in a similar condition after using dd to format it, however I have never tried using the same method on an HDD. Here is a link to my answer: http://askubuntu.com/questions/496309/how-to-unboot-my-bootable-usb/496328#496328 Compared to madneon's answer, my method uses fdisk only to read the drive, not to write anything to it. – karel Mar 20 '15 at 12:51
  • @ByteCommander No, it does not – Hellreaver Mar 20 '15 at 23:47
  • As a 151 rep user yout should know by now that the more information you give, the better we can help... Could you please give us a bit more information like: what version of Ubuntu you're running? What the brand and model of the drives is? Please [edit] your question and add this information... – Fabby Mar 24 '15 at 15:13

3 Answers3

2

dd is "block copy" program, not formatter. Try using

sudo fdisk /dev/sdb

and create single primary partition with n command (then p and accept suggested values). Don't forget to write changes with w before quitting with q. This way fsck will create new Master Boot Record on that disk.

Then comes actual format process of your choice (initiating filesystem), eg. with GUI tool, or something like this:

sudo mkfs.ext4 /dev/sdb1 -L MyNewDrive
madneon
  • 1,983
  • 1
  • 13
  • 20
  • I used it to overwrite previously stored data, as I don't like knowing something may have been left behind. – Hellreaver Mar 20 '15 at 21:20
  • Try above steps, it should help. – madneon Mar 20 '15 at 21:28
  • The drive will not mount and does not show up in lsblk – Hellreaver Mar 20 '15 at 23:49
  • 1
    Than maybe its not a software problem indeed. If its SATA drive and your motherboard support hot-plugging (most likely it is) try to unplug and reconnect this drive while watching log like this: tail -f/var/log/syslog. Maybe that will give us some new clues. – madneon Mar 20 '15 at 23:56
  • When booting the live cd the bootup process (tail -f/var/log/syslog)? yields this error ata5: softreset failed (device not ready) – Hellreaver Mar 20 '15 at 23:59
  • I've used a usb to sata adapter to get the livecd to see it, but now i'm getting i/o errors. It also thinks that it's 2.2 tb – Hellreaver Mar 21 '15 at 01:12
  • I'm upvoting this answer for the attempt to explain that a filesystem is a protocol to talk to storage blocks on a drive, therefore partitioning and choosing a filesystem would be the right thing to do. If you feel uneasy about data on a pre-owned drive by ignoring how your open source system works, you don't look at SMART data of the particular drive and you are not one bit concerned about possible modifications or attacks on the firmware of the drive, then using dd isn't going to save you and purely esoteric. Do it if you have to, but don't cry for help when the result is a trashed drive. – LiveWireBT Mar 21 '15 at 07:28
  • @madneon Could you please edit your answer to reflect that there is also GPT besides MBR? – LiveWireBT Mar 21 '15 at 07:29
1

I am aware that hdd manufacturers write firmware on the hdd platters (it has been done like this since more modern drives have firmware requirements that outstrip the embedded controller storage availability).

I don't know if the firmware hides itself from you by offsetting addresses, and whether dd would be able to ignore or bypass such an offset, but if the drives worked before, and they don't work now, it sounds to me like you wiped a section of the drive firmware.

See http://www.databe.com/articles/article6.html for more info on the topic.

Louis Parkin
  • 213
  • 1
  • 11
  • 1
    And how to fix it, that I cannot say. The embedded part of the firmware can be accessed via the jumper pins on the back of the disk, but the platter will probably not spin up if the selftest fails. – Louis Parkin Mar 20 '15 at 12:29
  • I really don't see how this is helping the asker. Before including very technical detail about HDD firmware stored on the platters (I'm not saying it's wrong), you should check first if there is any indication that the firmware was erased or if the HDD is simply not connected properly (or worse SMART shows a failing HDD). Please take your time and visit [help] to learn how to use this site, like editing your answer instead of commenting on it. – LiveWireBT Mar 20 '15 at 13:58
  • I can confirm that the platters spin up, from lightly touching the hdd when booting – Hellreaver Mar 20 '15 at 15:44
  • A question to anyone who has up-voted this answer: If the assumption turns out to be correct and the firmware on the platters has been zeroed by dd, so it's not just a temporary issue of the drive acting up, what is your suggestion to fix this issue? If it's a drive with such a flaw, all responsible manufacturers usually inform their customers to not do X with affected products or recall them. In case of the typical private sale, chances for getting customer support or replacement under warranty terms aren't good, right? How is this related to Ubuntu? Do you still think this a good answer? – LiveWireBT Mar 21 '15 at 07:59
  • @LiveWireBT the user asked as part of his question why it happened. I think, if I read the answer I provided, that it speaks to that element of his question. Why, instead of contributing to the discussion, do you make such an issue about what I said? Don't you find it strange that two identical drives report a size of zero and can no longer be accessed after being cleaned in the same way? Is it not firmware that reports size, state, and provides access to the drive for an OS? Were you bullied at school? – Louis Parkin Mar 21 '15 at 18:40
  • @Hitsugaya198 No I don't find it strange that two used, abused and improperly handled 750GB drives, which we don't know any details about to determine if they actually are identical don't work any more. Without deeper investigation (which is anything but impossible) this should be labeled as coincidence or a user issue. One should not jump to conclusions and in the event of a serious hardware issue (like accidentally erased firmware) one should contact the manufacturer not random folk on the net is all I'm saying. Sorry if that kind of criticism is discomforting to you, I mean you no harm. – LiveWireBT Mar 22 '15 at 07:05
1

Was running dd really the first thing that came to your mind?

If you buy used hardware you should always check its condition visually before installing it. You don't want to damage your system by carelessly installing hardware with short circuits. After that you can install the hardware and check if it is detected properly by looking into system logfiles.

S.M.A.R.T.can be used to check the condition and wear of consumer HDDs and SSDs. You can run the Disks program from a live session which will display all SMART data for each drive in a submenu. The general recommendation is, if any of these values is not okay, then you shouldn't use the drive any longer and try to backup what you can. ddrescue is recommended over dd, but it should be noted that such programs put very much stress onto a device, so using dd to "format" a drive in an unknown condition may not be a good idea in the first place.

A similar question has been posted on the Unix & Linux site of the StackExchange network (which AskUbuntu is part of): Hard disk drive disappeared

LiveWireBT
  • 28,763
  • I used dd to overwrite the existing data. – Hellreaver Mar 20 '15 at 20:08
  • @Hellreaver There is no point in repeating that statement, unless you want to make a fool out of yourself. Did you look at smart data before using dd and were you 100 percent sure that this was a safe operation to do on a disk in state state? Have you searched online for the softreset failed message? Is there any relation to that particular model of drive you haven't told us? Note that I don't like troubleshooting issues the esoteric way. It is just a waste of my time. If you want my help, then give me something to work with. – LiveWireBT Mar 21 '15 at 04:40