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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-02-2014, 06:26 AM
|
#1
|
LQ Newbie
Registered: Apr 2014
Posts: 5
Rep: 
|
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 09:35 AM.
|
|
|
04-02-2014, 03:44 PM
|
#2
|
Moderator
Registered: Mar 2008
Posts: 22,264
|
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.
|
|
|
04-02-2014, 03:50 PM
|
#3
|
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,269
|
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.
|
04-03-2014, 04:50 PM
|
#4
|
LQ Newbie
Registered: Apr 2014
Posts: 5
Original Poster
Rep: 
|
@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 04:51 PM.
|
|
|
04-04-2014, 01:10 AM
|
#5
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,328
|
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.
|
|
|
04-04-2014, 04:35 PM
|
#6
|
Moderator
Registered: Mar 2008
Posts: 22,264
|
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.
|
|
|
All times are GMT -5. The time now is 02:35 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|