LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-06-2013, 03:05 AM   #1
vnc
LQ Newbie
 
Registered: Jun 2012
Location: terra
Distribution: centOS Ubuntu
Posts: 13

Rep: Reputation: Disabled
copy files with rsync or dd


hi..
i am having SATA 500gb hdd which is having problem. the problem is with header which has started making noise. I have checked smartctl and it's result=Failed. But still all data on HDD is accessible.

partition layout is as follow
Code:
/dev/sda1       100M   25M   76M  25% /1
/dev/sda2        30G   15G   15G  50% /2
/dev/sda5       100G   82G   19G  82% /5
/dev/sda6       100G   95G  5.6G  95% /6
/dev/sda7       100G   13G   88G  13% /7
/dev/sdb1       688G  7.0G  646G   2% /mnt
my main partition where is important data is /dev/sda5,6,7

i have got new hdd 750GB and i am using rsync to copy every partition data to /dev/sdb1

but the top output
Quote:
top - 14:30:13 up 4:04, 1 user, load average: 4.06, 4.03, 4.05
Tasks: 89 total, 1 running, 88 sleeping, 0 stopped, 0 zombie
Cpu0 : 1.3%us, 0.7%sy, 0.0%ni, 0.0%id, 98.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 1.0%us, 1.0%sy, 0.0%ni, 0.0%id, 97.7%wa, 0.0%hi, 0.3%si, 0.0%st
Mem: 3659484k total, 3532124k used, 127360k free, 971912k buffers
Swap: 0k total, 0k used, 0k free, 2279776k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2569 root 20 0 12484 9916 824 D 1 0.3 0:29.78 rsync
2083 root 20 0 36552 33m 816 D 1 0.9 2:16.03 rsync
2571 root 20 0 12232 9040 336 S 1 0.2 0:20.72 rsync
can any one tell what is the best way to copy from failing hdd..since rsync is still copying a single cestOS 5.5 for last 4 hours..still copying..

or any option how do i use dd...
thank you...
 
Old 02-06-2013, 03:19 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Don't use "dd".

You will (probably) be better off running the rsync one at a time. Then they won't interfere with each other, forcing the disk heads all over the place. Two are status "D", which means they are waiting on I/O to the disk. Could be either disk.
 
1 members found this post helpful.
Old 02-07-2013, 01:36 AM   #3
propofol
Member
 
Registered: Nov 2007
Location: Seattle
Distribution: Debian Wheezy & Jessie; Ubuntu
Posts: 334

Rep: Reputation: 60
Just out of curiosity why not dd?

I am asking because I recently had a failing ssd which started giving random errors. I found advice with a google search which recommended using dd from a live cd:
dd if=/dev/sda1 of=/media/large_ext_drive/sda1.img bs=16M

I then run fsck against the image since it seems like a bad idea to use this on a failing drive.

fsck.ext4 -pvf /media/large_ext_drive/sda1.img

I mounted the image file with:

mount -o loop -t ext4 /media/large_ext_drive/sda1.img /mnt/original

I finally used rsync to clone the contents of /mnt/original to a new drive, made the appropriate changes to fstab & installed grub.

Regards,
Stefan
 
Old 02-07-2013, 01:58 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Different situation.
Using dd for forensic work is an excellent use. Particularly if you intend to operate on the image as you did. So yes the OP could have created images on sdb1 then recovered from them.
Didn't seem likely that was the intent - it I was mistaken I'm happy to recant.
 
Old 02-07-2013, 05:51 AM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
This is not forensic use, this is a rescue operation. I highly recommend to use ddrescue for that. dd and rsync will have problems with failing drives, ddrescue will skip failing sectors and continue to copy readable parts of the disk. After copying those it will return to try to read the unreadable sectors. This method is better for rescue operations, since all readable parts are copied before stressing the disk with repeatedly trying to read the unreadable parts.
 
1 members found this post helpful.
  


Reply



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] Files seem to take up more space in destination after rsync copy Karderio Linux - Newbie 6 09-22-2014 07:41 PM
Rsync - Only copy files that do not exist at the destination directory? wh33t Linux - Software 3 03-02-2014 05:30 PM
RSYNC Help - Copy Only Changed Files to New Directory euphoricrhino Linux - Software 1 11-23-2011 03:29 PM
rsync to copy specific files kilee Linux - Newbie 4 01-15-2011 08:23 AM
Rsync can't copy certain files with unusual characters while cp can smithaa02 Linux - Software 7 11-15-2010 02:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:09 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration