cheat sheets.

$ cheat raid
#create raid autodetect disk
sudo fdisk /dev/sdc
n p 1
t 1 fd
w

#create raid autodetect disk
sudo fdisk /dev/sdb
n p 1
t 1 fd
w

#create new raid1 array with one device
mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/sdc1

#make file system in array
mkfs.ext3 /dev/md0

#mount device to /mnt
mount /dev/md0 /mnt

#check raid arrays
cat /proc/mdstat

#check state of a certain array (here its md0)
mdadm -D /dev/md0

#Add device sdb1 to md0
mdadm -a /dev/md0 /dev/sdb1

#Write configuration into config file
cd /etc/mdadm
mdadm --detail --scan >> mdadm.conf

#mark device as failed
mdadm -f /dev/md0 /dev/sdb1

#Remove device sdb1 from raid md0
mdadm -r /dev/md0 /dev/sdb1

#Add device sdd1 to md0 to replace sdb1
mdadm -a /dev/md0 /dev/sdd1

#desctruct raid array md0
mdadm --stop /dev/md0

Version 2, updated 446 days ago.
. o 0 ( | previous | history | revert to | current | diff )
( add new | see all )