Как изменить загрузочный диск на сервере с программным рейдом RAID 5

У меня есть выделенный сервер, принадлежащий аппаратному обеспечению, размещенный в удаленном центре обработки данных, на котором работает CentOS версии 6.4 (Final) с grub (GNU GRUB 0.97). На сервере 6 дисков по 2 ТБ с 2 программными рейдами на них - md0 raid 1 для системы и swap и md1 raid 5 для данных. Вот вывод fdisk и mdstat:

[root@s3 ~]# fdisk -l

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0004f1ce

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         653     5242880   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sda2             653      243202  1948270592   fd  Linux raid autodetect

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0008177f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         653     5242880   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sdb2             653      243202  1948270592   fd  Linux raid autodetect

Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0008afb7

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1         653     5242880   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sdc2             653      243202  1948270592   fd  Linux raid autodetect

Disk /dev/sde: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00012b28

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1   *           1         653     5242880   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sde2             653      243202  1948270592   fd  Linux raid autodetect

Disk /dev/sdd: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000df271

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *           1         653     5242880   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sdd2             653      243202  1948270592   fd  Linux raid autodetect

Disk /dev/sdf: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000b6b9e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1   *           1         653     5242880   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sdf2             653      243202  1948270592   fd  Linux raid autodetect

Disk /dev/md1: 9974.5 GB, 9974471720960 bytes
2 heads, 4 sectors/track, -1859793536 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 524288 bytes / 2621440 bytes
Disk identifier: 0x00000000


Disk /dev/md0: 5368 MB, 5368643584 bytes
2 heads, 4 sectors/track, 1310704 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_s3-LogVol01: 12.6 GB, 12582912000 bytes
255 heads, 63 sectors/track, 1529 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 524288 bytes / 2621440 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_s3-LogVol00: 3271 MB, 3271557120 bytes
255 heads, 63 sectors/track, 397 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 524288 bytes / 2621440 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_s3-LogVol02: 9958.6 GB, 9958615678976 bytes
255 heads, 63 sectors/track, 1210732 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 524288 bytes / 2621440 bytes
Disk identifier: 0x00000000

[root@s3 ~]# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid1]
md0 : active raid1 sdc1[2] sda1[0] sdd1[3] sdb1[1] sde1[4] sdf1[5]
      5242816 blocks super 1.0 [6/6] [UUUUUU]
      bitmap: 1/1 pages [4KB], 65536KB chunk

    md1 : active raid5 sda2[0](F) sdd2[3] sdc2[2] sdb2[1] sde2[4] sdf2[6]
          9740695040 blocks super 1.1 level 5, 512k chunk, algorithm 2 [6/5] [_UUUUU]
          bitmap: 15/15 pages [60KB], 65536KB chunk

    unused devices: <none>

Как видите, массив md1 находится в деградированном состоянии, диск / dev / sda неисправен. Я раньше менял много неисправных дисков на других серверах, но здесь / dev / sda также является загрузочным диском (возможно). Вот моя карта устройств загрузочного grub:

# this device map was generated by anaconda
(hd0)     /dev/sdb
(hd1)     /dev/sdc
(hd2)     /dev/sdd
(hd3)     /dev/sde
(hd4)     /dev/sdf
(hd5)     /dev/sdg

/ dev / sda по какой-то причине там не указано, и в нем перечислены / dev / sdg, которых, согласно fdisk, не существует. Вот /boot/grub/grub.conf:[1240 visible) Он перечисляет hd (0,0) как загрузочный диск. Я думаю, что это неисправный привод dev / sda. Поэтому, если я сейчас выключу сервер, чтобы сменить диск, он больше не загрузится. Я пытаюсь переключить загрузочный диск на другой, я много искал в Интернете, но не могу понять. Я пробовал эти команды:

[root@s3 ~]# grub-install /dev/sdb
/dev/sda1 does not have any corresponding BIOS drive.
[root@s3 ~]# grub
Probing devices to guess BIOS drives. This may take a long time.


    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]
grub> find /grub/stage1
find /grub/stage1

Error 15: File not found
grub> find /boot/grub/stage1
find /boot/grub/stage1
 (hd0,0)
 (hd1,0)
 (hd2,0)
 (hd3,0)
 (hd4,0)
 (hd5,0)
grub> cat (hd0,0)/grub/grub.conf
cat (hd0,0)/grub/grub.conf

Error 15: File not found
grub> quit
quit 

Какие изменения я должен внести в grub, чтобы иметь возможность загружаться после замены / dev / sda. Порядок загрузки с жесткого диска, вероятно, придется изменить также в BIOS.

0
задан 19 November 2016 в 18:57
1 ответ

При использовании программного RAID выбор загрузочного диска полностью зависит от BIOS (и от того, как он перечисляет диски).

Чтобы получить загрузочную машину, просто замените неисправный диск и используйте grub-install для установки загрузчика на загрузочный диск BIOS или, что еще лучше, на все диски, входящие в массив RAID1.

Для получения дополнительной информации см. Здесь .

0
ответ дан 5 December 2019 в 09:10

Теги

Похожие вопросы