raid0_debian
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
raid0_debian [2020/05/12 09:55] – chris | raid0_debian [2020/05/12 10:37] (current) – chris | ||
---|---|---|---|
Line 2: | Line 2: | ||
+ | The RAID 0 array works by breaking up data into chunks and striping it across the available disks. This means that each disk contains a portion of the data and that multiple disks will be referenced when retrieving information. | ||
+ | * Requirements: | ||
+ | * Primary benefit: Performance | ||
+ | * Make sure that you have functional backups. A single device failure will destroy all data in the array. | ||
+ | Identify the disks you want to use | ||
+ | lsblk -o NAME, | ||
+ | |||
+ | say you see sda, sdb and sdc. SDA is possibly divided in sda1 and sda2, meaning that this disk is in use. If the other are just SDB and SDC these should be the disk you are aiming for. | ||
+ | |||
+ | NAME SIZE FSTYPE TYPE MOUNTPOINT | ||
+ | sdb 100G disk | ||
+ | sdc 100G disk | ||
+ | sda | ||
+ | ├─sda1 | ||
+ | ├─sda14 | ||
+ | └─sda15 | ||
+ | |||
+ | |||
+ | Create the Array | ||
+ | |||
+ | sudo mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sda /dev/sdb | ||
+ | |||
+ | check if it is crated successful by doing a | ||
+ | |||
+ | cat / | ||
+ | |||
+ | The output should look something like: | ||
+ | |||
+ | Personalities : [raid0] | ||
+ | md0 : active raid0 sdb[1] sdc[0] | ||
+ | 209584128 blocks super 1.2 512k chunks | ||
+ | | ||
+ | unused devices: < | ||
+ | |||
+ | Next you have to create a filesystem to use your array | ||
+ | |||
+ | sudo mkfs.ext4 -F /dev/md0 | ||
+ | |||
+ | Note that MD0 is your array sdb1 and sdc2 together. | ||
+ | |||
+ | Now create a mount point on your system like /mnt/md0 or /datastore | ||
+ | |||
+ | sudo mkdir -p /mnt/md0 | ||
+ | |||
+ | After that you are able to mount the new array | ||
+ | |||
+ | sudo mount /dev/md0 /mnt/md0 | ||
+ | |||
+ | Check if it is available by doing: | ||
+ | |||
+ | df -h -x devtmpfs -x tmpfs | ||
+ | |||
+ | To make sure that the array is reassemble every time you boot your system you need to set your configuration of your array in a file / | ||
+ | |||
+ | sudo mdadm --detail --scan | sudo tee -a / | ||
+ | |||
+ | Next update the initramfs by doing a | ||
+ | |||
+ | sudo update-initramfs -u | ||
+ | |||
+ | If you like to auto mount your array at boot you need a entry in your fstab. Edit your fstab like this | ||
+ | |||
+ | echo '/ | ||
+ | |||
+ | |||
+ | That's all, enjoy. | ||
raid0_debian.1589270140.txt.gz · Last modified: 2020/05/12 09:55 by chris