RAID 1失败 – 主磁盘1死了,不从镜像引导

我们有一个使用Raid-1安装的服务器,每个使用两个1TB的磁盘,并且由Centos上的软件configuration。 第一个磁盘(我们称之为sdb )已经死了,我们在不久的将来将其取代,而我们决定使用镜像磁盘sda启动服务器。 事情是系统无法启动。 在bios初始化屏幕后,它仍然保持黑屏。 我的想法是,他们没有configuration镜像磁盘镜像启动扇区的SDB

我用一个现场Ubuntu的CD启动机器,并检查磁盘。 我的第二个想法是,它缺乏MBR ,因为当我看着sda我看到一个分区sda1sda2 ,其中第一个有10GB的空间,我无法访问。 然后剩下的990gb剩下的第二个分区sda2 ,这是我需要启动的分区,因为是与服务器文件和configuration

除此之外,我看到sdba拥有所有系统文件夹,例如/ boot / proc / bin … etc etcc

我已经红了,这可能会解决安装GRUB引导加载程序到磁盘,然后它可能会运行。 但是如果它能够工作的话,我会担心这个,因为已经创build了10gb的第一个分区。 其他论坛说这是无法挽回的,如果这是真的,有没有一种方法,我的格式10GB的SDB1分区,并安装操作系统来启动辅助分区和所有的服务?

在这里,我会把我收集的所有信息,如果你需要一些额外的相关信息,我会很乐意去找它并上传它

root@PartedMagic># sfdisk -d /dev/sda // # partition table of /dev/sda unit: sectors /dev/sda1 : start= 2048, size= 19529728, Id=fd /dev/sda2 : start= 19531776, size=1933991936, Id=fd /dev/sda3 : start= 0, size= 0, Id= 0 /dev/sda4 : start= 0, size= 0, Id= 0 

 root@PartedMagic>/media/md1/boot/grub# cat device.map // (hd0) /dev/disk/by-id/ata-WDC_WD1002FAEX-007BA0_WD-WMAY00918352 (hd1) /dev/disk/by-id/ata-WDC_WD1002FAEX-00Z3A0_WD-WCATRC581793 (hd2) /dev/disk/by-id/usb-Kingston_DT_101_G2_00187D0F5670EC601000BFD3-0:0 

 /dev/md1: Version : 1.2 Creation Time : Wed Oct 30 21:06:56 2013 Raid Level : raid1 Array Size : 966864704 (922.07 GiB 990.07 GB) Used Dev Size : 966864704 (922.07 GiB 990.07 GB) Raid Devices : 2 Total Devices : 1 Persistence : Superblock is persistent Update Time : Tue Oct 25 17:34:47 2016 State : clean, degraded Active Devices : 1 Working Devices : 1 Failed Devices : 0 Spare Devices : 0 Name : pbx1:1 UUID : 87040663:7e96da33:d143c52d:63d27f4a Events : 6512040 Number Major Minor RaidDevice State 0 0 0 0 removed 1 8 2 1 active sync /dev/sda2 /dev/md0: Version : 1.2 Creation Time : Wed Oct 30 21:06:51 2013 Raid Level : raid1 Array Size : 9756544 (9.30 GiB 9.99 GB) Used Dev Size : 9756544 (9.30 GiB 9.99 GB) Raid Devices : 2 Total Devices : 1 Persistence : Superblock is persistent Update Time : Tue Oct 25 17:36:14 2016 State : clean, degraded Active Devices : 1 Working Devices : 1 Failed Devices : 0 Spare Devices : 0 Name : pbx1:0 UUID : 092582ab:c3cd6b70:98b1b939:a5bb67a7 Events : 602 Number Major Minor RaidDevice State 0 0 0 0 removed 1 8 1 1 active sync /dev/sda1 ------------------------------ root@PartedMagic>/media/md1/boot/grub# cat device.map // (hd0) /dev/disk/by-id/ata-WDC_WD1002FAEX-007BA0_WD-WMAY00918352 (hd1) /dev/disk/by-id/ata-WDC_WD1002FAEX-00Z3A0_WD-WCATRC581793 (hd2) /dev/disk/by-id/usb-Kingston_DT_101_G2_00187D0F5670EC601000BFD3-0:0 

这是MDMADM.CONF文件

 CONFIGURACION MDADM.CONF ------------------------------------------- # mdadm.conf # # Please refer to mdadm.conf(5) for information about this file. # # by default, scan all partitions (/proc/partitions) for MD superblocks. # alternatively, specify devices to scan, using wildcards if desired. DEVICE partitions # auto-create devices with Debian standard permissions CREATE owner=root group=disk mode=0660 auto=yes # automatically tag new arrays as belonging to the local system HOMEHOST <system> # instruct the monitoring daemon where to send mail alerts MAILADDR root # definitions of existing MD arrays ARRAY /dev/md/0 metadata=1.2 UUID=092582ab:c3cd6b70:98b1b939:a5bb67a7 name=pbx1:0 ARRAY /dev/md/1 metadata=1.2 UUID=87040663:7e96da33:d143c52d:63d27f4a name=pbx1:1 # This file was auto-generated on Wed, 06 Nov 2013 11:10:29 -0300 # by mkconf 3.1.4-1+8efb9d1+squeeze1 

这是我在Grub conf里发现的cfg:

 # # DO NOT EDIT THIS FILE # # It is automatically generated by grub-mkconfig using templates # from /etc/grub.d and settings from /etc/default/grub # ### BEGIN /etc/grub.d/00_header ### if [ -s $prefix/grubenv ]; then load_env fi set default="0" if [ "${prev_saved_entry}" ]; then set saved_entry="${prev_saved_entry}" save_env saved_entry set prev_saved_entry= save_env prev_saved_entry set boot_once=true fi function savedefault { if [ -z "${boot_once}" ]; then saved_entry="${chosen}" save_env saved_entry fi } function load_video { insmod vbe insmod vga insmod video_bochs insmod video_cirrus } insmod raid insmod mdraid insmod part_msdos insmod part_msdos insmod ext2 set root='(md/1)' search --no-floppy --fs-uuid --set 307c9805-75d2-44d9-a411-465ae556d743 if loadfont /usr/share/grub/unicode.pf2 ; then set gfxmode=640x480 load_video insmod gfxterm fi terminal_output gfxterm insmod raid insmod mdraid insmod part_msdos insmod part_msdos insmod ext2 set root='(md/1)' search --no-floppy --fs-uuid --set 307c9805-75d2-44d9-a411-465ae556d743 set locale_dir=($root)/boot/grub/locale set lang=es insmod gettext set timeout=5 ### END /etc/grub.d/00_header ### ### BEGIN /etc/grub.d/05_debian_theme ### set menu_color_normal=cyan/blue set menu_color_highlight=white/blue ### END /etc/grub.d/05_debian_theme ### ### BEGIN /etc/grub.d/10_linux ### menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64' --class debian --class gnu-linux --class gnu --class os { insmod raid insmod mdraid insmod part_msdos insmod part_msdos insmod ext2 set root='(md/1)' search --no-floppy --fs-uuid --set 307c9805-75d2-44d9-a411-465ae556d743 echo 'Loading Linux 2.6.32-5-amd64 ...' linux /boot/vmlinuz-2.6.32-5-amd64 root=/dev/md1 ro quiet echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-2.6.32-5-amd64 } menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os { insmod raid insmod mdraid insmod part_msdos insmod part_msdos insmod ext2 set root='(md/1)' search --no-floppy --fs-uuid --set 307c9805-75d2-44d9-a411-465ae556d743 echo 'Loading Linux 2.6.32-5-amd64 ...' linux /boot/vmlinuz-2.6.32-5-amd64 root=/dev/md1 ro single echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-2.6.32-5-amd64 } ### END /etc/grub.d/10_linux ### ### BEGIN /etc/grub.d/20_linux_xen ### ### END /etc/grub.d/20_linux_xen ### ### BEGIN /etc/grub.d/30_os-prober ### ### END /etc/grub.d/30_os-prober ### ### BEGIN /etc/grub.d/40_custom ### # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. ### END /etc/grub.d/40_custom ### ### BEGIN /etc/grub.d/41_custom ### if [ -f $prefix/custom.cfg ]; then source $prefix/custom.cfg; fi ### END /etc/grub.d/41_custom ### 

任何帮助将不胜感激,这是我第一次必须处理这种性质的错误,也是第一次接近RAIDS。

谢谢!!

**如果您有第三个1TB驱动器,在尝试任何操作之前,请先制作/ dev / sda的克隆。

只是要清楚:

 /dev/sda=Current/only drive in RAID /dev/sdb=New drive 
  • 只有在救援模式下使用相同的发行版连接/ dev / sda&boot
  • chroot到sysimage并使用grub-install将其安装在/ dev / sda上。 请记住,您将其安装到硬盘驱动器的引导扇区而不是分区,因此不要使用像/ dev / sda1这样的分区号
  • 删除救援的USB / CD,并重新启动,如果启动(耶!)closures并添加/ dev / sdb并重新启动。 确保BIOS设置为从/ dev / sda第一次启动&/ dev / sdb1秒。
  • 使用fdisk和/ dev / sda中的镜像分区将/ dev / sdb1中的任何分区擦除到带有sfdisk / dev / sdb
  • 使用mdadm将/ dev / sdb1分区添加到/ dev / md0
  • 不要忘记在/ dev / sdb上运行grub-install ,所以你不会再遇到这种情况:)

这个链接应该帮助: https : //www.howtoforge.com/replacing_hard_disks_in_a_raid1_array