# RAID Partitions
- Redundant Array of Independent Disks
- `mdadm`: utlity for creating, managing, and monitoring RAID arrays (multiple disk admin)
- `mdadm --create /dev/md0 --level=5 --raid-devices=4 /dev/drive1 /dev/drive2 /dev/drive3 /dev/drive4`
- creates RAID array called /dev/md0
- `cat /proc/mdstat` to show RAID arrays and related info
- `mdadm --detail --scan` to show info in config file
- can redirect the above into `/etc/mdadm/mdadm.conf` to force OS to find and rebuild md0 every time the system boots up
- typically not needed
- `mdadm /dev/md0 --add /dev/drive4` to add another drive to RAID array
- `mdadm --stop /dev/md0` to stop RAID array
# LUKS
- Linux Unified Key Setup
- `sudo cryptsetup -v luksFormat partition_path` to create a LUKS partition
- `sudo cryptsetup -v luksOpen partition_path decrypted_name` to decrypt LUKS partition and assign name to decrypted partition
- `ls -al /dev/mapper` to show location for decrypted partition
- `sudo mkfs -t ext4 /dev/mapper/decrypted_name`to apply ext4 fs to decrypted partition
- `sudo mount /dev/mapper/decrypted_name mount_point`
- `echo “decrypted_name UUID=”xxx” -” > /etc/cryptab` adds decrypted partition to `/etc/cryptab`
- `lsblk -f | grep -v loop` to show UUID and fs info for partitions (and ignore loopback entires)![[images/Pasted image 20250802190424.png]]
- can also have keys input from USB using the third “-“ field in cryptab
- `echo “/dev/mapper/decrypted_name mount_point ext4 defaults 0 0” >> /etc/fstab` adds entry to `/etc/fstab` to auto mount the LUKS partition on reboot and prompt for passphrase
- `sudo cryptsetup -v luksClose /dev/mapper/decrypted_name` to encrypt the LUKS partition