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?
| |
|
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) 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
| |
|
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?
| |
|
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?
| |
|
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) 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.
| |
|
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
| |
|