After a secure erase of /dev/sda (Samsung 840 Pro) I had to setup grub on /dev/sda2 (for some unknown reason the /boot partition is the second one). So I ran something like this:
grub<br>
root(hd0,1) //my boot partition is the /dev/sda2<br>
setup(hd0)
I've seen in many places that I should copy the first 512 bytes with dd from the good device and then write the first 446 bytes also with dd. I've never done that. I wonder why we need to use an intermediary file and why we can't simply do "dd if=/dev/sdb of=/dev/sda bs=446 count=1".
Anyway, when /dev/sdb is removed, the system in unbootable. In fact it says it boots up CentOS 6.4 in 3...2...1 second but then it just reboots and so on. In order to check I have exported the first 446 bytes of each drive and they differ:
/dev/sda (hexa)
.H.................................................. ............... ............u....Y|..1....... ..@|<. t...R...tT.A..U..ZRrI..U.uC.A|..u....t7f.L...|.D..f. .D|.....D...f...D..pf1..D.f.D..B..r...p.}....s..... ........|.D..f1...@f.D.1..........@.D.1......f..f.D| f1.f.4.T.f1.f.t..T..D.;D.}<.T.....L......l.Z.t...p.. 1......r*....H|`......1.1.....a.&B|..}.@.....}.8.... .}.0...}.*...GRUB .Geom.Hard Disk.Read. Error....... ..<.u.........................
/dev/sdb
.H.................|.........!......8.u........u.... .....|...t........@.........u....Y|..1....... ..@|<. t...R...tT.A..U..ZRrI..U.uC.A|..u....t7f.L...|.D..f. .D|.....D...f...D..pf1..D.f.D..B..r...p.}....s..... ........|.D..f1...@f.D.1..........@.D.1......f..f.D| f1.f.4.T.f1.f.t..T..D.;D.}<.T.....L......l.Z.t...p.. 1......r*....H|`......1.1.....a.&B|..}.@.....}.8.... .}.0...}.*...GRUB .Geom.Hard Disk.Read. Error....... ..<.u...................Ym....
Have I done something wrong? What can I do to safely fix this?