LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-29-2009, 06:57 PM   #1
Dlinny
LQ Newbie
 
Registered: Jan 2009
Distribution: CentOS 5.2
Posts: 5

Rep: Reputation: 0
Question How access disk from raid 1 (mirror) array


I need to create raid 1 (mirror) array (or some similar) to make next:
i have 2 disks sda and sdb.
they in md0 (raid1)
md0 mounted as /home/all
and I need to mount only sda as /home/me - read only.

or

i need some solution to have mirrored disk and ability to write in 1 place (/home/all) for both disks, and read from other places (/home/me(sda) and /home/they(sdb))
 
Old 01-30-2009, 12:00 PM   #2
kentyler
Member
 
Registered: Dec 2008
Location: Newark Ohio
Distribution: Fedora Core
Posts: 270

Rep: Reputation: 38
It is not possible to do what you are trying to do with raid.
 
Old 01-30-2009, 04:24 PM   #3
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Well, you could unmount /dev/md0, mark /dev/sdb as faulty, remove it from the array, remount /dev/md0 using "mdadm /dev/md0 missing /dev/sda" then mount it as /home/me using read-only options (-o ro). See man mdadm and man mount. I agree with the above about the other problem. But why do you want to do that?

Last edited by mostlyharmless; 01-30-2009 at 04:35 PM.
 
Old 01-31-2009, 02:51 PM   #4
amoralejo
LQ Newbie
 
Registered: Jan 2009
Posts: 9

Rep: Reputation: 1
If you want to be able to mount the same filesystem in different mount points, one rw and one ro, you can take a look to bind mounts:

http://kerneltrap.org/Linux/Read-only_Bind_Mounts
 
Old 02-01-2009, 07:14 AM   #5
Dlinny
LQ Newbie
 
Registered: Jan 2009
Distribution: CentOS 5.2
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by mostlyharmless View Post
Well, you could unmount /dev/md0, mark /dev/sdb as faulty, remove it from the array, remount /dev/md0 using "mdadm /dev/md0 missing /dev/sda" then mount it as /home/me using read-only options (-o ro). See man mdadm and man mount. I agree with the above about the other problem. But why do you want to do that?
But can i add then sda to md0 again when it will be mounted as /home/me ?

I need to have 1 place for all users to write to - md0
and 2 different places for different users to read this data from. For speed priorities. I have 2 groups of users in 1 - 50 users and in 2 - 1500 users. And i need to provide for all of them access for one data, but group #1 must have as much fast read access as it possible.
 
Old 02-01-2009, 08:36 AM   #6
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
The answer is to have smaller partitions for the Raid, So say we are talking a 1TB Disc, you'd create 600GB Partitions on both for the raid, then on each one you leave 400GB, then sda can have a 400GB /home/me and sdb can have a 400GB /home/they. Generally as it goes, software raid 0 will not gain much of a performance boost if you see one at all (all more likely to see a slight reduction in performance), what you gain is redundancy and would mean that /home/me and /home/they would lack the redunancy offered by md0 what is used by all.

The values I gave above are just rough, since you still need all the space for sorting out / and swap to of course.
 
Old 02-02-2009, 05:35 AM   #7
Dlinny
LQ Newbie
 
Registered: Jan 2009
Distribution: CentOS 5.2
Posts: 5

Original Poster
Rep: Reputation: 0
For swap and / i have another hdd.
And don't need 2 different places for /home/me and /home/they.
/home/me and /home/they must point to the SAME (mirrored) data but this data must be readed from different part of mirror (sda or sdb).
Let's try again, i need something like this:

i have 2 hdd's (sda and sdb).
they must contain SAME data. simply i put them into raid1 = md0.

now i mount:
/dev/md0 => /home/write (read-write)
and
/dev/sda => /home/me (readonly)
/dev/sdb => /home/they (readonly)

now when i write file test.txt to /home/write - it will be written by md to sda and sdb. and i can access test.txt from /home/me - data will be readed from sda, and from /home/they - data will be readed from sdb.
but data will be same. if i change something in /home/write/test.txt - this changes will be done for both hdd.

this I need.
i belive that it's possible. maybe by patching md. or some else.

For temp solution i use inotify + rsync (lsyncd) without any raid. but it's not the thing i need.
 
Old 02-02-2009, 06:09 AM   #8
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
What you are trying to do is simply not a good idea because you are trying to use something that is already busy and managed by mdadm. This just wouldn't be a good idea anyway (it'd lead to even more performance drop overall). I would use a form of application that quotas usage of the hard drives or something, that or quota partitions and have different raid partitions completely for the two.

To be honest, because it's raided, I am not sure this is even possible anyways...
 
Old 02-02-2009, 06:40 AM   #9
Dlinny
LQ Newbie
 
Registered: Jan 2009
Distribution: CentOS 5.2
Posts: 5

Original Poster
Rep: Reputation: 0
But qutas can't provide stable bandwidth for user.
I mean when i have 1500 users with bandlimit 10Kb/s and 50 users with no limits qotas can't provide for this 50 users 500Kb/s speed, because 1500 users can acces 1000 different files and it's load hdd, even without data transfer, or with very slow data transfer, only by seek for file work.
But when i will have mirrored on 2 hdd's data i can provide high speed for 50 users by giving them data from 1 hdd, and only hardware possible speed for 1500 from another hdd.
I already try raid0, and raid1+0 and it's doesn't provide enought speed.
 
Old 02-02-2009, 08:28 AM   #10
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
Well Raid0 would be impossible to do this with anyways. As simply the data is split in a fashion which makes mounting of a single drive literally impossible. Raid1 I am not sure if it's possible or not, I do not believe Mdadm uses stripes but it may use or reserve parts of the filesystem running under it which would block off normal mounting, needless to say using two different methods to talk to the same device at the same time generally isn't going to be a great idea and may infact cause a negative attraction.

However what I hinted before would be to have /home/me mounted as md0 and /home/they mounted as md1, and then doing an overall usage quota on say /home/they (assuming that is the one with the 1500 users) which should leave /home/me unquotad and still operational should /home/they hit it's quota...
 
Old 02-02-2009, 09:34 AM   #11
Dlinny
LQ Newbie
 
Registered: Jan 2009
Distribution: CentOS 5.2
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by r3sistance View Post
Well Raid0 would be impossible to do this with anyways.
I try raid0 and raid1+0 to try speed improvements they provide. Not for thing i need.
And they doesn't provide enougth speed for my purposes.
 
Old 02-02-2009, 10:34 AM   #12
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
If you NEED more speed from the hard drives, have you considered hardware raid? sure it will cost a bit, and you won't be able to talk to the indivual hard drives (also has the extra point of failure and those cards use their own stripe standards that motherboards don't understand)... but they have a much better performance rating and gives a bit better reduncancy and recovery for a single hard drive failure.
 
Old 02-02-2009, 10:48 AM   #13
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Quote:
this I need.
i belive that it's possible. maybe by patching md. or some else.
I doubt you'll get anyone interested in that project, so you might have to go at it yourself. It is open source software after all. But who knows? Maybe there are other people who would like that particular functionality (if we're to call it that) to mdadm.
 
Old 02-02-2009, 11:29 AM   #14
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
Please don't even advise that... I am getting bad bad thoughts about something I once saw called Spectate Swamp Desktop Search... I'd rather not have images that make me think of that... if you were to have something that could split out the hard drive usage it would have to exist within mdadm, using two device managers speaking to the same device is less then sensible... and any kind of work to do that would be complex to say the least and goes against the entire point of raid... so your looking at something that operates raid like features but gives additation extras that aren't exactly... sane in the first place... =/.
 
  


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
Disk Error in Raid array file system inode tables. jpbland51 Linux - Newbie 6 05-21-2008 06:27 AM
How to create an initial raid 5 array with 2 disk? metabaron Linux - General 2 12-09-2006 05:54 PM
Moving a Slack install from an ATA disk to a RAID array shubb Slackware 2 08-06-2006 11:54 AM
Fedora trying to access RAID array NadJ Fedora 1 04-19-2005 04:38 PM
Kernel 2.4.23 compile causes kernel panics on ATA RAID-1 (mirror) array Raptor Ramjet Slackware 3 12-18-2003 01:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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