RAID-0 (Striping)
You can create a stripe with raidtools by making a few simple changes to the /etc/raidtab file used earlier for the linear mode array:
# A striped array with two member disks raiddev /dev/md0 raid-level 0 chunk-size 64 persistent-superblock 1 nr-raid-disks 2 device /dev/sdb1 raid-disk 0 device /dev/sdc1 raid-disk 1
Since you’ve changed the array type to striped
(0), the chunk-size now has an
impact on array performance. Since the chunk-size
defines the amount of data that gets written to the member disk during
each write, choosing a chunk-size that approximates
the average write size (average file size) is desirable. Remember that
unless you first erase the RAID superblocks from previously used
disks, mdadm will prompt you for
confirmation.
Run mkraid to create and activate the RAID-0:
# mkraid /dev/md0
handling MD device /dev/md0
analyzing super-block
disk 0: /dev/sdb1, 17920476kB, raid superblock at 17920384kB
disk 1: /dev/sdc1, 17920476kB, raid superblock at 17920384kBAlternatively, use mdadm to create a
two-disk stripe with a 64 KB chunk-size on
/dev/md0, using disk partitions
/dev/sdb1 and
/dev/sdc1:
# mdadm -Cv -l0 -c64 -n2 /dev/md0 /dev/sd{b,c}1
mdadm: array /dev/md0 started./proc/mdstat now reports that the new RAID-0 array has been created and is online:
# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid5]
read_ahead 1024 sectors
md0 : active raid0 sdc1[1] sdb1[0]
35840768 blocks 64k chunksYou can now use mke2fs to create a filesystem:
unused devices: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access