Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I cloned a boot disk (bootloader, / and swap partitions) with dd to the same size disk (bad sectors started to appear). Got 1 reading error in the middle of the disk. After I swapped the disks I received "Target filesystem doesn't have sbin/init" error. At first I thought that the problem is /etc/fstab points to the wrong UUID to boot off. It turns out new disk has the same UUID, but I changed it to /dev/sda just to be shure and it is indeed /dev/sda (I disconnected all other disks). The problem persists.
How could it be that from 2 identical disks one is okay and the other not?
I just mounted the new disk (it's LVM except /boot - does this matter?) and I can't read anything - "Input/output error". So why I receive "Target filesystem doesn't have sbin/init" now solved. I did try this before, I swear. But I did ls on it, saw my root directory and decided that it's okay.

share|improve this question
Did you use dd conv=noerror,sync? – mark4o Mar 9 '11 at 17:46
@mark4o just conv=noerror. sync? "pad every input block with NULs to ibs-size" - what's this for? – Art Shayderov Mar 9 '11 at 19:20
Without noerror it will stop copying when it sees an error. With noerror but not sync it will skip over the input block that is in error but then all of the blocks after that will be written to the wrong place (one block earlier). conv=noerror,sync will write a block of zeros for every error block to keep input & output synchronized. – mark4o Mar 9 '11 at 22:53
up vote 1 down vote accepted

It is my understanding that dd doesn't play well when there are errors on the disk. Maybe try using dd_rescue to image bootloader, / and swap to the new disk. Otherwise you might try imaging the entire disk.

dd_rescue works the exact same way as dd but can handle errors.

share|improve this answer
Yes, that's probably because of the reading errors. I'll try dd_rescue – Art Shayderov Mar 9 '11 at 19:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .