* migrate single disk to RAID 1?
@ 2009-07-14 7:16 Ben Beuchler
2009-07-14 10:06 ` John Robinson
0 siblings, 1 reply; 6+ messages in thread
From: Ben Beuchler @ 2009-07-14 7:16 UTC (permalink / raw)
To: linux-raid
I'd like to convert an existing partition to RAID 1 using a portion of
a new, blank drive. All of the examples I've seen involve creating
the RAID device with the *empty* partition (sda4), copying the data
from the old partition to the new RAID, then adding the old partition
to the RAID set.
From my modest understanding of how linux software RAID works, it
seems I should be able to take an existing partition containing data
(in this case sdb4 mounted as /mail) and build a RAID 1 array with
something similar to this:
umount /dev/sdb4
mdadm --build /dev/md0 --level=1 -n2 /dev/sdb4 missing
mount /dev/md0 /mail
mdadm --add /dev/md0 /dev/sda4
Will that work? Or am I misunderstanding something fundamental?
Thanks!
-Ben
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: migrate single disk to RAID 1?
2009-07-14 7:16 migrate single disk to RAID 1? Ben Beuchler
@ 2009-07-14 10:06 ` John Robinson
2009-07-14 11:13 ` berk walker
2009-07-14 15:44 ` Ben Beuchler
0 siblings, 2 replies; 6+ messages in thread
From: John Robinson @ 2009-07-14 10:06 UTC (permalink / raw)
To: Ben Beuchler; +Cc: linux-raid
On 14/07/2009 08:16, Ben Beuchler wrote:
> I'd like to convert an existing partition to RAID 1 using a portion of
> a new, blank drive. All of the examples I've seen involve creating
> the RAID device with the *empty* partition (sda4), copying the data
> from the old partition to the new RAID, then adding the old partition
> to the RAID set.
>
>>From my modest understanding of how linux software RAID works, it
> seems I should be able to take an existing partition containing data
> (in this case sdb4 mounted as /mail) and build a RAID 1 array with
> something similar to this:
>
> umount /dev/sdb4
> mdadm --build /dev/md0 --level=1 -n2 /dev/sdb4 missing
> mount /dev/md0 /mail
> mdadm --add /dev/md0 /dev/sda4
>
> Will that work? Or am I misunderstanding something fundamental?
It'll work but you'll be using a legacy array without superblocks, so
you can't have various features that come with superblocks like being
recognisable or having a write-intent bitmap, which is why most guides
suggest you --create an array with a blank partition then copy the data.
The man page says of build mode:
Build an array that doesn’t have per-device superblocks.
For these sorts of arrays, mdadm cannot differentiate
between initial creation and subsequent assembly of an
array. It also cannot perform any checks that appropriate
components have been requested. Because of this, the Build
mode should only be used together with a complete under-
standing of what you are doing.
Cheers,
John.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: migrate single disk to RAID 1?
2009-07-14 10:06 ` John Robinson
@ 2009-07-14 11:13 ` berk walker
2009-07-14 15:44 ` Ben Beuchler
1 sibling, 0 replies; 6+ messages in thread
From: berk walker @ 2009-07-14 11:13 UTC (permalink / raw)
To: John Robinson; +Cc: Ben Beuchler, linux-raid
John Robinson wrote:
> On 14/07/2009 08:16, Ben Beuchler wrote:
>> I'd like to convert an existing partition to RAID 1 using a portion of
>> a new, blank drive. All of the examples I've seen involve creating
>> the RAID device with the *empty* partition (sda4), copying the data
>> from the old partition to the new RAID, then adding the old partition
>> to the RAID set.
>>
>>> From my modest understanding of how linux software RAID works, it
>> seems I should be able to take an existing partition containing data
>> (in this case sdb4 mounted as /mail) and build a RAID 1 array with
>> something similar to this:
>>
>> umount /dev/sdb4
>> mdadm --build /dev/md0 --level=1 -n2 /dev/sdb4 missing
>> mount /dev/md0 /mail
>> mdadm --add /dev/md0 /dev/sda4
>>
>> Will that work? Or am I misunderstanding something fundamental?
>
> It'll work but you'll be using a legacy array without superblocks, so
> you can't have various features that come with superblocks like being
> recognisable or having a write-intent bitmap, which is why most guides
> suggest you --create an array with a blank partition then copy the
> data. The man page says of build mode:
> Build an array that doesn’t have per-device superblocks.
> For these sorts of arrays, mdadm cannot differentiate
> between initial creation and subsequent assembly of an
> array. It also cannot perform any checks that appropriate
> components have been requested. Because of this, the Build
> mode should only be used together with a complete under-
> standing of what you are doing.
>
> Cheers,
>
> John.
> .
I think that after a --create, missing on the new drive, you would want
to copy the contents of the original drive ,. Then add the original to
the raid..
berk
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: migrate single disk to RAID 1?
2009-07-14 10:06 ` John Robinson
2009-07-14 11:13 ` berk walker
@ 2009-07-14 15:44 ` Ben Beuchler
2009-07-14 16:00 ` Robin Hill
2009-07-14 16:15 ` Michal Soltys
1 sibling, 2 replies; 6+ messages in thread
From: Ben Beuchler @ 2009-07-14 15:44 UTC (permalink / raw)
To: linux-raid
>> umount /dev/sdb4
>> mdadm --build /dev/md0 --level=1 -n2 /dev/sdb4 missing
>> mount /dev/md0 /mail
>> mdadm --add /dev/md0 /dev/sda4
>>
>> Will that work? Or am I misunderstanding something fundamental?
>
> It'll work but you'll be using a legacy array without superblocks, so you
> can't have various features that come with superblocks
Right; for this particular application I'm willing to give up
superblocks. Just to be 100% sure, thought: the way I've described
the process would be non-destructive of the data on sdb4?
Thanks!
-Ben
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: migrate single disk to RAID 1?
2009-07-14 15:44 ` Ben Beuchler
@ 2009-07-14 16:00 ` Robin Hill
2009-07-14 16:15 ` Michal Soltys
1 sibling, 0 replies; 6+ messages in thread
From: Robin Hill @ 2009-07-14 16:00 UTC (permalink / raw)
To: linux-raid
[-- Attachment #1: Type: text/plain, Size: 1140 bytes --]
On Tue Jul 14, 2009 at 10:44:15AM -0500, Ben Beuchler wrote:
> >> umount /dev/sdb4
> >> mdadm --build /dev/md0 --level=1 -n2 /dev/sdb4 missing
> >> mount /dev/md0 /mail
> >> mdadm --add /dev/md0 /dev/sda4
> >>
> >> Will that work? Or am I misunderstanding something fundamental?
> >
> > It'll work but you'll be using a legacy array without superblocks, so you
> > can't have various features that come with superblocks
>
> Right; for this particular application I'm willing to give up
> superblocks. Just to be 100% sure, thought: the way I've described
> the process would be non-destructive of the data on sdb4?
>
Yes - there'll be no need to write to sdb4 at all. Be aware that,
without a superblock, the array will need to do a full resync every
single time you start it (unless you use the --assume-clean switch, in
which case you could be risking corruption).
Cheers,
Robin
--
___
( ' } | Robin Hill <robin@robinhill.me.uk> |
/ / ) | Little Jim says .... |
// !! | "He fallen in de water !!" |
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: migrate single disk to RAID 1?
2009-07-14 15:44 ` Ben Beuchler
2009-07-14 16:00 ` Robin Hill
@ 2009-07-14 16:15 ` Michal Soltys
1 sibling, 0 replies; 6+ messages in thread
From: Michal Soltys @ 2009-07-14 16:15 UTC (permalink / raw)
To: Ben Beuchler; +Cc: linux-raid
Ben Beuchler wrote:
>>> umount /dev/sdb4
>>> mdadm --build /dev/md0 --level=1 -n2 /dev/sdb4 missing
>>> mount /dev/md0 /mail
>>> mdadm --add /dev/md0 /dev/sda4
>>>
>>> Will that work? Or am I misunderstanding something fundamental?
>>
>> It'll work but you'll be using a legacy array without superblocks, so you
>> can't have various features that come with superblocks
>
> Right; for this particular application I'm willing to give up
> superblocks. Just to be 100% sure, thought: the way I've described
> the process would be non-destructive of the data on sdb4?
>
> Thanks!
Actually, if on that sdb4 is a shrinkable filesystem, you can create md
raid with superblock at the end. So the process would be something like:
- resize2fs filesystem on sdb4 a bit (shrink)
- mdadm stuff with e.g. 1.0 superblock
- resize2fs filesystem again, this time on md0
According to md(4) you shouldn't need to shrink more than 128KB, but be
sure to get a healthy margin. Or do simple test with some tiny
partition, or md-on-lvm.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-07-14 16:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-14 7:16 migrate single disk to RAID 1? Ben Beuchler
2009-07-14 10:06 ` John Robinson
2009-07-14 11:13 ` berk walker
2009-07-14 15:44 ` Ben Beuchler
2009-07-14 16:00 ` Robin Hill
2009-07-14 16:15 ` Michal Soltys
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).