LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 08-18-2013, 04:31 AM   #1
hdp160
Member
 
Registered: Aug 2012
Posts: 100

Rep: Reputation: Disabled
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?
 
Old 08-18-2013, 05:13 AM   #2
hdp160
Member
 
Registered: Aug 2012
Posts: 100

Original Poster
Rep: Reputation: Disabled
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

Last edited by hdp160; 08-18-2013 at 05:27 AM.
 
Old 08-18-2013, 06:01 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
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.
 
Old 08-18-2013, 06:14 AM   #4
hdp160
Member
 
Registered: Aug 2012
Posts: 100

Original Poster
Rep: Reputation: Disabled
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.
 
Old 08-18-2013, 09:27 AM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
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.
 
1 members found this post helpful.
Old 08-18-2013, 10:36 AM   #6
hdp160
Member
 
Registered: Aug 2012
Posts: 100

Original Poster
Rep: Reputation: Disabled
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.)
 
Old 08-18-2013, 11:51 AM   #7
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,248

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
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.
 
1 members found this post helpful.
Old 08-18-2013, 01:04 PM   #8
hdp160
Member
 
Registered: Aug 2012
Posts: 100

Original Poster
Rep: Reputation: Disabled
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?

Last edited by hdp160; 08-18-2013 at 01:06 PM.
 
Old 08-18-2013, 02:37 PM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
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.
 
Old 08-18-2013, 03:38 PM   #10
hdp160
Member
 
Registered: Aug 2012
Posts: 100

Original Poster
Rep: Reputation: Disabled
Thanks understood :-)
 
Old 08-18-2013, 04:55 PM   #11
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,248

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
Originally Posted by TobiSGD View Post
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.
 
Old 08-20-2013, 10:01 AM   #12
hdp160
Member
 
Registered: Aug 2012
Posts: 100

Original Poster
Rep: Reputation: Disabled
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!
 
Old 09-07-2014, 02:19 AM   #13
vijay_bhide
LQ Newbie
 
Registered: May 2013
Posts: 3

Rep: Reputation: Disabled
Hard Disk backup-- My hard disk failing

Dear hdp160,
Finally how did you do it?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] how to take backup from hard disk to external hard disk? kri Linux - Newbie 4 09-28-2011 05:37 AM
clone hard disk with: cat /dev/sda >/media/disk/backup deathalele Linux - Security 3 04-17-2009 12:29 AM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration