LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-23-2011, 06:23 PM   #1
Deerslayer
Member
 
Registered: May 2005
Distribution: CentOS 7
Posts: 34

Rep: Reputation: 15
Setting up a RAID array w/ multiple partitions


I need to set up a RAID 1 array on Squeeze. I have 3 partitions: sda1 is root, sda5 is home, and sda6 is swap. (sda2 is the extended partition containing home and swap. This was a clean installation, so I don't know what happened to sda3 and sda4...)

All the information that I've been able to find recommends doing something like this:

mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/sdb1 /dev/sdc1

Do I need to type a separate command for each partition, or is there a better way to do it? Also, should I use the UUID instead of the dev names?
 
Old 05-23-2011, 06:34 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Yes, you do have to do that separately for each partition. You don't have to do that for the swap partitions, if you mention them both in your fstab the kernel will automatically choose a scheme to use them.

Regarding sda3 and sda4, they are reserved for primary partitions, logical partitions in an extended partition will start at sda5, so this is normal behavior, don't bother with that.
 
Old 05-23-2011, 08:56 PM   #3
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,686

Rep: Reputation: 124Reputation: 124
The easiest way to set up a RAID 1 is to install to a single disk, then add the 2nd to the array and have the kernel do the copying

When I upgraded my RAID 5 setup in my fileserver (from 3x 500G to 3x 2TB) I exchanged one 500G disk with a 2 TB one, then have the kernel recreate the filesystem on that disk for 24 hrs, repeated twice more, then simply enlarged the filesystem (XFS) on the RAID. So, instead of 1TB I now have 4 TB in RAID to full up (up up up up up up up sorry, there's an echo somewhere down there there there there there there )
 
Old 05-25-2011, 12:12 PM   #4
Deerslayer
Member
 
Registered: May 2005
Distribution: CentOS 7
Posts: 34

Original Poster
Rep: Reputation: 15
Thanks for the answers. So should I mirror sda1 to sdb1 and sda5 to sdb5? In other words, hook up a blank drive on the next SATA port and run:

mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/sda5 /dev/sdb5
 
Old 05-25-2011, 12:53 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
That is the way I do it for my /home partition, except that I use a RAID 0 for it.
 
  


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
Setting up a system with a Raid 1 Array getza1 Linux - Hardware 4 11-13-2005 05:16 PM
How do I get multiple computers to talk to a raid array? Travis86 Linux - Hardware 5 11-16-2003 07:50 PM
help with setting up xfs on raid(0) array Dr Ecology Linux - General 0 06-16-2003 04:43 PM
setting up xfs on raid(0) array Dr Ecology Linux - Newbie 0 06-16-2003 04:29 PM
Creating multiple partitions in a software RAID heiseltc Linux - Hardware 1 05-31-2003 08:52 PM

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

All times are GMT -5. The time now is 03:41 PM.

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