세부 사항

세부 사항

수동으로 구성하려고 합니다.디스크 어레이 1+RAID10. OSX 11.10.3의 VM(VirtualBox 5.0.14 r105127)에서 프로세스를 시도하고 있습니다.

내가 채택한 전략은 다음과 같습니다.

내가 실행한 전체 명령 세트를 사용할 수 있습니다.여기.

  • 먼저 centos첫 번째 디스크에 설치하십시오 /dev/sda.
  • 그런 다음 모든 파일을 RAID 배열 cp -a mnt/old* mnt/new( /boot/efi파티션 포함) 로 마이그레이션합니다.
  • RAID 시스템에 들어가기 위한 chroot
  • /etc/fstab올바른 매핑으로 편집
  • 올바른 값을 /etc/default/grub추가하도록 편집되었습니다 .rd.auto=1 rd.lvm=[...] rd.md.uuid=[...]
  • 재건initramfs dracut --mdadmconfig --fstab --add "mdraid" --add-drivers "raid1 raid10"
  • 재건grub.cfg grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
  • EFI NVRAM에 새 항목 추가 for i in b c d; do efibootmgr --create --disk /dev/sd$i --label "CentOS Backup - /dev/sd$i" --load "\\EFI\\centos\\grub.efi"; done
  • 얻다시작 실패모든 항목에 대해.

내가 여기서 무엇을 놓치고 있는 걸까요?


세부 사항

현재 상태, /dev/sda시스템에서 실행된 명령 에 대한 자세한 정보

lsblk
NAME              MAJ:MIN RM  SIZE RO TYPE   MOUNTPOINT
sda                 8:0    0    8G  0 disk   
├─sda1              8:1    0  200M  0 part   /boot/efi
├─sda2              8:2    0  500M  0 part   /boot
└─sda3              8:3    0  7,3G  0 part   
  ├─centos-root   253:0    0  6,5G  0 lvm    /
  └─centos-swap   253:1    0  820M  0 lvm    [SWAP]
sdb                 8:16   0    8G  0 disk   
├─sdb1              8:17   0  200M  0 part   
├─sdb2              8:18   0  500M  0 part   
│ └─md125           9:125  0  500M  0 raid1  
├─sdb3              8:19   0  3,2G  0 part   
│ └─md126           9:126  0  3,2G  0 raid1  
│   ├─vgroot-swap 253:3    0    1G  0 lvm    
│   └─vgroot-root 253:4    0  2,2G  0 lvm    /mnt/raidsys
└─sdb4              8:20   0  4,1G  0 part   
  └─md127           9:127  0  8,2G  0 raid10 
    └─vghome-home 253:2    0  8,2G  0 lvm    
sdc                 8:32   0    8G  0 disk   
├─sdc1              8:33   0  200M  0 part   
├─sdc2              8:34   0  500M  0 part   
│ └─md125           9:125  0  500M  0 raid1  
├─sdc3              8:35   0  3,2G  0 part   
│ └─md126           9:126  0  3,2G  0 raid1  
│   ├─vgroot-swap 253:3    0    1G  0 lvm    
│   └─vgroot-root 253:4    0  2,2G  0 lvm    /mnt/raidsys
└─sdc4              8:36   0  4,1G  0 part   
  └─md127           9:127  0  8,2G  0 raid10 
    └─vghome-home 253:2    0  8,2G  0 lvm    
sdd                 8:48   0    8G  0 disk   
├─sdd1              8:49   0  200M  0 part   
├─sdd2              8:50   0  500M  0 part   
│ └─md125           9:125  0  500M  0 raid1  
├─sdd3              8:51   0  3,2G  0 part   
│ └─md126           9:126  0  3,2G  0 raid1  
│   ├─vgroot-swap 253:3    0    1G  0 lvm    
│   └─vgroot-root 253:4    0  2,2G  0 lvm    /mnt/raidsys
└─sdd4              8:52   0  4,1G  0 part   
  └─md127           9:127  0  8,2G  0 raid10 
    └─vghome-home 253:2    0  8,2G  0 lvm    
sr0                11:0    1 56,3M  0 rom   

공격

mdadm --examine --scan --verbose

ARRAY /dev/md/boot  level=raid1 metadata=1.0 num-devices=4 UUID=1f726cc3:387c49c3:3cee8230:f11a4640 name=localhost:boot
   devices=/dev/sdd2,/dev/sdc2,/dev/sdb2
ARRAY /dev/md/root  level=raid1 metadata=1.2 num-devices=4 UUID=fea6baab:29711848:997387aa:295ec48f name=localhost:root
   devices=/dev/sdd3,/dev/sdc3,/dev/sdb3
ARRAY /dev/md/home  level=raid10 metadata=1.2 num-devices=4 UUID=edf6287a:ba1236a6:2a3471d2:edac85cb name=localhost:home
   devices=/dev/sdd4,/dev/sdc4,/dev/sdb4

좌심실 용적

vgs
  VG     #PV #LV #SN Attr   VSize VFree 
  centos   1   2   0 wz--n- 7,31g 40,00m
  vghome   1   1   0 wz--n- 8,18g     0 
  vgroot   1   2   0 wz--n- 3,22g     0 
lvs
  LV   VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root centos -wi-ao----   6,47g                                                    
  swap centos -wi-ao---- 820,00m                                                    
  home vghome -wi-a-----   8,18g                                                    
  root vgroot -wi-a-----   2,22g                                                    
  swap vgroot -wi-a-----   1,00g 

blkid

/dev/block/8:1: SEC_TYPE="msdos" UUID="1E4D-DBA3" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="b5c88e63-06fa-4f20-8cb9-9bad8b5c79fc" 
/dev/block/253:1: UUID="b9c3c080-76d4-44e2-a0b6-3260193d6345" TYPE="swap" 
/dev/sr0: UUID="2016-01-19-16-46-09-00" LABEL="VBOXADDITIONS_5.0.14_105127" TYPE="iso9660" 
/dev/sdb1: SEC_TYPE="msdos" UUID="CEE8-7E69" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="2a458d61-6959-4ec3-a283-1c4d1f76f69d" 
/dev/sdb2: UUID="1f726cc3-387c-49c3-3cee-8230f11a4640" UUID_SUB="349956d0-e1e9-dcb4-1054-ab700cc64004" LABEL="localhost:boot" TYPE="linux_raid_member" PARTUUID="5cca664e-0cad-44c6-8165-d7a77745f45a" 
/dev/sdb3: UUID="fea6baab-2971-1848-9973-87aa295ec48f" UUID_SUB="07be5c6b-3d27-daad-85ea-a6c6e78fd22a" LABEL="localhost:root" TYPE="linux_raid_member" PARTLABEL="Linux RAID" PARTUUID="ae26fa90-9493-4984-a44e-2892ef11604a" 
/dev/sdb4: UUID="edf6287a-ba12-36a6-2a34-71d2edac85cb" UUID_SUB="d04ed8bb-c427-ad9e-3b0f-3186cf38c17e" LABEL="localhost:home" TYPE="linux_raid_member" PARTLABEL="Linux RAID" PARTUUID="a4ddae48-2c8e-427d-80ec-3c856e80c752" 
/dev/sdc1: SEC_TYPE="msdos" UUID="EE8B-2290" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="bd520660-8448-4bda-9a10-0f03d90468eb" 
/dev/sdc2: UUID="1f726cc3-387c-49c3-3cee-8230f11a4640" UUID_SUB="4ea6709b-1c30-8476-063a-147c8230fa5c" LABEL="localhost:boot" TYPE="linux_raid_member" PARTUUID="1c5f95bb-e4a3-4438-a538-824b6a85176f" 
/dev/sdc3: UUID="fea6baab-2971-1848-9973-87aa295ec48f" UUID_SUB="18d60a38-6306-6f0b-2aad-f5b2fe3dfba1" LABEL="localhost:root" TYPE="linux_raid_member" PARTLABEL="Linux RAID" PARTUUID="1d775697-113c-4bf4-bfec-6f5768b6a0fb" 
/dev/sdc4: UUID="edf6287a-ba12-36a6-2a34-71d2edac85cb" UUID_SUB="7454fefb-3217-16ad-9334-f36db6ab2038" LABEL="localhost:home" TYPE="linux_raid_member" PARTLABEL="Linux RAID" PARTUUID="5f0f489b-60ff-4958-a24c-ad05e9c8e840" 
/dev/sdd1: SEC_TYPE="msdos" UUID="EFF5-FDC4" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="a0670bb3-8dc4-4af9-b5d2-51609caf999a" 
/dev/sdd2: UUID="1f726cc3-387c-49c3-3cee-8230f11a4640" UUID_SUB="9508d1ed-237a-d782-ddaa-87099b90a08d" LABEL="localhost:boot" TYPE="linux_raid_member" PARTUUID="9a4abae3-0ccc-460d-9bd9-814ca391cf69" 
/dev/sdd3: UUID="fea6baab-2971-1848-9973-87aa295ec48f" UUID_SUB="dca1324c-f034-939d-923a-b3255d535781" LABEL="localhost:root" TYPE="linux_raid_member" PARTLABEL="Linux RAID" PARTUUID="21a4d5f4-cbd3-4397-9fab-cf0e1c3e77e4" 
/dev/sdd4: UUID="edf6287a-ba12-36a6-2a34-71d2edac85cb" UUID_SUB="4296c7d1-620e-cfb1-1c37-220022a7f01f" LABEL="localhost:home" TYPE="linux_raid_member" PARTLABEL="Linux RAID" PARTUUID="fbd7b585-bf9e-43fa-8d54-4fcb6749dfc2" 
/dev/md127: UUID="KV9voE-ps3q-BAD5-rKYS-ZZRX-0Edq-WMkR5G" TYPE="LVM2_member" 
/dev/md126: UUID="viiJV2-Uah7-DX82-oiGJ-jBDz-wCOl-TLvDK2" TYPE="LVM2_member" 
/dev/mapper/vghome-home: LABEL="Home" UUID="9e7437a7-1f40-48fd-a544-a70f4be0e52c" TYPE="xfs" 
/dev/mapper/vgroot-swap: LABEL="Swap" UUID="37cc3754-411e-4f4c-9044-e3c76d965968" TYPE="swap" 
/dev/mapper/vgroot-root: LABEL="Root" UUID="82ff7a16-6e1d-4c29-930d-055db267aaa8" TYPE="xfs" 
/dev/md125: LABEL="Boot" UUID="25fc17e0-29bb-4e5b-b1b7-06216cd7e0a1" TYPE="xfs" 

/etc/fstab

mount /dev/vgroot/root /mnt/raidsys
cat /mnt/raidsys/etc/fstab

#
# /etc/fstab
# Created by anaconda on Sat Feb 27 23:23:36 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
#/dev/mapper/centos-root /                       xfs     defaults        0 0
#UUID=1c8085bb-a226-4435-8e6f-0953025f6f1a /boot                   xfs     defaults        0 0
#UUID=1E4D-DBA3          /boot/efi               vfat    umask=0077,shortname=winnt 0 0
#/dev/mapper/centos-swap swap                    swap    defaults        0 0
########################
/dev/mapper/vgroot-root /         xfs   defaults   0 0
UUID=25fc17e0-29bb-4e5b-b1b7-06216cd7e0a1 /boot         xfs   0 0
UUID=CEE8-7E69      /boot/efi      vfat   umask=0077,shortname=winnt 0 0
/dev/mapper/vgroot-swap swap         swap   defaults   0 0

/etc/default/grub

cat /mnt/raidsys/etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.auto=1 rd.lvm.lv=vgroot/root rd.md.uuid=fea6baab:29711848:997387aa:295ec48f rd.md.uuid=1f726cc3:387c49c3:3cee8230:f11a4640 rd.lvm.lv=vgroot/swap rhgb quiet"
GRUB_DISABLE_RECOVERY="true"

Initramfs 확인

mount /dev/md125 /mnt/raidboot
lsinitrd /mnt/raidboot/initramfs-3.10.0-327.el7.x86_64.img | grep raid* | xclip -selection clipboard
Image: /mnt/raidboot/initramfs-3.10.0-327.el7.x86_64.img: 19M
mdraid
-r-xr-xr-x   1 root     root        11264 Feb 28 01:00 usr/lib64/device-mapper/libdevmapper-event-lvm2raid.so
lrwxrwxrwx   1 root     root           44 Feb 28 01:00 usr/lib64/libdevmapper-event-lvm2raid.so -> device-mapper/libdevmapper-event-lvm2raid.so
-rwxr-xr-x   1 root     root          265 Sep 12  2013 usr/lib/dracut/hooks/cleanup/99-mdraid-needshutdown.sh
-rwxr-xr-x   1 root     root          910 Sep 12  2013 usr/lib/dracut/hooks/pre-mount/10-mdraid-waitclean.sh
-rw-r--r--   1 root     root        15037 Nov 19 23:51 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/crypto/async_tx/async_raid6_recov.ko
-rw-r--r--   1 root     root        26061 Nov 19 23:52 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/drivers/md/raid0.ko
-rw-r--r--   1 root     root        79765 Nov 19 23:52 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/drivers/md/raid10.ko
-rw-r--r--   1 root     root        62645 Nov 19 23:52 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/drivers/md/raid1.ko
-rw-r--r--   1 root     root       168581 Nov 19 23:52 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/drivers/md/raid456.ko
drwxr-xr-x   2 root     root            0 Feb 28 01:00 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/lib/raid6
-rw-r--r--   1 root     root       101965 Nov 19 23:53 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/lib/raid6/raid6_pq.ko
-rw-r--r--   1 root     root         2138 Nov 20 21:14 usr/lib/udev/rules.d/63-md-raid-arrays.rules
-rwxr-xr-x   1 root     root          708 Sep 12  2013 usr/sbin/mdraid-cleanup
-rwxr-xr-x   1 root     root         1074 Sep 12  2013 usr/sbin/mdraid_start

그럽 구성 파일

mount /dev/sdb1 /mnt/raidboot/efi
ls -al /mnt/raidboot/efi/EFI/centos
totale 5792
drwxr-xr-x. 3 root root    4096 28 feb 01.00 .
drwxr-xr-x. 4 root root    4096 27 feb 23.28 ..
-rwxr-xr-x. 1 root root     128  7 dic 14.19 BOOT.CSV
drwxr-xr-x. 2 root root    4096 28 feb 00.54 fonts
-rwxr-xr-x. 1 root root 1009536 24 nov 16.49 gcdx64.efi
-rwxr-xr-x. 1 root root    7038 28 feb 01.00 grub.cfg
-rwxr-xr-x. 1 root root    1024 27 feb 23.34 grubenv
-rwxr-xr-x. 1 root root 1009536 24 nov 16.49 grubx64.efi
-rwxr-xr-x. 1 root root 1283952  7 dic 14.19 MokManager.efi
-rwxr-xr-x. 1 root root 1291512  7 dic 14.19 shim-centos.efi
-rwxr-xr-x. 1 root root 1296176  7 dic 14.19 shim.efi

cat /mnt/raidboot/efi/EFI/centos/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
set pager=1

if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="${saved_entry}"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

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 {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

terminal_output console
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/00_tuned ###
set tuned_params=""
### END /etc/grub.d/00_tuned ###

### BEGIN /etc/grub.d/01_users ###
if [ -f ${prefix}/user.cfg ]; then
  source ${prefix}/user.cfg
  if [ -n ${GRUB2_PASSWORD} ]; then
    set superusers="root"
    export superusers
    password_pbkdf2 root ${GRUB2_PASSWORD}
  fi
fi
### END /etc/grub.d/01_users ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-82ff7a16-6e1d-4c29-930d-055db267aaa8' {
   load_video
   set gfxpayload=keep
   insmod gzio
   insmod part_gpt
   insmod part_gpt
   insmod part_gpt
   insmod diskfilter
   insmod mdraid1x
   insmod xfs
   set root='mduuid/1f726cc3387c49c33cee8230f11a4640'
   if [ x$feature_platform_search_hint = xy ]; then
     search --no-floppy --fs-uuid --set=root --hint='mduuid/1f726cc3387c49c33cee8230f11a4640'  25fc17e0-29bb-4e5b-b1b7-06216cd7e0a1
   else
     search --no-floppy --fs-uuid --set=root 25fc17e0-29bb-4e5b-b1b7-06216cd7e0a1
   fi
   linuxefi /vmlinuz-3.10.0-327.el7.x86_64 root=/dev/mapper/vgroot-root ro crashkernel=auto rd.auto=1 rd.lvm.lv=vgroot/root rd.md.uuid=fea6baab:29711848:997387aa:295ec48f rd.md.uuid=1f726cc3:387c49c3:3cee8230:f11a4640 rd.lvm.lv=vgroot/swap rhgb quiet 
   initrdefi /initramfs-3.10.0-327.el7.x86_64.img
}
menuentry 'CentOS Linux (0-rescue-26d51bbb9d054b0a8566525e1d8f3937) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-26d51bbb9d054b0a8566525e1d8f3937-advanced-82ff7a16-6e1d-4c29-930d-055db267aaa8' {
   load_video
   insmod gzio
   insmod part_gpt
   insmod part_gpt
   insmod part_gpt
   insmod diskfilter
   insmod mdraid1x
   insmod xfs
   set root='mduuid/1f726cc3387c49c33cee8230f11a4640'
   if [ x$feature_platform_search_hint = xy ]; then
     search --no-floppy --fs-uuid --set=root --hint='mduuid/1f726cc3387c49c33cee8230f11a4640'  25fc17e0-29bb-4e5b-b1b7-06216cd7e0a1
   else
     search --no-floppy --fs-uuid --set=root 25fc17e0-29bb-4e5b-b1b7-06216cd7e0a1
   fi
   linuxefi /vmlinuz-0-rescue-26d51bbb9d054b0a8566525e1d8f3937 root=/dev/mapper/vgroot-root ro crashkernel=auto rd.auto=1 rd.lvm.lv=vgroot/root rd.md.uuid=fea6baab:29711848:997387aa:295ec48f rd.md.uuid=1f726cc3:387c49c3:3cee8230:f11a4640 rd.lvm.lv=vgroot/swap rhgb quiet 
   initrdefi /initramfs-0-rescue-26d51bbb9d054b0a8566525e1d8f3937.img
}
if [ "x$default" = 'CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)' ]; then default='Advanced options for CentOS Linux>CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)'; fi;
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'CentOS Linux release 7.2.1511 (Core)  (on /dev/mapper/centos-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-3e9ce32e-8b26-4053-ad4e-1b75fda46260' {
   insmod part_gpt
   insmod xfs
   set root='hd0,gpt2'
   if [ x$feature_platform_search_hint = xy ]; then
     search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  1c8085bb-a226-4435-8e6f-0953025f6f1a
   else
     search --no-floppy --fs-uuid --set=root 1c8085bb-a226-4435-8e6f-0953025f6f1a
   fi
   linux /vmlinuz-0-rescue-26d51bbb9d054b0a8566525e1d8f3937 root=/dev/dm-5
   initrd /initramfs-0-rescue-26d51bbb9d054b0a8566525e1d8f3937.img
}
submenu 'Advanced options for CentOS Linux release 7.2.1511 (Core)  (on /dev/mapper/centos-root)' $menuentry_id_option 'osprober-gnulinux-advanced-3e9ce32e-8b26-4053-ad4e-1b75fda46260' {
   menuentry 'CentOS Linux release 7.2.1511 (Core)  (on /dev/mapper/centos-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-0-rescue-26d51bbb9d054b0a8566525e1d8f3937--3e9ce32e-8b26-4053-ad4e-1b75fda46260' {
      insmod part_gpt
      insmod xfs
      set root='hd0,gpt2'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  1c8085bb-a226-4435-8e6f-0953025f6f1a
      else
        search --no-floppy --fs-uuid --set=root 1c8085bb-a226-4435-8e6f-0953025f6f1a
      fi
      linux /vmlinuz-0-rescue-26d51bbb9d054b0a8566525e1d8f3937 root=/dev/dm-5
      initrd /initramfs-0-rescue-26d51bbb9d054b0a8566525e1d8f3937.img
   }
   menuentry 'CentOS Linux release 7.2.1511 (Core)  (on /dev/mapper/centos-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.10.0-327.el7.x86_64--3e9ce32e-8b26-4053-ad4e-1b75fda46260' {
      insmod part_gpt
      insmod xfs
      set root='hd0,gpt2'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  1c8085bb-a226-4435-8e6f-0953025f6f1a
      else
        search --no-floppy --fs-uuid --set=root 1c8085bb-a226-4435-8e6f-0953025f6f1a
      fi
      linux /vmlinuz-3.10.0-327.el7.x86_64 root=/dev/dm-5
      initrd /initramfs-3.10.0-327.el7.x86_64.img
   }
}

### 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  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

EFI 부팅 목록

efibootmgr -v
BootCurrent: 0001
BootOrder: 0004,0003,0000,0001,0002
Boot0000* EFI DVD/CDROM   ACPI(a0341d0,0)PCI(d,0)SATA(0,0,0)
Boot0001* EFI Hard Drive   ACPI(a0341d0,0)PCI(d,0)SATA(1,0,0)
Boot0002* EFI Internal Shell   MM(b,3fc4f000,3ffbefff)FvFile(7c04a583-9e3e-4f1c-ad65-e05268d0b4d1)
Boot0003* CentOS Linux   HD(1,800,64000,b5c88e63-06fa-4f20-8cb9-9bad8b5c79fc)File(\EFI\centos\shim.efi)
Boot0004* CentOS Raid   HD(1,800,64000,2a458d61-6959-4ec3-a283-1c4d1f76f69d)File(\EFI\centos\shim.efi)

답변1

{Centos,alma,Rock,Oracle}linux8 라이브 소프트웨어 RAID 설치에 대한 영수증을 주면 도움이 될까요?

1단계) ISO에서 Almalinux 설치

디스크 /dev/sda에 설치됨

2단계) 최신 패키지로 업그레이드

dnf upgrade
dnf install vim 

(vi 문제를 피하기 위해)

3단계) ​​Raid 패키지 설치

dnf install mdadm

4단계) 이제 파티션 테이블을 sda에서 sdb로 복사해야 합니다.

sgdisk -R /dev/sdb /dev/sda
sgdisk -G /dev/sdb

5단계) /dev/sdb의 파티션을 RAID 디스크로 변환

sgdisk -t 1:fd00 -t 2:fd00 -t 3:fd00 /dev/sdb

6단계) RAID 초기화

mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/sdb1 --metadata=0.90
mdadm --create /dev/md1 --level=1 --raid-disks=2 missing /dev/sdb2 --metadata=0.90
mdadm --create /dev/md2 --level=1 --raid-disks=2 missing /dev/sdb3

7단계) /boot를 /dev/md0에 복사합니다.

mkfs.vfat /dev/md0
mkfs.xfs /dev/md1

mkdir /mnt/md1

mount /dev/md1 /mnt/md1
mkdir /mnt/md1/efi

mount /dev/md0 /mnt/md1/efi

rsync -av /boot/. /mnt/md1

이제 /etc/fstab 파일을 편집해야 합니다. UUID가 포함된 행

전임자. UUID=c8ac59b8-ce54-4fca-8107-1b04aaa0194d /boot ext3 defaults 0 1 UUID 부분을 /dev/md1로 바꾸거나 올바른 UUID를 설정합니다(blkid 사용).

/dev/md1 /boot      xfs   defaults 0 1
/dev/md0 /boot/efi  vfat  umask=0077,shortname=winnt 0 2

echo raid1 >> /etc/modules-load.d/raid.conf 

cat /etc/modules-load.d/raid.conf 
raid1

dnf reinstal kernel-<current>
dracut -f 

8단계) 시스템 재시작

shutdown -r now

다시 시작한 후 명령 결과를 볼 수 있습니다.

mount | grep boot

다음과 유사한 줄이 표시되어야 합니다.

/dev/md0 on /boot type xfs (rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota)

이제 /dev/md0에 대한 루트 액세스가 필요하다고 GRUB에 알릴 수 있습니다.

echo 'GRUB_PRELOAD_MODULES="raid dmraid"' >> /etc/default/grub

이제 /etc/default/grubGRUB_CMDLINE_LINUX에서 rd.md.uuid=를 편집하고 추가하고 "mdadm --detail /dev/md2"에서 /dev/md2의 UUID를 가져옵니다.

GRUB_CMDLINE_LINUX="resume=/dev/mapper/almalinux-swap rd.lvm.lv=almalinux/root rd.md.uuid=58fd9cb6:0904f51a:1d561e2a:47682614 rd.lvm.lv=almalinux/swap"

cd /etc;grub2-mkconfig -o $(readlink /etc/grub2-efi.cfg)

dnf reinstal kernel-<current>
dracut -f 

9단계) /dev/mdY를 습격하기 위해 /dev/sdaX를 추가합니다.

sgdisk -t 2:fd00 /dev/sda 

mdadm --add /dev/md0 /dev/sda1
mdadm --add /dev/md1 /dev/sda2

10단계) LVM을 /dev/md3으로 이동

/dev/sda3에 설치하면 LVM이 생성되므로 이를 /dev/md2로 옮긴 다음 /dev/sda3에서 제거해야 합니다.

pvcreate /dev/md2
vgextend almalinux /dev/md2

swapoff -a
lvremove /dev/almalinux/swap

pvmove /dev/sda3 /dev/md2

pvmove 단계는 CPU와 디스크 크기에 따라 시간이 좀 걸릴 것입니다. 저는 몇 시간이 걸렸습니다.

vgreduce almalinux /dev/sda3

pvremove /dev/sda3

lvcreate -l +100%VG -n swap almalinux
mkswap /dev/almalinux/swap

11 단계) raid에 /dev/sda2 추가

sgdisk -t 3:fd00 /dev/sda

mdadm --add /dev/md2 /dev/sda3

이제 명령을 실행하십시오.

cat /proc/mdstat

RAID가 디스크 동기화를 수행하고 있는 것을 볼 수 있습니다.

완료되면 다시 시작하세요.

관련 정보