Hard drive about to die

I have a hard drive that is about to die. It is the hard drive for my OS. It has given me 7 good years so I think I got my moneys worth. I obviously want to get my data off of it. So what is the best way to do this with hopefully as little strain as possible on it? Do I want to just load the OS then straight copy and paste to an external HD or a big flash drive? I have a couple of massive flash drives. I usually use my external HD's just trying to think of all my options. Do I want to load up a live cd and copy and paste that way so there is less OS strain on the HD? Use another computer to create an image? Is there some better option I am not thinking of?

Hello,

Personally, what I'd do here is set up the OS again on a clean new drive, and then copy the home directories and content across from the original drive to your newly set up environment on the new drive. That's the route I'd be inclined to go down, though there are plenty of ways you could tackle this one. The biggest factor is how badly compromised the original drive is, and how quickly you need to get things copied off.

Copying just /home and such isn't really enough, though. If you have a license server running on such a machine, it might store its keys under /etc (or /opt or somewhere else). So now you need to copy those over as well (or reinstall the software; hopefully it'll have a way for you to point it at the old drive and "import" everything that's needed).

On macOS, I have this issue whenever I update my laptop. I can generally just copy over my home directory (although lately I use Git to keep my home in a repo, so I can just git clone my home directory to a new machine, but I need to keep my non-personal stuff somewhere else). But what do I do about the customizations I've made to the Postfix mailer? Those are under /etc/postfix. Lately, I keep a ChangeLog file under /etc to keep track of that kind of thing. I've considered using Git there as well, but Git doesn't restore ownership without extra work, so... I'm not doing that currently.

Anyway, just some extra things to consider...

This depends on the OS and version number, to be honest.

How current is your OS and kernel on your seven year old drive?

The transition approach for an obsolete, EOL or near EOL operating system is quite different than the transition approach for an OS which is current and up-to-date.

What makes you think that? Have you had errors or a S.M.A.R.T. warning or what? Perhaps it's just a bad spot.

That's not very long depending on how hard it's been worked.

As others have asked, what OS is it?

To save data with the lightest load on the drive you should use 'dd' command to read the drive sector-by-sector out to a file on one of your big USB drives. That way, head movement is minimalized. However, such an image will need to be written out to another disk for recovery; it's not possible to restore individual files. You should be able to do that without taking the system down.

Other than that, depending on your OS, you will have backup utilities that you could run. For full recovery, some OS's prefer 'tar', other 'cpio', or some UFS (eg, 'ufsdump') or ZFS export routine.

What filesystem type is it?

1 Like

Hey @cokedude

Let's take a step back and thing about your question in a different context.

If you posted on a car forum and asked the question*, "Hey Friends, I have a car and I think I need to change the engine because it is having trouble. I want to to this in the best way. Please tell me how do to it. Thanks"*

Think about it.

What responses would you get back from the people in the car forum? Let's guess:

  • What make and model car are you talking about?
  • What is the year?
  • What is the engine and the mileage?

After all, the are the most basic questions everyone who works on your car needs to know.

Kindly tell me then, why would someone who registered in our forums in 2010 post the same type of question to us as the most basic example car question above?

It's just basic.

"Hey guys, I have an Hitachi laptop which a 5GB ATA drive which is around 8 years old running a very old version of Ubuntu. I think I need to change the hard drive.... etc etc. "

It is totally mystifying to me why you would post such a question without any details at all about the system you are talking about.

Details matter.

I'm not trying to be a PITA, but your question @cokedude is no different than walking into a car dealership without your car and saying "Hi There! I have a car. My car is giving me trouble and I think I need to change the engine. What is the best option? Should I buy a new one? Should I fix it? "

There is no way possible any reasonable person can provide an intellgent answer to such an abstact question without knowing the make, model, year and mileage of the car, etc.

The same is true for information technology, but the details are even more important.

Sorry, but I am totally baffled by such a question. Why do we need to ask you:

Let's get serious @cokedude !

Ask questions in a way that any reasonable person would be able to have the most basic information to help you.

Thank you.

2 Likes

A dual boot of Fedora 34 and Windows 8. The Fedora 34 uses ext4. The windows 8 uses ntfs. I checked with a combination of watching with the Task Manager in Windows 8 and smartmontools/ smartctl in Fedora. Also whenever I opened more than four tabs in firefox or chrome the disk completely froze for about 30 minutes.

The freezing for 30 minutes whilst opening more than four tabs in a browser could be caused by all kinds of things so let's leave that for a second. You are suspicious of the hard drive...........

I would be inclined to boot Linux from a CD/DVD in order to filesystem check fsck that ext4 filesystem. So in the circumstances be very sure to use the -n (no write) switch and also see whether your fsck version supports the (sometimes undocumented) -all (deep reading of all occupied space). Try to use both switches but definitely the 'no write'. That will give the disk some exercise to read the filesystem WITHOUT the possibility of causing additional damage due to a faulty/dying disk. Just see what errors, if any, that throws up.

1 Like

It gave the message:

"4	Filesystem errors left uncorrected"

Yes, right, if the disk was dying I would expect to see read errors quoting blocks/cylinders, etc.

means that it didn't correct the filesystem because you used -n (no write) flag. So since there are only 4 errors I would now run fsck again without the -n and correct those errors.

As I said earlier, we are looking for evidence that the disk is in trouble. Running fsck on a filesystem puts it through quite a lot of work and I would expect to see I/O errors reported en masse if the disk was stuffed.

Do you only have one filesystem? If you have others try fsck with -n on those and see what you get. If the drive is really iffy I would expect to see dozens, if not hundreds, of I/O errors.

NTFS for the Windows 8 and ext4 for fedora.

So as per my previous post, have you corrected the 4 filesystem errors by running fsck without the -n switch?

If so, what makes you still think that the hard disk is dying?

It has been unable to fix them.

You can't just say it didn't fix the errors!

If you want meaningful help you need to supply the error or whatever.