LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   copy files with rsync or dd (https://www.linuxquestions.org/questions/linux-newbie-8/copy-files-with-rsync-or-dd-4175448832/)

vnc 02-06-2013 03:05 AM

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...

syg00 02-06-2013 03:19 AM

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.

propofol 02-07-2013 01:36 AM

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

syg00 02-07-2013 01:58 AM

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.

TobiSGD 02-07-2013 05:51 AM

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.


All times are GMT -5. The time now is 07:20 PM.