Files
snippets/nas/README.md

1.5 KiB

Setup RAID

List all devices

lsblk

Create new partition

For each drive you'll need to type fdisk /dev/sdx replace the x with the letter of the drive. and youll want to use option d to delete a partition and n to make a new partition, just go ahead and use the smaller value for start and biggest value for last sector since im sure you want to utilize the whole drive, then optionp to print the partion table then option w to finalize the whole thing. repeat for all the drives involved.

List each of the drives

ls /dev/sd[a-d]*

Create new RAID

mdadm --create --verbose /dev/md0 --level=10 --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1

next youll want to type the command ls -l /dev/disk/by-uuid and take note of the entries that are there. you should NOT see an entry for your new array

mkfs.ext4 -F /dev/md0

Setup mount

ls -l /dev/disk/by-uuid

get the UUID from the lrwxrwxrwx 1 root root 11 Jul 18 17:12 c9399944-da22-456a-8c6b-d768ac3471b1 -> ../../md0 part and define it in /etc/fstab

nano /etc/fstab
UUID=c9399944-da22-456a-8c6b-d768ac3471b1 /path/to/mount ext4 auto 0 0
reboot

TS

parted /dev/sdb

mklabel gpt

print

mkpart primary 0% 100%
cat /proc/mdstat
umount -l /mnt/data
mdadm --stop /dev/md127
mdadm --zero-superblock /dev/sda1
mdadm --zero-superblock /dev/sdb1
mdadm --detail /dev/md127