LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-07-2017, 08:43 PM   #1
rmcconnell
Member
 
Registered: Jan 2010
Location: Ithaca, NY
Distribution: Slackware
Posts: 36

Rep: Reputation: Disabled
Set up a secondary RAID-1 device


I recently set up a RAID-1 device on a new computer using a pair of WD Blue SATA drives. The official documentation describes how to set up a bootable drive, so there are a few details missing for a secondary drive. Here is how I did it. Hopefully, this will help others avoid some of the mistakes I made. This mostly follows the RAID How-To for a while, but diverges where necessary.
----

First, set up and copy the partition table. If your drives are larger than 2.3TB, you will have to use the gpt label type in cfdisk. DOS just won't handle it. These drives are all one partition, which is not bootable. The partition type is Linux Raid (86).

# cfdisk /dev/sdb
# fdisk -l /dev/sdb
# sfdisk -d /dev/sdb | sfdisk --force /dev/sdc
# fdisk -l

Next check to make sure there are no other multi-disk drives configured, then go ahead and configure yours. Make sure you get the correct device names. Since I am not using these as a boot device, I allowed it to use the newest edition of metadata.

# cat /proc/mdstat
# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
# cat /proc/mdstat
# mdadm --detail --scan > /etc/mdadm.conf

Now you need to create a mount point, add a line to fstab and format the drive, not necessarily in that order.

# mkfs.ext4 /dev/md0
# mkdir /raid0
# cd /etc
# joe fstab

Add this line to fstab:

/dev/md0 /raid0 ext4 defaults 1 2

Now you can mount your new RAID-1 drive.

# mount /dev/md0 /raid0

Finally, check the device status.

# cat /proc/mdstat

I was working with all new hardware, so I wasn't worried about losing any data. That made it a lot easier to try a few different options, and recover from a couple of mistakes before I allowed any data to be stored on it.
 
Old 04-13-2017, 01:26 AM   #2
lazardo
Member
 
Registered: Feb 2010
Location: SD Bay Area
Posts: 270

Rep: Reputation: Disabled
next time
Code:
# mdadm --create /dev/md0 \
--chunk-size=128k --bitmap=internal --level=10 --layout=f2 \
--raid-devices=2 /dev/sdb1 /dev/sdc1
for about 2x streaming read bump wo write penalty.

Notes:
- do some homework on mdadam chunk size, but 128k performance is much better than the default.
- bitmaps significantly shorten reconstruction time if there is an issue.
- RAID10 can be used on a 2-disk array, 'f2' is the performance magic
- compare between 2-disk RAID1 (boot partition) and 2-disk RAID10-f2 (SSDs on SATA-6):

Code:
$ cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] 
md1 : active raid1 sdb1[1] sda1[0]
      102336 blocks [2/2] [UU]
      
md5 : active raid10 sdb5[1] sda5[0]
      207616768 blocks 128K chunks 2 far-copies [2/2] [UU]
      bitmap: 0/2 pages [0KB], 65536KB chunk

unused devices: <none>
Code:
$ sudo hdparm -tT /dev/md{1,5}

/dev/md1:
 Timing cached reads:   22882 MB in  2.00 seconds = 11453.19 MB/sec
 Timing buffered disk reads:  98 MB in  0.21 seconds = 460.36 MB/sec

/dev/md5:
 Timing cached reads:   22688 MB in  2.00 seconds = 11356.08 MB/sec
 Timing buffered disk reads: 2900 MB in  3.00 seconds = 966.04 MB/sec
Cheers,
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Permissions set up to allow secondary group ZAMO Linux - Security 1 04-09-2014 10:11 PM
[SOLVED] Reducing the size of a device in an existing RAID set horde Linux - Server 4 09-14-2009 12:29 AM
Adding SATA RAID 5 secondary drives to Ubuntu (8.04) after installation dangerousdave Linux - Newbie 2 04-28-2008 07:14 PM
Secondary DNS Set up loccom Linux - General 2 05-05-2005 03:18 AM
RAID 0 (or 5) using primary and secondary channels, slower true? exabrial Linux - Hardware 2 07-20-2004 11:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration