[CentOS] RAID

2014. 8. 25. 17:33OS/CentOS

# yum -y install mdadm

# fdisk /dev/sdb

> n

> p

> 1

> [엔터]

> [엔터]

> w


# mknod /dev/md127 b 9 1

# mdadm --create /dev/md127 --level=1 --raid-device=2 /dev/sdb1 /dev/sdc1

# mkfs.ext4 /dev/md127


상태확인

# df -h

# fdisk -l

# ls -l /dev/sd*

ls -l /dev/md*

# mdadm --query --detail /dev/md127


복구

# mdadm /dev/md127 --add /dev/sdd1


제거

# mdadm --remove /dev/md127 /dev/sdb1



# fdisk -l

# fdisk /dev/xvdb

> n

> p

> 1

> [엔터]

> [엔터]

> w

# df -h

# pvcreate /dev/xvdb1

# pvs

# vgcreate VG_Data /dev/xvdb1

# vgextend VolGroup /dev/xvdb1

# vgs

# lvcreate -L 10G -n lv_data VG_Data

# lvextend -L +1G /dev/VolGroup/lv_root

-l+100%FREE

# lvs

# mkfs.ext4 /dev/mapper/VG_Data-lv_data



# e2fsck -ff /dev/VolGroup/lv_home

# resize2fs /dev/VolGroup/lv_home 10G

# lvreduce -r -L 10G /dev/VolGroup/lv_home

# lvresize -r -l+100%FREE /dev/VolGroup/lv_root


# lvremove /dev/VolGroup/lv_home

# lvresize -r -l+100%FREE /dev/VolGroup/lv_root


'OS > CentOS' 카테고리의 다른 글

[CentOS] Samba  (0) 2014.09.03
[CentOS] NFS  (0) 2014.09.03
[CentOS] Network Bond  (0) 2014.08.04
[CentOS] fail2ban  (0) 2014.08.04
[CentOS] snmp  (0) 2014.08.04