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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
04-19-2012, 02:39 AM
|
#751
|
|
Member
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 766
Rep: 
|
How DD threat bad sectors when cloning?
How DD threat bad sectors when cloning? Got 500GB HDD that is starting to falling, it is just a system drive no data to backup, will DD make a clean copy of the system when the drive has bad sectors?
Regards
|
|
|
1 members found this post helpful.
|
04-19-2012, 02:46 AM
|
#752
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,358
|
The best you can do is use conv=sync,noerror on the dd command so it leaves empty blocks when it gets an error when reading the input. That way, the blocks on the output HDD end up in the right places.
|
|
|
2 members found this post helpful.
|
04-19-2012, 03:34 AM
|
#753
|
|
Member
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 766
Rep: 
|
Quote:
Originally Posted by catkin
The best you can do is use conv=sync,noerror on the dd command so it leaves empty blocks when it gets an error when reading the input. That way, the blocks on the output HDD end up in the right places.
|
Thank you.
|
|
|
1 members found this post helpful.
|
04-19-2012, 04:38 AM
|
#754
|
|
Moderator
Registered: May 2001
Posts: 24,827
|
The best you can do is use dd as described by catkin and check out ddrescue and dd_rescue. Both offer options not present in 'dd' like reading a disk back-to-front, retrying and copy rate adjusting.
|
|
|
1 members found this post helpful.
|
04-19-2012, 02:23 PM
|
#755
|
|
Member
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 766
Rep: 
|
Quote:
Originally Posted by unSpawn
The best you can do is use dd as described by catkin and check out ddrescue and dd_rescue. Both offer options not present in 'dd' like reading a disk back-to-front, retrying and copy rate adjusting.
|
That is really good to know, thank you.
I hope that using DD will be possible to avoid reinstall the system again(ugh), it is a big install of programs.
Regards
|
|
|
1 members found this post helpful.
|
04-20-2012, 07:11 AM
|
#756
|
|
Member
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 766
Rep: 
|
Code:
dd if=/dev/sda of=/dev/sdb bs=512 conv=sync,noerror
I did the above command it did copied the whole disk, but not all the partitions content, just the 1st one had the data copied, it generated all the partitions thou the 2nd and so are empty. Why is that so?
Regards
|
|
|
|
04-20-2012, 08:56 AM
|
#757
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,358
|
Quote:
Originally Posted by ukiuki
Code:
dd if=/dev/sda of=/dev/sdb bs=512 conv=sync,noerror
I did the above command it did copied the whole disk, but not all the partitions content, just the 1st one had the data copied, it generated all the partitions thou the 2nd and so are empty. Why is that so?
Regards
|
Because the partition table is at the beginning of the disk after the 446 byte master Boot Record (MBR). What you are seeing suggests the early part of the dying HDD is readable but the later parts not. The first partition may not be completely populated. You could try fscking the copy (not the original or you may further damage it).
|
|
|
1 members found this post helpful.
|
04-20-2012, 10:13 AM
|
#758
|
|
Member
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 766
Rep: 
|
Quote:
Originally Posted by catkin
Because the partition table is at the beginning of the disk after the 446 byte master Boot Record (MBR). What you are seeing suggests the early part of the dying HDD is readable but the later parts not. The first partition may not be completely populated. You could try fscking the copy (not the original or you may further damage it).
|
The problem is with the SMART.
Ok i got this with Clonezilla !! Not sure what happened with DD but now it is working just fine all partitions has been cloned and running!
Regards
|
|
|
|
05-19-2012, 06:21 AM
|
#759
|
|
Senior Member
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian Testing; OpenSuSE 12.1; Fedora 17
Posts: 1,541
Original Poster
Rep: 
|
manufacturer's disk repair utility, dd, ddrescue, foremost, fsck
Quote:
Originally Posted by ukiuki
How DD threat bad sectors when cloning? Got 500GB HDD that is starting to falling, it is just a system drive no data to backup, will DD make a clean copy of the system when the drive has bad sectors?
Regards
|
Usually the best thing is to use the manufacturer's repair utility, seatools, wddiag, etc; and do a nondestructive scan for bad sectors.
The data can usually be successfully relocated from the failing sectors to extra sectors on the drive used for this purpose.
That's the first line of defense. Most drives are not really failing. They just have an imperfect area on one surface platter. My experience has been that running the utility permanently solves the problem, and the drive works for five or ten years more.
But, the test can fail if the drive controller is bad. The utility prints a report.
dd is not a sophisticated recovery tool. It's my last choice. I've never used dd for data recovery. But dd has an undocumented function. Over time, data tracks expand. This can give bad blocks errors. So, you can write the drive back to itself:
dd if=/dev/sda of=/dev/sda
That tightens the tracks.
ddrescue is better. It contains sophisticated algorithms to read the edges of bad tracks, to repeatedly read the same track and pick up a little bit more of the data with each pass, to read the drive backwards, to guess at the correct contents to fill small unrecoverable gaps within blocks of recovered data, to operate without a valid partition table, but I have seen it fail.
foremost is a file carver. It will carve out every file. The problem is it doesn't preserve the file names (uses numbers instead), recovers deleted files, recovers only a small number of file types by default, groups the files in a directory tree according to file type.
But I've seen foremost recover everything off a DVD+R that looked like it had been put under a vehicle tire for traction to get out of a snow bank. I had a CD that I scored with deep knife cuts for disposal, but I messed up. Then I had to recover the data.
Foremost can recover everything from a disk like that. The moral is, it takes a bit of work and ingenuity to render a CD safe for disposal.
Everything has some risk, but fsck has a map and relocate bad blocks function that gives you an idea of what eternity might be like, but it's one of the safest remedies.
You choose based on how critical the operation is.
|
|
|
2 members found this post helpful.
|
05-22-2012, 02:24 PM
|
#760
|
|
LQ Newbie
Registered: May 2012
Posts: 1
Rep: 
|
Awsome!
This thread really helps me a lot.
|
|
|
|
09-05-2012, 01:27 AM
|
#761
|
|
LQ Newbie
Registered: Nov 2009
Posts: 4
Rep:
|
very nice post on dd
Thanks for this nice educative post. I just wonder can anyone give a reason why dd if=...iso of=/dev/sdb to create a bootable flash works sometime and sometime not. It seems a powerful command but it doesnot work sometimes where MS Windows programs like lilo (great app though) work on same flash drive and same iso.
|
|
|
|
09-05-2012, 05:03 AM
|
#762
|
|
Moderator
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 12,232
|
Copying an ISO image to a disk using dd is only possible if the ISO image is a hybrid-ISO.
|
|
|
|
09-05-2012, 08:21 AM
|
#763
|
|
Senior Member
Registered: May 2005
Location: boston, usa
Distribution: fc-12/ fc-11-live-usb/ aix
Posts: 2,674
|
Quote:
Originally Posted by apjena
Thanks for this nice educative post. I just wonder can anyone give a reason why dd if=...iso of=/dev/sdb to create a bootable flash works sometime and sometime not. It seems a powerful command but it doesnot work sometimes where MS Windows programs like lilo (great app though) work on same flash drive and same iso.
|
i dont think lilo is an ms windows program  ?
if you run the file command it will tell you if your iso is a partition or an image of a full disk including boot sector and partition table (judging by your example command you are expecting the latter).
|
|
|
|
09-09-2012, 05:49 AM
|
#764
|
|
LQ Newbie
Registered: Sep 2012
Distribution: Sidsqueezywheezygnudeblinux
Posts: 1
Rep: 
|
DD post..
Thank you for writing that post. I am tired and needed to go to sleep a while ago but reading that kept me up and caused me to register on this site and post.
|
|
|
|
09-23-2012, 05:51 AM
|
#765
|
|
Senior Member
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian Testing; OpenSuSE 12.1; Fedora 17
Posts: 1,541
Original Poster
Rep: 
|
U3
Quote:
Originally Posted by apjena
Thanks for this nice educative post. I just wonder can anyone give a reason why dd if=...iso of=/dev/sdb to create a bootable flash works sometime and sometime not. It seems a powerful command but it doesnot work sometimes where MS Windows programs like lilo (great app though) work on same flash drive and same iso.
|
U3 -Awesome
|
|
|
1 members found this post helpful.
|
|
Tags
|
backup, best, clonezilla, cloning, command, data, dd, disk, drive, duplicate, erase, explanation, formatting, ghost, hard, image, iso, memory, ping, popular, recover, recovery, rescue, search, security, stick, upgrade, usb, wipe  |
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:14 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|