Linux - NewbieThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Click here to see the post LQ members have rated as the most helpful post in this thread.
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.
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.
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.
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.
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?
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).
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!
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
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.
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.
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).
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.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.