화요일, 10월 8, 2024
HomeLinuxubuntu raid setting

ubuntu raid setting

ubuntu raid setting

1. ll /dev/xv*

brw-rw---- 1 root disk 202, 16 May 22 04:41 /dev/xvdf
brw-rw---- 1 root disk 202, 80 May 22 05:28 /dev/xvdg

2.mdadm

mdadm --manage /dev/md0 --stop
mdadm --create /dev/md0 --level 0 --chunk=256 --metadata=1.1 --raid-devices=2 /dev/xvdf /dev/xvdg
echo DEVICE /dev/xvdf /dev/xvdg | tee /etc/mdadm/mdadm.conf
mdadm --detail --scan | tee -a /etc/mdadm/mdadm.conf
mkfs.xfs /dev/md0 #### format EBS ## do 1st time only
ll /dev/md0
mkdir /raiddrive
mount /dev/md0 /raiddrive
df -h

3.vi /etc/fstab

/dev/md0 /raiddrive auto defaults,nobootwait,noatime 0 0

4.vi /etc/initramfs-tools/conf.d/mdadm

BOOT_DEGRADED=yes

5.Update the initramfs image

update-initramfs -k $(uname -r) -u -v

6.mdadm.conf
before

cat /etc/mdadm/mdadm.conf
DEVICE /dev/xvdf /dev/xvdg
ARRAY /dev/md0 metadata=1.1 name=ip-10-1-2-202:0 UUID=xxxxxxxxx

after1

echo "CREATE owner=root group=disk mode=0660 auto=yes" > /etc/mdadm/mdadm.conf
echo "HOMEHOST " >> /etc/mdadm/mdadm.conf
mdadm --detail --scan | tee -a /etc/mdadm/mdadm.conf

after2

vi /etc/mdadm/mdadm.conf
before : ARRAY /dev/md0 metadata=1.1
after : ARRAY /dev/md0 level=raid0 metadata=1.1

7. reboot

reboot
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular