LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Can't mount disk--could be damaged? (https://www.linuxquestions.org/questions/linux-hardware-18/cant-mount-disk-could-be-damaged-573937/)

grittyminder 08-01-2007 09:31 AM

Can't mount disk--could be damaged?
 
I have (had) an ordinary IDE drive attached to an USB adapter that operates like an external hard drive. A little while back the thing stopped working :( I think the problem may be with the disk but I'm not entirely sure how to go about identifing the specific area/component that is broken. I took the drive out and attached it to my Ubuntu 6.06 server but was unable to mount it (I think that Ubuntu was unable to identify the file system type?). I think that the file system is ntfs... I tried using file to confirm the file system type but the terminal prompt freezes. When I restarted the server I got a bunch of I/O errors from the disk. I have some family pictures on the drive--I really, really don't want to loose any data--so I'm afraid to try anything else on my own. What steps should I take to identify the problem and save my data?

b0uncer 08-01-2007 09:57 AM

First good step is to make an image out of the disk; after this you can work on the image, leaving the original disk untouched, and not worry about wrecking it any more. Note that the image will be as large as the disk itself, so you'll need a (lot) bigger HD to place the image on. If the harddisk's (that you want to make the image from) device file was /dev/hda (primary [a] IDE [h] disk [d]), and you wanted the image to be put in /home/username/backup.imgage, you could use
Code:

dd if=/dev/hda of=/home/username/backup.image
Note that the file is really going to be as big as the drive's capacity (every bit is copied), and that the operatin is going to take pretty long. However after that you can operate on the image instead of the disk itself; to try and mount the image to /home/username/image_mountpoint/, first create the directory and then
Code:

mount -o loop /home/username/backup.image /home/username/image_mountpoint
If it works, once you've done with it, umount it:
Code:

umount /home/usernae/backup.image
Then you can start thinking what's wrong. If it is really valuable data, you may have to take the drive to a professional place where they know how to recover the data. In some cases, if it's badly damaged, they may have to open it and deal with the discs one by one. That stuff is expensive, but sometimes the only way when "home made things" don't work.

grittyminder 08-01-2007 06:56 PM

Make a back up image of the drive... that's probably the first thing I should have done. What a noodlehead I am. Thanks for the tip--I'll get working on that once I get home.

grittyminder 08-04-2007 01:09 AM

It's the weekend so I finally have time to work on this. A quick question: would dd_rescue be a better choice than dd?

syg00 08-04-2007 01:24 AM

Yes.
And ddrescue possibly even better again.

Depends on requirements. A bare "dd" like that can be a bit limited if there are errors on the disk.

ngjunkie0011 08-04-2007 01:49 AM

Quote:

dd if=/dev/hda of=/home/username/backup.image
OK, I have a hard drive that sometimes works and sometimes doesn't.

It used to be a Master Secondary HD but I'm going to remove the other HD and just have that HD on my machine and plan on booting up using a SuSE rescue CD.

How would I back up the image to an external USB HD?

How would I mount the USB Hard drive first?

And then how I would back up the image onto the USB HD? The USB HD is FAT 32 with about 30 gigs available. The HD I'm trying to back up has 20 gigs.

grittyminder 08-04-2007 08:18 AM

Okay, I've identified part of the problem. Partway through running ddrescue on the disk the server seems to always want to freeze. I wasn't sure if the freezing issue was related to the bad disk or something else, so I decided to investigate a little. It turns out that the problem is on the server-side (I was able to reproduce the freeze by making a copy of a multi-gig file already located on the server). I thought the problem might be raid related (the server has software mirrored raid configured). So I reinstalled linux--something I'd been wanting to do anyways--again with mirrored raid. Unfortunately, the same freezing issue still crops up. I noticed that when running ddrescue that it would work in short 'bursts.' Specifically, it would read from the target disk/file for about half a second, then pause for a little bit less than half a second, then continue again. I don't know if this is normal behavior--it does seem unusual. Could the latency be from the raid synching up the disks? I think that what I'm going to do next is disconnect the non-primary raid drive and try again with just one disk. If anybody has any better ideas, please pipe up!

grittyminder 08-04-2007 09:51 PM

Alright, clearly I've got server problems. The bad disk issue still exists, but the server keeps freezing on the file copy. I'm going to start a new thread for this because it has nothing to do with the original problem...

syg00 08-04-2007 10:22 PM

Quote:

Originally Posted by ngjunkie0011
How would I back up the image to an external USB HD?
How would I mount the USB Hard drive first?
And then how I would back up the image onto the USB HD? The USB HD is FAT 32 with about 30 gigs available. The HD I'm trying to back up has 20 gigs.

I don't understand the first two questions. If the liveCD doesn't mount the USB automatically (it should these days), mount it manually. Then just proceed as above.
FAT32 isn't going to be any good - the resultant image will be a file, and FAT32 is limited to 4 Gig.

syg00 08-04-2007 10:26 PM

@grittyminder I've seen plenty of threads re RHEL servers slowing down like that on NFS transfers. Sounded like drivers were under suspicion - never saw an answer, but then I wasn't that interested either.
Might be worth doing some searching.

grittyminder 08-05-2007 09:48 AM

I've pretty much come to the conclusion that my server is screwed up. I'm ordering a new external SATA hard disk enclosure, which is where I plan on copying bad disk image.

While I wait for the shipment to arrive, I guess I might as well ask a question. But first, I'll try to give a little more background information on the problem... I had't realized it before, but I guess that the bad disk first started misbehaving when I tried to make a multi-gig copy from the disk to the (screwed up) server and it froze partway through the operation (I've come to discover that this is "normal" behavior for this server). Fast forward to a few days ago--when I tried to mount the bad disk the server told me that it could not identify the file system type and could not mount (when I specified the NTFS as the file system type I got errors of a different type--maybe checksum and a few others...). But when I tried running ddrescue on the bad disk I noticed it wasn't finding any errors. So could it be that the disk isn't actually bad, but rather there is merely file corruption somewhere? Would fsck solve the problem? I should probably run fsck on a disk image, rather than the disk itself, just to be safe?

syg00 08-05-2007 11:39 PM

Try using "file -s /dev/hda3" (whatever) - should give you an idea what it is.

To check the filesystem, try ntfsfix (ntfsprogs), Then boot into Windoze so it'll schedule a chkdsk for you

grittyminder 08-10-2007 09:16 PM

It's the weekend so I have time to work on this again...

Thanks for the great tips. By running ddrescue and ntfsfix I've pretty much determined that while there are no disk errors, there is still file corruption.

So, yeah, I need to run chkdsk or some equivalent on the disk. However, the disk is located inside an external usb ide disk enclosure and does not have windows installed, so I'm not sure how I would go about running chkdsk because: (1) while Windows detects that the drive exists it does not mount it (i.e. assign it a drive letter) due to the partition corruption, and (2) I don't have a windows boot CD or anything like that.

I would prefer to fix thing from linux anyways. I don't suppose that there is a linux chkdsk equivalent, or some way to run chkdsk on the drive using some nice boot and/or partition utility?

syg00 08-10-2007 10:01 PM

Quote:

Originally Posted by grittyminder
I don't suppose that there is a linux chkdsk equivalent, or some way to run chkdsk on the drive using some nice boot and/or partition utility?

You don't suppose correctly.
Well, that didn't make a lot of sense .... :p
Let me put it this way - even the ntfsprogs authors tell you to use Windoze for this. Even they don't have the smarts - and *every* utility out there for NTFS (in Linux) calls their code.

Mount the drive internally - it needs to be found on boot. Hopefully that'll get you the chkdsk.

grittyminder 08-10-2007 10:26 PM

Ah, I should have known there wasn't a chkdsk-ish utility that you can run in Linux--I feel like somewhat of a fool, but did it not hurt to ask? I would mount the drive internally if I could, but all I've got is a laptop :(


All times are GMT -5. The time now is 05:55 AM.