User Tools

Site Tools


huy:centos_upgrade

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

huy:centos_upgrade [2018/04/30 10:24] (current)
slayer created
Line 1: Line 1:
 +[[email protected] ~]# mdadm --fail /dev/md0 /dev/sdb1
 +mdadm: set /dev/sdb1 faulty in /dev/md0
 +[[email protected] ~]# mdadm --fail /dev/md1 /dev/sdb2
 +mdadm: set /dev/sdb2 faulty in /dev/md1
 +[[email protected] ~]# mdadm --fail /dev/md2 /dev/sdb3
 +mdadm: set /dev/sdb3 faulty in /dev/md2
 +[[email protected] ~]# mdadm --remove /dev/md0 /dev/sdb1
 +mdadm: hot removed /dev/sdb1 from /dev/md0
 +[[email protected] ~]# mdadm --remove /dev/md1 /dev/sdb2
 +mdadm: hot removed /dev/sdb2 from /dev/md1
 +[[email protected] ~]# mdadm --remove /dev/md2 /dev/sdb3
 +mdadm: hot removed /dev/sdb3 from /dev/md2
 +
 +
 +[[email protected] ~]# mdadm --zero-superblock /dev/sdb1
 +[[email protected] ~]# mdadm --zero-superblock /dev/sdb2
 +[[email protected] ~]# mdadm --zero-superblock /dev/sdb3
 +
 +[[email protected] ~]# mdadm --create /dev/md100 --level=1 --raid-devices=2 missing /​dev/​sdb1 ​
 +[[email protected] ~]# mdadm --create /dev/md101 --level=1 --raid-devices=2 missing /​dev/​sdb2 ​
 +[[email protected] ~]# mdadm --create /dev/md102 --level=1 --raid-devices=2 missing /​dev/​sdb3 ​
 +[[email protected] ~]# mkswap /dev/md100
 +[[email protected] ~]# mkfs.ext3 /dev/md101
 +[[email protected] ~]# mkfs.ext4 /​dev/​md102 ​
 +[[email protected] ~]# wget http://​download.openvz.org/​template/​precreated/​centos-7-x86_64-minimal.tar.gz
 +[[email protected] ~]# mount /dev/md102 /mnt/
 +[[email protected] ~]# mkdir /mnt/boot
 +[[email protected] ~]# mount /dev/md101 /mnt/boot/
 +[[email protected] ~]# cd /mnt/ ; tar xvfp /​root/​centos-7-x86_64-minimal.tar.gz ​
 +[[email protected] mnt]# for i in dev sys proc; do mount --rbind /$i /​mnt/​$i;​done
 +[[email protected] mnt]# cp /​etc/​resolv.conf /mnt/etc/
 +[[email protected] mnt]# chroot /mnt/
 +[[email protected] /]# yum install grub2-pc
 +[[email protected] /]# yum install kernel.x86_64 mdadm
 +[[email protected] /]# dracut -f /​boot/​initramfs-3.10.0-693.21.1.el7.x86_64.img 3.10.0-693.21.1.el7.x86_64
 +
 +[[email protected] /]# grub2-mkconfig ​ > /​boot/​grub2/​grub.cfg
 +[[email protected] /]# grub2-install ​ /dev/sdb
 +
 +
 +
  
huy/centos_upgrade.txt ยท Last modified: 2018/04/30 10:24 by slayer