LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-29-2009, 03:01 PM   #1
1veedo
Member
 
Registered: Dec 2004
Location: WV, USA
Distribution: Gentoo, Debian
Posts: 186

Rep: Reputation: 34
mdadm RAID5 when one of your drives contains your data?


I have three drives and want to put them in RAID5. The problem is, one of the drives currently contains the data I want on the raid array.

I was thinking that maybe I could create a RAID0 out of the other two, move my data over, and somehow add the other drive and turn it into RAID5? The harddrive is encrypted so it wont be able to tell that any of the drives contain data.


edit -- Is it possible to build a partial RAID5 array from two drives and then add the third drive and have it "rebuild" the data, almost as if you had a drive die on you??

Last edited by 1veedo; 05-29-2009 at 03:33 PM.
 
Old 05-29-2009, 06:48 PM   #2
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 573

Rep: Reputation: 61
RAID5 arrays have the data striped across all disks, so you can't build an array with the existing disk partitions.

Is there any spare space on your current disk? If there is (even if you need to use GParted to shrink your existing partition sizes) you could create a new RAID array using the spare space on your current disk together with the other disks, and then repeatedly migrate data, shrink the original disk partitions, and increase the array size using the freed space. If you did this incrementally you should be able to get there, but it could depend on what your current disk holds.

Does it store your Op/Sys or just data? If it is just data, then you can do it. If it is Op/Sys, you might want to boot from a LiveCD to achieve your aims.
 
Old 05-29-2009, 09:04 PM   #3
1veedo
Member
 
Registered: Dec 2004
Location: WV, USA
Distribution: Gentoo, Debian
Posts: 186

Original Poster
Rep: Reputation: 34
Currently it holds my OS but I'm moving that to another HD soon. I think I can manager about 400GB free on my 1TB (931GB) drive (if I move some other files over as well).

I was hoping to not have any partitions though. Ie be able to create a RAID5 device node directly from sdb sdc sdd. If I do what you're suggesting I'll probably need a partition table and everything.

Is it possible to migrate any RAIDs at all? Like is it possible to go from RAID0 to RAID4?
 
Old 05-30-2009, 01:59 AM   #4
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 573

Rep: Reputation: 61
Not without using partitions...as far as I know anyway. Migrating RAID levels isn't something I've ever done, so perhaps you should ask Google instead They might know more about it
 
Old 05-31-2009, 07:36 AM   #5
1veedo
Member
 
Registered: Dec 2004
Location: WV, USA
Distribution: Gentoo, Debian
Posts: 186

Original Poster
Rep: Reputation: 34
What if I do RAID10 using 6 partitions?

___ ___ ___
a |1| |2| |3|
--- --- ---
b |2| |3| |1|
--- --- ---

Make RAID0s out of row a and row b, then raid1 them. I think this is more adaptable than raid 5. I've already worked on paper how to expand that array. Even if I were to add a 2GB drive it's possible to have a RAID10 with full data redundancy. The only thing I dont know about is if partition b2 is going to be identicle to partition a2. If they're not exactly the same it would be a waste, and seeing as how the partitions are slightly different in size, the two RAID0 arrays could be off by a few blocks from each other... Maybe it's better to RAID1 each pair and put those pairs in RAID0...

I've been trying to create a RAID0 out of the top three though just to see how everything works but I've been getting errors.

edit --
Code:
mdadm --create --verbose -l 0 -n 3 /dev/sdb1 /dev/sdc1 /dev/sdd1
mdadm: You haven't given enough devices (real or missing) to create this array
Then sdb1 errors any time I try to do anything with it; "/dev/sdb1: can't read superblock". I have to reboot to access sdb1 again. sdc1 and sdd1 continue to work just fine.

I also get an md device.

"mount: special device /dev/md127 does not exist"
"mdadm: md device /dev/md127 does not appear to be active."

I dont understand why it doesn't work. I give it three devices, tell it I want to use three devices, then it tells me I didn't give it enough devices to make the array. I'm doing it exactly as I've seen in examples on the web, and these errors show up nowhere.

Last edited by 1veedo; 05-31-2009 at 12:45 PM.
 
Old 05-31-2009, 01:31 PM   #6
1veedo
Member
 
Registered: Dec 2004
Location: WV, USA
Distribution: Gentoo, Debian
Posts: 186

Original Poster
Rep: Reputation: 34
Ok I got it working. Aftering reading some more and cleaning all the superblocks etc I got it to work with RAID0. Raid10 is is "experimental" in the kernel. Usually not something I worry about but I figure it would be just as easy to raid 1 all three partitions and then raid 0 that, to ensure that the "matching" partitions are compatible. I'm not sure how much that would slow down performance. I still have to encrypt everything as well, but right now hdparm is showing amazing results for the current raid0 array.
Code:
hdparm -t /dev/md0

/dev/md0:
 Timing buffered disk reads:  888 MB in  3.00 seconds = 295.94 MB/sec
Code:
hdparm -t /dev/sdb1 /dev/sdc1 /dev/sdd1

/dev/sdb1: [Western Digital Caviar Black WD1001FALS]
 Timing buffered disk reads:  306 MB in  3.00 seconds = 101.98 MB/sec

/dev/sdc1: [Seagate ST31000528AS]
 Timing buffered disk reads:  370 MB in  3.01 seconds = 122.96 MB/sec

/dev/sdd1: [SAMSUNG HD103UJ]
 Timing buffered disk reads:  300 MB in  3.00 seconds =  99.96 MB/sec
Once I get everything figured out I'll post some more benchmarks using encryption and everything.

Last edited by 1veedo; 05-31-2009 at 01:34 PM.
 
Old 06-06-2009, 01:41 AM   #7
1veedo
Member
 
Registered: Dec 2004
Location: WV, USA
Distribution: Gentoo, Debian
Posts: 186

Original Poster
Rep: Reputation: 34
edit it's late I got it

Last edited by 1veedo; 06-06-2009 at 01:47 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
mdadm raid5 problem... oh please save my data pepsimachine15 Linux - Software 7 02-14-2009 10:12 PM
data recovery from raid5 drives bobloblian Linux - Hardware 2 12-07-2008 01:58 PM
mdadm clean install of four drives overwritting any previous raid5 disk array javaholic Linux - Server 15 10-13-2008 11:05 AM
RAID5 data rebuilding by mdadm results in corrupted data! rtyagi Linux - Newbie 0 03-26-2008 01:59 AM

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

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