LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-24-2011, 08:06 PM   #1
heffo_j
Member
 
Registered: Jan 2005
Location: Caboolture, Oz
Distribution: Currently Zorin 17
Posts: 160

Rep: Reputation: 16
RAID 1 setup question


I've finally found a couple of useful tutorials on setting up RAID in Linux. However, because this is new ground to me, I have a couple of basic questions which I think the tutorial writers gloss over because of their familiarity with the process. My questions are these:

1. Most tutorials speak about setting up only one partition on clean drives. Can I set up more than one (e.g. / and home) to be mirrored as two partitions?

2. When starting with two identical clean drives, do I need to set up my partitions identically on both drives or is it only the partitions that I want mirrored to the second drive?

Thank you for your help

John
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-24-2011, 08:59 PM   #2
tommylovell
Member
 
Registered: Nov 2005
Distribution: Raspbian, Debian, Ubuntu
Posts: 380

Rep: Reputation: 103Reputation: 103
Quote:
1. Most tutorials speak about setting up only one partition on clean drives. Can I set up more than one (e.g. / and home) to be mirrored as two partitions?
Yes, you can set up more than one partition on a disk as a RAID1 device.

Quote:
2. When starting with two identical clean drives, do I need to set up my partitions identically on both drives or is it only the partitions that I want mirrored to the second drive?
By this I think you are asking if the drives need to be partitioned identically. The answer is 'no'.

You can set up just the RAID partitions on the second drive, if you wish, omitting non-RAID partitions. What is more important is that the sizes of the partitions that are "paired" are "nearly identical".

You actually can set up a RAID1 array with a device missing (drive or partition) and then add the missing device later just as long as it is large enough.

Here is an example multiple partitions as described in your first question. It has worked flawlessly. (Actually saving me when the devices were flaky before I updated the firmware on them.) Mine are set up identically but they do not need to be, just as long as the sizes correspond.

Code:
[root@athlonz ~]# fdisk -l

Disk /dev/sda: 1500.3 GB, 1500300828160 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00031558

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        3126    25005172+  fd  Linux raid autodetect
/dev/sda3            3127      182401  1440026437+   5  Extended
/dev/sda5            3127      182401  1440026406   fd  Linux raid autodetect

Disk /dev/sdb: 500.1 GB, 500130372608 bytes
255 heads, 63 sectors/track, 60804 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 1500.3 GB, 1500300828160 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0002a7c0

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1          13      104391   83  Linux
/dev/sdc2              14        3126    25005172+  fd  Linux raid autodetect
/dev/sdc3            3127      182401  1440026437+   5  Extended
/dev/sdc5            3127      182401  1440026406   fd  Linux raid autodetect
[root@athlonz ~]# 


[root@athlonz ~]# cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4] 
md1 : active raid1 sda5[0] sdc5[1]
      1440026304 blocks [2/2] [UU]
      
md0 : active raid1 sda2[0] sdc2[1]
      25005056 blocks [2/2] [UU]
      
unused devices: <none>
[root@athlonz ~]#
Creating an array with a missing device is quite easy.

Code:
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda1 missing
echo 'DEVICE /dev/hd*[0-9] /dev/sd*[0-9]' > /etc/mdadm.conf
mdadm --detail --scan >> /etc/mdadm.conf
Adding the missing device is done like this.
Code:
mdadm --manage /dev/md0 --add /dev/sdb1
If the RAID device is defined in '/etc/mdadm.conf' with UUID you are done; if the underlying block devices are explicitly specified, you need to change the 'missing' to the newly added device.

Hope this helps.

Last edited by tommylovell; 02-24-2011 at 09:04 PM.
 
2 members found this post helpful.
Old 02-25-2011, 02:46 AM   #3
heffo_j
Member
 
Registered: Jan 2005
Location: Caboolture, Oz
Distribution: Currently Zorin 17
Posts: 160

Original Poster
Rep: Reputation: 16
Tommy,

You have gone to a lot of trouble to help me. I sincerely appreciate your support. Thank you!

I have not got time to study your work (at the moment) but I will print it off and have a good look at it. I think you have answered my questions.

thank you once again.

John

Last edited by heffo_j; 02-25-2011 at 02:50 AM.
 
  


Reply



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
Help setup raid 0 ossnap Linux - Server 3 03-27-2008 08:27 AM
software raid 10 (yes, another raid question) aunquarra Linux - Server 3 06-15-2007 05:28 PM
Hardware Raid Setup Question - LVM? funbags Linux - Hardware 0 11-13-2005 11:39 AM
pSeries RAID setup (hardware question) Risc91 AIX 4 09-21-2004 03:45 AM
RH8.0 RAID setup question tarballed Linux - General 1 02-06-2003 05:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:44 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