ehowton (ehowton) wrote,
ehowton
ehowton

mdadm RAID10 on Raspberry

I haven't done this since Solaris 8:

First, create a RAID-1 mirror on two of the thumbdrives:

root@raspberrypi:~# lsscsi
[0:0:0:0] disk SanDisk Ultra Fit 1.00 /dev/sda
[1:0:0:0] disk SanDisk Ultra Fit 1.00 /dev/sdb
[2:0:0:0] disk SanDisk Ultra Fit 1.00 /dev/sdc
[3:0:0:0] disk SanDisk Ultra Fit 1.00 /dev/sdd


root@raspberrypi:~# mdadm -C -n2 -l1 /dev/md0 /dev/sd{a,b}

root@raspberrypi:~# cat /proc/mdstat

md0 : active raid1 sdb[1] sda[0]
60055552 blocks super 1.2 [2/2] [UU]
[=============>.......] resync = 65.2% (39190976/60055552) finish=38.5min speed=9024K/sec


WAIT

md0 : active raid1 sdb[1] sda[0]
60055552 blocks super 1.2 [2/2] [UU]

root@raspberrypi:~# mdadm -C -n2 -l1 /dev/md1 /dev/sd{c,d}

root@raspberrypi:~# cat /proc/mdstat

md1 : active raid1 sdd[1] sdc[0]
60055552 blocks super 1.2 [2/2] [UU]
[==============>......] resync = 73.9% (44421120/60055552) finish=27.9min speed=9313K/sec

WAIT

md1 : active raid1 sdd[1] sdc[0]
60055552 blocks super 1.2 [2/2] [UU]


Then RAID-0 stripe the new mirrored devices:

root@raspberrypi:~# mdadm -C -n2 -l0 -c64 /dev/md10 /dev/md{0,1}
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md/md10 started.


root@raspberrypi:~# cat /proc/mdstat
md10 : active raid0 md1[1] md0[0]
120045568 blocks super 1.2 64k chunks

md1 : active raid1 sdd[1] sdc[0]
60055552 blocks super 1.2 [2/2] [UU]

md0 : active raid1 sdb[1] sda[0]
60055552 blocks super 1.2 [2/2] [UU]

unused devices:


PUT A FILESYSTEM ON IT AND MOUNNT THE RAID 1+0

root@raspberrypi:/# mkfs.ext4 /dev/md10
mke2fs 1.43.4 (31-Jan-2017)
Creating filesystem with 30011392 4k blocks and 7503872 inodes
Filesystem UUID: 74a1ee72-9440-4435-b9d8-8a29cf052ab8
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done
Writing inode tables: done
Creating journal (131072 blocks): done
Writing superblocks and filesystem accounting information: done


root@raspberrypi:/# mount /dev/md10 /NAS/

root@raspberrypi:/# df -h /NAS

Filesystem Size Used Avail Use% Mounted on
/dev/md10 113G 61M 107G 1% /NAS



https://www.golinuxcloud.com/configure-hybrid-software-raid-10-linux/
Tags: linux
Subscribe

  • Sanitize EMCgrabs

    Script which is meant to run from a directory containing compressed/encapsulated EMCgrabs either from ESX or linux hosts. # Removes hostnames…

  • Because I always forget how to increment

    for x in {0..16} ; do cp -R file file$x ; done

  • Create Veritas Volumes

    scripts]$ cat vxcreate1 x=0 while [ $x = 0 ] do clear echo "Initialize all Veritas disks press 1" echo "Create a vg and extend disks into it press…

  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments