How to setup a Home Raid Lab using RPi Compute Module 4 (Part 2)
TechBytes with Ron Nutter
Want to learn how to create a raid0 on rpi? Want to learn how to create a raid 1 array on rpi? Want to see how to do this with RPI CM4? Stay tuned and I will show you how to do this
⏱️TIMESTAMPS⏱️ 0:00 - Intro 0:46 - What we will be covering 2:20 - creating SD card 2:43 - enable ssh on boot 3:04 - enable usb ports on IO card 3:26 - initial boot of CM4 4:10 - install OS updates 5:20 - checking USB ports being active 5:53 - install mdadm for raid 6:04 - checking mdadm 6:17 - checking USB drives 6:57 - partitioning drives 7:57 - checking partitions 8:58 - setting up raid 0 9:40 - setting up raid 1 10:33 - checking array build status
sudo apt-get update sudo apt-get upgrade -y
Create zero bytes file named ssh in root of boot sd
Check for devices plugged in on usb lsusb -t
Sudo nano /boot/config.txt Add this line - dtoverlay=dwc2,dr_mode=host
Save and exit Reboot pi and usb should be active
!! Install mdadm sudo apt-get update sudo apt-get upgrade -y sudo apt-get install mdadm -y
! Verifies mdadm is installed sudo mdadm -V
!verify raid setup sudo mdadm --examine /dev/sda /dev/sdb
! Show status of array building cat /proc/mdstat
! For more detail in array building process sudo mdadm --detail /dev/md0
! To stop array sudo mdadm --stop --scan
! List drives current attached lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT
Identify mount point lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT
Raid 0 sudo mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sda /dev/sdb
Raid 1 sudo mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda /dev/sdb
Create mount point sudomkdir-p /mnt/md0
Save array layout sudo mdadm --detail --scan |sudotee-a /etc/mdadm/mdadm.conf
Automounting at boot echo'/dev/md0 /mnt/md0 ext4 defaults,nofail,discard 0 0'|sudotee-a /etc/fstab
https://www.cloudwards.net/how-to-wipe-a-hard-drive/
https://www.digitalocean.com/community/tutorials/how-to-create-raid-arrays-with-mdadm-on-debian-9
Show how to do this on Linux as well
These directions appear to be the way to go
https://www.ricmedia.com/build-raspberry-pi3-raid-nas-server/ Good way to introduce compute module 4
Raid 0 - striping data across drives • Lowest overhead in write speed • Single Drive failure results in total data loss Raid 1 - mirrored drives (50% overhead) • Match set of drives • Single drive failure tolerated • Slow write performance • Data is written to both drives
================================================ *** Show Notes, Links and Resources **** USB hub 3.0,7-Port USB Hub https://amzn.to/3qU1v4S
Raspberry Pi Compute Module 4 Lite w/ Wifi https://amzn.to/3eXyMqZ
143823802 Bytes