參考
http://linux.vbird.org/linux_basic/0420quota.php#raid
不使用原 GUI 建立Raid 指令
fdisk /dev/sda fdisk /dev/sdb fdisk /dev/sdc fdisk /dev/sdd #將 a,b,c,d 硬碟分區
mdadm --create --auto=yes /dev/md0 --level=5 \
> --raid-devices=4 /dev/sda /dev/sdb /dev/sdc /dev/sdd
以四顆硬碟 raid 為例 sda,sdb,sdc,sdd 建立Raid5
mke2fs /dev/md0
# modprobe raid0 # mdadm -C /dev/md0 -l 0 -n 3 --homehost=NAS-34 /dev/sd[bcd]1 # mdadm -C /dev/md1 -l 0 -n 3 --homehost=NAS-34 /dev/sd[bcd]2
3. 格式化/dev/md0, md1
# mkfs.ext4 /dev/md0 # mkswap -f /dev/md1
檔案,設定適切的
/etc/mdadm.confDEVICE
與 ARRAY
值
DEVICE /dev/sd[abcd]1 ARRAY /dev/md0 devices=/dev/sda1,/dev/sdb1,/dev/sdc1,/dev/sdd1
mdadm --manage --stop /dev/md0
#啟動磁碟陣列
mdadm --assemble --run /dev/md0
#查看RAID狀態
# mdadm --detail /dev/md0
熱擴容
砍Raid
umount /dev/md0
mdadm --stop /dev/md0 # to halt the array mdadm --remove /dev/md0 # to remove the array mdadm --zero-superblock /dev/sd[abc]1 # delete the superblock from all drives in the array (edit /etc/mdadm/mdadm.conf to delete any rows related to deleted array)
/dev/ram / ext2 defaults 1 1
/dev/md0 /home ext3 defaults,usrquota,grpquota 1 1
/dev/sda2 swap swap defaults 0 0
none /proc proc defaults 0 0 ~
Images 0 | ||
---|---|---|
No images to display in the gallery. |