Forum
« RAID1 in Salineos using mdadm »

Welcome Guest. Please Login or Register.
May 20, 2013, 9:03am



Return to or visit the SalineOS webpage

Forum :: General :: Installation and Setup Support :: RAID1 in Salineos using mdadm
   [Search This Thread] [Share Topic] [Print]
 AuthorTopic: RAID1 in Salineos using mdadm (Read 375 times)
klaus
New Member
*
member is offline





Joined: Nov 2011
Gender: Male
Posts: 17
 RAID1 in Salineos using mdadm
« Thread Started on Dec 18, 2011, 2:29pm »

Hi at all

I've an existing RAID1 (consisting of two 1TB harddrives) formerly used in a windows system. The file system type used is therefore NTFS. Mounting both harddrives readonly works well. The contents of both shall be physically identical.

Now I want to use mdadm to simply use this RAID1. However I only can find howtos that describe how to create a new RAID1 not on reusing an existing RAID1 :-/

Any ideas or does someone know a good howto?
Link to Post - Back to Top  IP: Logged
Anthony Nordquist
Administrator
*****
member is offline




[homepage]

Joined: Dec 2010
Gender: Male
Posts: 1,336
 Re: RAID1 in Salineos using mdadm
« Reply #1 on Dec 19, 2011, 12:29am »

It would seem the man page has what you need? I have never done this myself, but it would seem the assemble option is the one you want. You can read the manpage from your terminal by typing man mdadm or you could read it here: http://linux.die.net/man/8/mdadm
Link to Post - Back to Top  IP: Logged
klaus
New Member
*
member is offline





Joined: Nov 2011
Gender: Male
Posts: 17
 Re: RAID1 in Salineos using mdadm
« Reply #2 on Dec 19, 2011, 2:44pm »

I fear that my knowledge on how mdadm works behind the scenes is not good enough to safely do this. I mistrust mdadm in not writing to the disk and damaging things.

Is there maybe a possibility to create a kind of "readonly device alias" of my two hard disks for testing purpose that can be used with mdadm?
Link to Post - Back to Top  IP: Logged
klaus
New Member
*
member is offline





Joined: Nov 2011
Gender: Male
Posts: 17
 Re: RAID1 in Salineos using mdadm
« Reply #3 on Dec 28, 2011, 12:19pm »

Can this be successful:


1. Create a raid 1 first with one drive only:

mdadm --create /dev/md0 --level=raid1 --raid-devices=1 /dev/sda1

2. Begin to use /dev/md0, create partition table, copy everything from /dev/sdb1 to /dev/md0

3. Add /dev/sdb1 to the raid array

mdadm /dev/md0 --add /dev/sdb1

I assume that /dev/sdb1 is then synchronized (the contents of /dev/md0 is cloned to /dev/sdb1).
However I'm not sure, for example the man page says something about "hot spares" which are synchronized then, but what are "hot spares" in this case?
Link to Post - Back to Top  IP: Logged
Anthony Nordquist
Administrator
*****
member is offline




[homepage]

Joined: Dec 2010
Gender: Male
Posts: 1,336
 Re: RAID1 in Salineos using mdadm
« Reply #4 on Dec 28, 2011, 6:58pm »

As I understand the man page yes, but I could be wrong too. I am pretty lost when it comes to RAID arrays as I don't use them. My best suggestion is to backup all important data before you attempt anything, just in case.

You may also consider asking this question over at the Debian forum, there are more people there to see it. Just don't mention you are on SalineOS. All the packages related to creating and using a RAID array are taken directly from the Debian Stable repositories.
Link to Post - Back to Top  IP: Logged
klaus
New Member
*
member is offline





Joined: Nov 2011
Gender: Male
Posts: 17
 Re: RAID1 in Salineos using mdadm
« Reply #5 on Jan 2, 2012, 3:10pm »

RAID is working :-)


From my memory one must do:

1. Create partition table and file system on /dev/sda1. Mark it as RAID

2. mdadm --create /dev/md0 --level=raid1 /dev/sda1 missing

3. Copy files to /dev/md0

4. Clear second hard disk and create parition table with file system. Mark as RAID

5. Add second hard disk via

mdadm --manage /dev/md0 --add /dev/sdb1

5. Wait until synchronization is finished
Link to Post - Back to Top  IP: Logged
   [Search This Thread] [Share Topic] [Print]



Anthony Nordquist, on behalf of the SalineOS project, is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. As such, if you click the above banner and then make any purchase including digital downloads, a small percentage will be paid to the SalineOS project.
Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Notice | FTC Disclosure | Report Abuse | Mobile