2

This is how partition table loooks like:

(parted) print                                                            
Model: ATA TOSHIBA DT01ACA2 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2097kB  1049kB                     bios_grub
 2      2097kB  514MB   512MB                      raid
 3      514MB   8706MB  8193MB                     raid
 4      8706MB  2000GB  1992GB                     raid

(parted) 
(parted) quit                                                             
root@condor1958:~# parted /dev/sdb
GNU Parted 2.3
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: ATA ST2000DM001-1CH1 (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2097kB  1049kB                     bios_grub
 2      2097kB  514MB   512MB                      raid
 3      514MB   8706MB  8193MB                     raid
 4      8706MB  2000GB  1992GB                     raid

Background: I had /dev/sda drive failed and replaced, server was booted into a recovery mode. I did copt partition table from sdb to sda and md synced but now the server doesn't want to boot when I go outside of a recovery mode.

This is the proof that arrays are working in a recovery mode:

root@condor1958:/mnt/2/var/log# cat /proc/mdstat 
Personalities : [raid1] [raid0] [raid6] [raid5] [raid4] 
md2 : active raid1 sda4[2] sdb4[1]
      1944880960 blocks super 1.2 [2/2] [UU]

md1 : active raid1 sda3[2] sdb3[1]
      7996352 blocks super 1.2 [2/2] [UU]

md0 : active raid1 sda2[2] sdb2[1]
      499392 blocks super 1.2 [2/2] [UU]

In a recovery mode partitions are mounted

/dev/md0 on /mnt/0 type ext2 (rw)
/dev/md2 on /mnt/2 type ext4 (rw)

In a live mode

/dev/md0 is a /boot
/dev/md2 is a /

Why server now doesn't want to boot when I exit a recovery mode?

Thanks

1

Seems like you forgot to call grub-install /dev/sda after replication partition table. As a simple workaround you can enter bios and tell it to boot first from /dev/sdb (second disk visible in bios). I suppose it's trying to boot from the first, /dev/sda.

The thing is, first bootable partition isn't on md software raid (and it cannot be, because it's used prior to kernel booting), so it has to be prepared too when you replace the disk. Otherwise it's missing primary and secondary boot loaders.

Follow up: it seems like for some reason you think that /boot is the first bios_grub partition, while it ain't. In the same time uninitialized bios_grub partition is the only reason your server is refusing to boot.

  • I'm now in a recovery mode which is using different kernel and md is mounted under /mnt/0 and /mnt/2... If I run grub-install /dev/sda now what will happen? – Mladen Adamovic May 1 '16 at 18:52
  • Nothing harmful, if drive mapping hasn't change. Furthermore, if you described the situation correctly, there's no need to be in recovery mode, you have half of the mirror (it is mirror, right ?) fully operational. But if you're on stripe, you're doomed. – drookie May 1 '16 at 18:57
  • Yeah, raid1 is mirror. – drookie May 1 '16 at 18:58
  • what do you mean by drive mapping? I had it in mirror mode, and one drive did fail, so I should be able to fix the boot unless content of /boot partition becomes unfixable by running something which will copy boot from recovery mode to /mnt/2 (md2) – Mladen Adamovic May 1 '16 at 19:01
  • You're mixing /dev/sda1 with /boot. But it ain't. – drookie May 1 '16 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.