Usual raid commands

Usual linux raid commands reminder :

  • Create raid array :
mdadm --create /dev/mdx --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1  
  • Delete raid array
mdadm --stop /dev/mdx
mdadm --zero-superblock /dev/sda /dev/sdb
  • Remove a disk from an array
mdadm --manage /dev/mdx --set-faulty /dev/sda1
mdadm --manage /dev/mdx --remove /dev/sda1  
  • Add a disk to an array
  mdadm --manage /dev/mdx --add /dev/sda1
  • Increase the raid array size if the replacing disks are bigger
  mdadm --grow /dev/mdx --size=max
  #increase the filesystem size for an ext4 filesystem
  resize2fs /dev/mdx
  #if btrfs
  btrfs filesystem resize max /dev/mdx
  • Details about a raid array
cat /proc/mdstat
mdadm --detail /dev/mdx  

MG1

hddraid

96 Words

2024-02-01 18:04 +0100

.