LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Hard Disk backup -- My hard disk failing! (https://www.linuxquestions.org/questions/ubuntu-63/hard-disk-backup-my-hard-disk-failing-4175473791/)

hdp160 08-18-2013 04:31 AM

Hard Disk backup -- My hard disk failing!
 
I have and urgent problem.

My system is reporting impending hard disk failure.

I have enough spare network available storage available to back up there.

The failing disk (250GB) has two partitions one for ubuntu 10.04 and one for ubuntu 12.04 and 50GB unallocated.

Please can someone give me clear directions for backup?

When I replace the drive will I be able to put everything back as before?

hdp160 08-18-2013 05:13 AM

I will probably fit a new 250Gb Drive in the case tommorow.

(alongside the failing drive)

Is this the best way of going about this please.

http://www.togaware.com/linux/surviv...rade_Hard.html

TobiSGD 08-18-2013 06:01 AM

If you have a failing harddisk your data may already be compromised. Add the new harddisk to your system and copy the valuable data to it, after that you can think about setting up a new system. What you are actually doing is recovery, not a backup, if you would have a backup you wouldn't have a problem now in the first place.

hdp160 08-18-2013 06:14 AM

That is so true.

Between now and fitting a new drive I will sleep.

Perhaps tommorow I will see the problem in a new light. (BTW its a spin up problem not a surface one)

I have important stuff backed up on NAS already.

I've been thinking of of an "exact copy" restore to negate the need to reinstall software and preferences and all the other nasty time consuming chores which a fresh install of an operating system requires.

On the other hand it does keep you on your toes.

TobiSGD 08-18-2013 09:27 AM

If you have your important stuff already backed up and this is not a problem with bad sectors you might be successful with that. But I would rather go for making a file-based copy than imaging the whole disk, so that you put less stress on the disk, which may be negative.
I personally would do it this way:
- Boot from a Live-medium (CD/DVD/USB)
- Create partitions on the new disk according to the partition layout of the old disk and format them
- Mount old and new partitions and use cp, rsync or tar to copy the files over.
- Install a bootloader to the new disk.
After that you should be fine.

hdp160 08-18-2013 10:36 AM

Again thanks for the advice, I think that is best way to go.

I shut the PC down this afternoon whilst I watched the athletics on TV.

Stripped out the HDD to check ease of replacement.
Reassembled
Rebooted and rechecked "Disk Utility" > SMART DATA to see what the status of the spin up time is/was.

Its now reporting all OK but that the "Disk was used outside of design parameters in the past" (the spin up before was 21.7 seconds now its 5.9 seconds .... Threshold 25 sec.)

*** I am going to replace it tomorrow anyway. SMART DATA reports that its been powered on for 1.9 years!***

I was hoping to disable the spindown but after trying hdparm -B255 /dev/sda I've discovered that the drive does not suport energy saving.

Does anyone know of any other command to disable spindown (If I can I might use it for tempory storage until the mechnics physicaly fail.)

widget 08-18-2013 11:51 AM

Another option, which may be slightly better, for copying your old disk to the new would be to simply use the dd command from the Live Session.

This will copy the partitions and everything.
Code:

dd if=/dev/sda of=/dev/sdb bs=4M; sync
where sda and sdb are the actual designations for the drives in your box.

"if" is input file
'of" is output file
don't mix them up or you will have 2 blank drives.

You don't want to worry about format of the new drive. All that will be copied from the old drive.

I think this is a better solution as it is one process. Old Unix command. Easy on resourses and easy on the old drive.

Good luck and HAVE FUN.

I would be getting another drive, maybe a bit bigger, and using it for backup storage, perhaps with complete system backup of both installs.

You may want to back up your data and then do clean installs of the systems too. Advantage to that is that you could install and then keep your data files, all of them, for both installs on another, larger partition. If you are installing on only one partition each OS could easily be under 20 gigs (depending on how many extra packages you install -base install is under 5 gigs).

With all your data on only one partition it makes for easier back up of that data and easier recovery of that data if that is ever needed.

You simply put that partition in both installs /etc/fstab to mount on boot up.

hdp160 08-18-2013 01:04 PM

Thanks I've just spent half an hour reading through the online dd manual and a few tutorials.

Yes, comparing the price of larger size HDD makes upsizing very sensible.

Off to the shops tommorow morning.

Then shirt sleeves rolled up deep breath and then.......................

....................................................I'll report back!


BTW why do you suggest a value of 4M?

TobiSGD 08-18-2013 02:37 PM

The optimal values for the blocksize depend on your hardware, I have made some tests with different hardware and came to the conclusion that I get best performance with values between 4M and 32M, depending on disk and controller. I assume that widget has made similar experiences. This may be different for your hardware, but most likely you will get best performance in this range.

hdp160 08-18-2013 03:38 PM

Thanks understood :-)

widget 08-18-2013 04:55 PM

Quote:

Originally Posted by TobiSGD (Post 5011502)
The optimal values for the blocksize depend on your hardware, I have made some tests with different hardware and came to the conclusion that I get best performance with values between 4M and 32M, depending on disk and controller. I assume that widget has made similar experiences. This may be different for your hardware, but most likely you will get best performance in this range.

Yes I have. Your advice is great.

That figure is the one that Debian recommends in their dd documentation. I figure that is a safe value. If the conditions are right for it to be larger, however, you are simply handicapping your drive to some extent. Probably not a large extent. May not notice it but if 32M would be supported it should be noticable.

hdp160 08-20-2013 10:01 AM

Thanks disks purchased and everything copied.

So I will be closing this thread as solved.

I will be opening a NEW thread very soon whilst shoping I bought a SSD drive!

vijay_bhide 09-07-2014 02:19 AM

Hard Disk backup-- My hard disk failing
 
Dear hdp160,
Finally how did you do it?


All times are GMT -5. The time now is 08:59 AM.