You are not logged in.

#1 2013-01-31 20:51:21

NaOH
Member
Registered: 2013-01-31
Posts: 18

Possibly dead HDD doesn't boot Arch

Hi!

So, I was using my system as always, and I was trying to install a package with yaourt, but, after downloading all the files, just before compiling, it complained about not being able to write to the disk, my first thought, even though unlikely, was that the disk was full, but it wasn't. My second thought was to upgrade the system and see if it was a problem with yaourt, but when I ran pacman -Syu it also complained of not being able to write once the packages had been downloaded, while trying to install them (among the upgrades it was doing there was a linux image upgrade). So I decided to reboot the system, but once it shut down, it never turned on again... Well, at least it never booted again to Arch Linux.
The MBR is loading just fine, syslinux loads, but fails when trying to load Arch, it says it's waiting 10 seconds for the device sda2 (which is where the root directory is) and it fails... I tried the Hardware Detection Tool from syslinux and it correctly recognizes the HDD and its partitions (one for storage for Windows, and three for linux (sda2, the bootable, sda3 swap, and sda3 /home). I also tried booting from windows (which is installed in another HDD which I only plug-in when I need Windows) but, even though it booted perfectly, because it is installed in another HDD, it recognized the problematic HDD, but it's impossible to access it, and the system becomes laggy and unstable when trying to access it or just when opening "Computer" because it tries to get information such as the available space, etc.
I don't know whether the HDD died, or it's data got corrupted, either way, what do you recommend to do? What tools are available to check the disk for problems? (I tried to do so from windows but it'd just complain about not being able to access the device)
So my first guess to try and solve this would be to boot from a Live CD, but once I do so, what shall I do? And also, what Live CD do you recommend for such a task?

Thanks in advance!

Santiago.-

PS: Retrieving the data from the /home partition would be great, but getting the HDD to work, even if I lose everything that's stored in it, would be fine too...

Offline

#2 2013-01-31 21:28:43

chris_l
Member
Registered: 2010-12-01
Posts: 387

Re: Possibly dead HDD doesn't boot Arch

Get a new disk and do a backup of the entire disk using dd there. Read about it here: https://wiki.archlinux.org/index.php/Disk_Cloning

Like the wiki article says, be careful typing the commands, if you put the if and of backwards, you'll be destroying your data.

Once you are done, try to pass fsck to your problematic disk. With some luck, you'll filesystem is only corrupted, and that would fix it.

If not, then dump the disk and try to fix the file system on the new one.


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#3 2013-02-01 00:36:36

NaOH
Member
Registered: 2013-01-31
Posts: 18

Re: Possibly dead HDD doesn't boot Arch

Thanks for your reply!
I booted with the CD I used to install Arch, but when trying to run dd I got a lot of messages like this:

exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
BDMA stat 0x64
Failed command: READ DMA
something with a long number
status: { DRDY ERR }
error: {UNC }
end request: I/O error

dd is still running so I don't know the final result. HOWEVER, before running dd, I SUCCESSFULLY mounted a partition of the disk, and I was able to see its contents with "ls" and even read a file with "nano", so, if I was able to mount it, access it, and read a file, I guess that the filesystem is OK (also I run fsck but I don't know if it actually did something because it just ended almost immediately and said something like "/dev/sda2: clean")

In conclusion: the data on the disk is apparently accessible, but it just won't work. Also, after running fsck, I had some troubles booting again from the CD, it would output similar errors to the ones that dd produced, and won't boot, after several times, and trying to boot from the HDD, it finally booted from the Arch CD.

What could cause this? Is dd actually copying an image of the disk, or is it failing? What do you recommend me to do? I'm thinking of maybe testing the HDD tomorrow in a friend's computer and see if it can be read (by the way, I tried switching the SATA cables with my other (working) HDD but it didn't work either, so I'm pretty sure it is a problem with the HDD)

Thanks in advance for your help!

Offline

#4 2013-02-01 01:07:29

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 14,763
Website

Re: Possibly dead HDD doesn't boot Arch

Just so we can all get on the same page, can you (from a live CD), post the output of `fdisk -l` and -- after mounting all the partitions -- `df -h`


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#5 2013-02-01 02:11:37

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,675

Re: Possibly dead HDD doesn't boot Arch

ddrescue *might* be more successful than dd if there are problems with the disk.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#6 2013-02-01 03:50:49

NaOH
Member
Registered: 2013-01-31
Posts: 18

Re: Possibly dead HDD doesn't boot Arch

Trilby wrote:

Just so we can all get on the same page, can you (from a live CD), post the output of `fdisk -l` and -- after mounting all the partitions -- `df -h`

Here it is:
2.jpg
1.jpg
sda is the failing disk.

cfr wrote:

ddrescue *might* be more successful than dd if there are problems with the disk.

from the ddrescue manual:

ddrescue Manual wrote:

IMPORTANT! Never try to repair a file system on a drive with I/O errors; you will probably lose even more data.

Does that refer to using fsck? So I should use ddrescue to create an image of the disk and try and recover data from there, right? Can I use ddrescue to write the image to a file rather than to an entire partition or disk?

ddrescue Manual wrote:

If you are trying to rescue a whole partition, first repair the copy with e2fsck or some other tool appropiate for the type of partition you are trying to rescue, then mount the repaired copy somewhere and try to recover the files in it.

Should I do that? Try and recover the files from the mounted partition? Or should I first create the image and then try to do so?

Thanks again!

Santiago

Offline

#7 2013-02-01 22:30:48

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,675

Re: Possibly dead HDD doesn't boot Arch

The key thing is that you work on a COPY. I can personally confirm that trying to repair a filesystem when you have I/O errors can lead to greater data loss. (In my case, the filesystem was probably not even in need of repair before I started but I still created a great deal of mess. Fortunately, I had a recent backup to restore from.)

Please post the information Trilby requested. I, at least, cannot see whatever you think you've posted.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#8 2013-02-02 02:09:47

NaOH
Member
Registered: 2013-01-31
Posts: 18

Re: Possibly dead HDD doesn't boot Arch

cfr wrote:

Please post the information Trilby requested. I, at least, cannot see whatever you think you've posted.

Sorry about that, how about now?

http://i.imgur.com/oKhaQtb.jpg

http://i.imgur.com/3OSRFnF.jpg

I have only one question left: is it possible/recommended to copy the image into a file? or is it mandatory to copy the image into another disk? Assuming I create the image on a file, then I would mount it, and try and recover as much as data as I can, right? And then just copy the data into a new disk. And finally, I read that cooling the disk would improve the situation, do you know if that's true?

Thanks again for your attention, I really mean it!

Moderator edit: Those images are far too big. Reduced to their urls.

Last edited by bernarcher (2013-02-02 07:28:28)

Offline

#9 2013-02-02 02:33:00

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,675

Re: Possibly dead HDD doesn't boot Arch

Oh, hang on. They don't work like links but I can drag them to a new tab. Weird.

As far as I know, dd does a low level copy block to block. I'm not sure what file/image quite you have in mind.

Obviously, if your disk is having trouble, you should copy to another disk!

I've heard that about temperature, too. I've never tried it but I've read it enough times that I would try it if I needed to recover data and was having trouble doing so. (I've had exactly one disk die on me and smartmon tools gave me enough warning to get the lot off in normal fashion so I've never tried the cooling trick. But, as I say, I would. What do you have to lose?)


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#10 2013-02-02 02:48:06

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 14,763
Website

Re: Possibly dead HDD doesn't boot Arch

dd can copy to a file just fine - but that file would have to be on a drive that has sufficient space.  The output file will not be the size of the data currently on the input drive, it will be the complete size of the input drive (looks like 232GB).


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#11 2013-02-04 01:38:39

NaOH
Member
Registered: 2013-01-31
Posts: 18

Re: Possibly dead HDD doesn't boot Arch

Thank you both for your help!
I finally managed to salvage the two linux partitions, for the windows partition and the MBR it was too late. Both salvaged partitions were copied with ddrescue with a final errsize of 0 bytes and no errors left, they can be mounted without any trouble and apparently are just fine.
I have some new questions, should I now mount the images and run fsck to check if everything is alright? Once I get a new disk, shall I copy all the contents of the images with "cp" to the new, pre-partitioned, pre-formatted, disk or shall I use dd or ddrescue once again to copy the entire image? I'm guessing that if fsck doesn't return any error I could use "cp" over "dd" to avoid having to copy the entire image instead of just copying the actual files. Am I right?

Thanks again for all your help!

Sincerely,
Santiago.-

PS: One last question, and this is a personal one, would you recommend me to install grub or syslinux on the new disk?

Offline

#12 2013-02-05 00:59:05

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,675

Re: Possibly dead HDD doesn't boot Arch

Use rsync -aAXv.

You will lose some information with cp even with the -a option.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#13 2013-02-05 01:33:54

NaOH
Member
Registered: 2013-01-31
Posts: 18

Re: Possibly dead HDD doesn't boot Arch

I've read that just after having used cp -a, bad timing. I based my decision on https://wiki.archlinux.org/index.php/Di … g#Using_cp. Can I run rsync -aAXv over the already copied files to just copy the information or must I copy everything again using rsync this time? In that case, for the sake of the new disk health, should I use "rm *" or mkfs to empty the partition again?

Offline

#14 2013-02-05 01:39:21

NaOH
Member
Registered: 2013-01-31
Posts: 18

Re: Possibly dead HDD doesn't boot Arch

Never mind, I'll just mkfs the partition and then use rsync -aAXv.

Once again, thank you!

Offline

#15 2013-02-05 03:41:50

NaOH
Member
Registered: 2013-01-31
Posts: 18

Re: Possibly dead HDD doesn't boot Arch

I'm writing once again from my beautiful Arch system smile
Thanks again for the help.
And an odd thing happened, while installing grub I've got some errors from pacman complaining about some files in /sys/fs/... and after booting to the system, GNOME wouldn't start, I had to re-install the nvidia drivers from TTY2. I hope there are no more loose things around...

Offline

#16 2013-02-06 00:57:16

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,675

Re: Possibly dead HDD doesn't boot Arch

I realise it is too late but for future reference, you could have just used rsync over the top.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

Board footer

Powered by FluxBB