LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-02-2014, 05:26 AM   #1
ratio
LQ Newbie
 
Registered: Apr 2014
Posts: 5

Rep: Reputation: Disabled
mdadm raid 1 with SSD and Ramdisk: Force reading from Ramdisk only


Is there any way to prevent or force reading from one device within a mdadm raid-1 array? Setting one device faulty is no option, array has to keep in sync all the time.

Background: I want to use mdadm to keep ramdisk in sync with SSD. For reading I want ramdisk to be used only. I am familiar to the fact, that linux kernel does a very intelligent load balancing, but for performance testing reasons it is important to read from ramdisk only.

Thank you!

Last edited by ratio; 04-07-2014 at 08:35 AM.
 
Old 04-02-2014, 02:44 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
I'm going to say no but someone might prove me wrong.

I know you can assign priority to raid swap but I've not seen it on software raid arrays. To be exact, I'd go to a hardware raid as the amount of overhead on the software would consume too much I'd think.

Not sure how to change data on one drive and both keep it in sync and not write to the other drive. Generally rsync or more advanced filesystems would be used to keep data secure. Btrfs or zfs might be used.
 
Old 04-02-2014, 02:50 PM   #3
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,160

Rep: Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266
When you create the raid1, give the ramdisk first, then the -W option, then the SSD. This makes the SSD "write-mostly" which means it will write to both, but reads will go the ramdisk. This is commonly used with SSD and HDD, but no reason it won't work with ramdisk.
 
1 members found this post helpful.
Old 04-03-2014, 03:50 PM   #4
ratio
LQ Newbie
 
Registered: Apr 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
@smallpond
Thank you! "--write-mostly" option is exactly what I was looking for. Yet uncertain is under which condition so-marked devices are used nevertheless. Some say that there is still an algorithm deciding about, some say that array needs to be in critical condition, like device failure. manpage says:

Quote:
"'write-mostly' [...] is valid for RAID1 only and means that the 'md' driver will avoid reading from these devices if at all possible. This can be useful if mirroring over a slow link."
@jefro
Thank you for introducing me into the world of btrfs. Is there any option (comparable to mdadm's "--write-mostly") to force/avoid reading from one device?

Last edited by ratio; 04-03-2014 at 03:51 PM.
 
Old 04-04-2014, 12:10 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,152

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
So test it - if it works in your seup well and good. If you have sysstat, sar will give you reasonable figures - else maybe try collectl, which will allow you to more process your I/O data over shorter timeframes. Iotop is a realtime tool for which processes are the top I/O users, not so much which device is being hit.
As for btrfs, looks like this has been discussed this year, but isn't in the plans.
 
Old 04-04-2014, 03:35 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
I think that both btrfs and zfs have a way to set at what level to do syncs. I was trying to look up exactly your situation but didn't get a full answer. Might ask the btrfs people. I only use it as a novice still.
 
  


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
RAMDISK: couldn't find valid ramdisk image starting at 0. iotc247 Slackware 10 12-10-2010 03:08 PM
Ramdisk that can do this? Ulysses_ Linux - Desktop 4 10-28-2010 11:22 AM
RAMDISK: EOF while reading compressed data ...Kernel panic - Unable to mount root skyxn3t Fedora 1 08-01-2010 03:10 AM
Ramdisk mudasar Linux - General 2 07-22-2010 11:54 AM
creating a ramdisk runtime from another ramdisk code123 Linux From Scratch 0 10-11-2004 08:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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