0

There were two disks in sw-raid. There were /dev/md1 as swap, /dev/md2 as boot and a /dev/md3 with ext4.

The sw-raid was disabled by stopping and removing mdadm and then zeroing the superblock on each /dev/mdX partition with:

sudo mdadm --zero-superblock /dev/sda1
sudo mdadm --zero-superblock /dev/sda2
sudo mdadm --zero-superblock /dev/sda3

In the disk that is the first boot device, I don't know if it's relevant, the system type of each partition was set back from fd to 82 or 83 with fdisk, /etc/fstab was updated, changing /dev/mdX to /dev/sdaX, and grub was reinstalled on the boot partition (/dev/sda2) with grub-instal. But the system wont boot.

What else should I do to use this disk as the boot device without reinstall or data loss?

Current output of fdisk

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    33556480    16777216+  82  Linux swap / Solaris
/dev/sda2   *    33558528    34607104      524288+  83  Linux
/dev/sda3        34609152  3907027120  1936208984+  83  Linux

With it doesn't boot I mean that it stops in the grub console (with the grub> symbol). A ls command says:

(hd0) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) (hd1) (hd1,msdos1)

It's weird because hd1 was formatted with ext4...

Gabriel
  • 169
  • 5
  • That would normally be enough, in my experience (thought I'm not sure about the zeroing-the-superblock bit - how did you do that?). Could you be more precise about what the system does when "*the system won't boot*"? – MadHatter May 28 '14 at 15:52
  • OK on the superblock-zeroing. Is `/dev/sda2` tagged as bootable in the partition table? And I repeat my question about *how* it fails to boot. – MadHatter May 28 '14 at 16:14
  • Added the command used. I can't really see what happens on boot, I only have access via ssh. All I know is that I can't connect after reboot (it was working perfectly before). Now I'm using a rescue system. – Gabriel May 28 '14 at 16:14
  • Yes, it is. Added the output of fdisk. – Gabriel May 28 '14 at 16:16
  • Without console access, or at least a pair of eyes on it, this will be very, very hard to diagnose. Should I take your comment about a "rescue system" to mean that this is a virtualised system? – MadHatter May 28 '14 at 16:17
  • It's a physical system, a dedicated server. Added what happens after boot. – Gabriel May 28 '14 at 17:56

1 Answers1

1

At the end, it was a problem of the grub installation. I ran grub from the mounted fs (the rescue system didn't have the grub command) and the did:

grub> root (hd0,1)
grub> setup (hd0)
Gabriel
  • 169
  • 5