linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Migrating from SINGLE DISK to RAID1
@ 2005-02-01 19:01 Robert Heinzmann
  2005-02-01 19:34 ` Mike Hardy
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Robert Heinzmann @ 2005-02-01 19:01 UTC (permalink / raw)
  To: linux-raid

Hello,

can someone verify if the following statements are true ?

- It's not possible to simply  convert a existing partition with a 
filesystem on it to a raid1 mirror set.

This may seem succesfull (filesystem can be mounted and must not be 
checked), but it will cause data integrity problems. One of the last 
Blocks of the device formaly used for file data will be used for the 
raid superblock and so all data on this block will be not accessible 
anymore.

- Using a former disk of a raid1 array as a usual disk (not mounted as 
degrated /dev/mdX, but instead mounted as /dev/sdX or /dev/hdX) is 
successfull.

This is because the MD device layer reports the device size as size of 
disk - superblock offset during the creation of a filesystem on the MD 
device. Thus the used size of the disk, when mounting it as /dev/sdX 
/dev/hdX, is some KB smaller than it could be, but no data is lost.

- Its always possible to use raid1 disks as regular disks (not taking 
the md autodiscovery into concern). Using regular disks as raid disks 
always requires data migration (new filesystem and copy).

Thank you very much. I would really appreshiate some somments on this one.

Robert Heinzmann

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Migrating from SINGLE DISK to RAID1
  2005-02-01 19:01 Migrating from SINGLE DISK to RAID1 Robert Heinzmann
@ 2005-02-01 19:34 ` Mike Hardy
  2005-02-01 21:40   ` Robert Heinzmann
  2005-02-01 23:52   ` Alvin Oga
  2005-02-01 19:41 ` Paul Clements
  2005-02-01 22:57 ` berk walker
  2 siblings, 2 replies; 6+ messages in thread
From: Mike Hardy @ 2005-02-01 19:34 UTC (permalink / raw)
  To: Robert Heinzmann; +Cc: linux-raid


Robert Heinzmann wrote:
> Hello,
> 
> can someone verify if the following statements are true ?
> 
> - It's not possible to simply  convert a existing partition with a 
> filesystem on it to a raid1 mirror set.

I believe you're right, but I'm not totally sure on this one. I'd take 
the second disk, create a new RAID1 with the first drive "missing" on 
the mdadm --create commandline, copy everything over to it, put grub on 
it, then test that it boots correctly by pulling the first drive out.

Only once the RAID1 is working (in degraded mode) add the original first 
drive back in, but booting off the RAID1, then add it to the RAID set to 
complete the pair. With that process, the question is somewhat moot, 
although I'm interested in the real answer too

> - Using a former disk of a raid1 array as a usual disk (not mounted as 
> degrated /dev/mdX, but instead mounted as /dev/sdX or /dev/hdX) is 
> successfull.
> 
> This is because the MD device layer reports the device size as size of 
> disk - superblock offset during the creation of a filesystem on the MD 
> device. Thus the used size of the disk, when mounting it as /dev/sdX 
> /dev/hdX, is some KB smaller than it could be, but no data is lost.

This matches my experience, although autodiscovery can get in your way, 
as you mention yourself

-Mike

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Migrating from SINGLE DISK to RAID1
  2005-02-01 19:01 Migrating from SINGLE DISK to RAID1 Robert Heinzmann
  2005-02-01 19:34 ` Mike Hardy
@ 2005-02-01 19:41 ` Paul Clements
  2005-02-01 22:57 ` berk walker
  2 siblings, 0 replies; 6+ messages in thread
From: Paul Clements @ 2005-02-01 19:41 UTC (permalink / raw)
  To: Robert Heinzmann; +Cc: linux-raid

Hi Robert,

Robert Heinzmann wrote:

> can someone verify if the following statements are true ?
> 
> - It's not possible to simply  convert a existing partition with a 
> filesystem on it to a raid1 mirror set.

If you create a raid1 without a superblock it is possible (although not 
a very common configuration). If you do use a superblock, you'll need to 
shrink your filesystem by 128KB (to be safe) prior to creating the mirror.

--
Paul

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Migrating from SINGLE DISK to RAID1
  2005-02-01 19:34 ` Mike Hardy
@ 2005-02-01 21:40   ` Robert Heinzmann
  2005-02-01 23:52   ` Alvin Oga
  1 sibling, 0 replies; 6+ messages in thread
From: Robert Heinzmann @ 2005-02-01 21:40 UTC (permalink / raw)
  To: Mike Hardy; +Cc: linux-raid

Hello Mike,

Mike Hardy wrote:
> 
> Robert Heinzmann wrote:
> 
>> Hello,
>>
>> can someone verify if the following statements are true ?
>>
>> - It's not possible to simply  convert a existing partition with a 
>> filesystem on it to a raid1 mirror set.
> 
> 
> I believe you're right, but I'm not totally sure on this one. I'd take 
> the second disk, create a new RAID1 with the first drive "missing" on 
> the mdadm --create commandline, copy everything over to it, put grub on 
> it, then test that it boots correctly by pulling the first drive out.
> 
> Only once the RAID1 is working (in degraded mode) add the original first 
> drive back in, but booting off the RAID1, then add it to the RAID set to 
> complete the pair. With that process, the question is somewhat moot, 
> although I'm interested in the real answer too

Thats how I'm going to do it althought the version Paul Celemens is 
mentioning sound very elegant (resizing the fs 128 KB prior to creating 
the array).

Bye,
Robert


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Migrating from SINGLE DISK to RAID1
  2005-02-01 19:01 Migrating from SINGLE DISK to RAID1 Robert Heinzmann
  2005-02-01 19:34 ` Mike Hardy
  2005-02-01 19:41 ` Paul Clements
@ 2005-02-01 22:57 ` berk walker
  2 siblings, 0 replies; 6+ messages in thread
From: berk walker @ 2005-02-01 22:57 UTC (permalink / raw)
  To: Robert Heinzmann, linux-raid

I seem to remember that one can create a degraded array.  Then copy over,  
and shoot the old disk and add it to the aray.
b-

On Tue, 01 Feb 2005 20:01:12 +0100, Robert Heinzmann  
<Robert.Heinzmann@gmx.net> wrote:

> Hello,
>
> can someone verify if the following statements are true ?
>
> - It's not possible to simply  convert a existing partition with a  
> filesystem on it to a raid1 mirror set.
>
> This may seem succesfull (filesystem can be mounted and must not be  
> checked), but it will cause data integrity problems. One of the last  
> Blocks of the device formaly used for file data will be used for the  
> raid superblock and so all data on this block will be not accessible  
> anymore.
>
> - Using a former disk of a raid1 array as a usual disk (not mounted as  
> degrated /dev/mdX, but instead mounted as /dev/sdX or /dev/hdX) is  
> successfull.
>
> This is because the MD device layer reports the device size as size of  
> disk - superblock offset during the creation of a filesystem on the MD  
> device. Thus the used size of the disk, when mounting it as /dev/sdX  
> /dev/hdX, is some KB smaller than it could be, but no data is lost.
>
> - Its always possible to use raid1 disks as regular disks (not taking  
> the md autodiscovery into concern). Using regular disks as raid disks  
> always requires data migration (new filesystem and copy).
>
> Thank you very much. I would really appreshiate some somments on this  
> one.
>
> Robert Heinzmann
> -
> 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
>



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Migrating from SINGLE DISK to RAID1
  2005-02-01 19:34 ` Mike Hardy
  2005-02-01 21:40   ` Robert Heinzmann
@ 2005-02-01 23:52   ` Alvin Oga
  1 sibling, 0 replies; 6+ messages in thread
From: Alvin Oga @ 2005-02-01 23:52 UTC (permalink / raw)
  To: Mike Hardy; +Cc: linux-raid



On Tue, 1 Feb 2005, Mike Hardy wrote:
 
> Robert Heinzmann wrote:
> > Hello,
> > 
> > can someone verify if the following statements are true ?
> > 
> > - It's not possible to simply  convert a existing partition with a 
> > filesystem on it to a raid1 mirror set.

i say you cannot have it 100% working as raid1 because:

fdisk partitions on the orig drive and new disk is NOT "FD" type,
which means you cannot boot from the mirror if the current one dies
and you'd have to go to standalone rescue mode and it might boot

and more importantly ( in my view ), it was not mke2fs'd so its not
treated as one /dev/md0 device ... (ie. it will probably show as
misleading grub/lilo problems that it wont boot )

but if it works (boots) .. good .. :-)

> I believe you're right, but I'm not totally sure on this one. I'd take 
> the second disk, create a new RAID1 with the first drive "missing" on 
> the mdadm --create commandline, copy everything over to it, put grub on 
> it, then test that it boots correctly by pulling the first drive out.

a good test :-) my favorite non-techie 1 minute test for those that
say they have raid config'd, test'd and working .. ( usually it doesn't
boot in degraded, simulated failed disk mode )
  
> Only once the RAID1 is working (in degraded mode) add the original first 
> drive back in, but booting off the RAID1, then add it to the RAID set to 
> complete the pair. With that process, the question is somewhat moot, 
> although I'm interested in the real answer too

ditto

i think it matters, to what level people expect raid1 to be working,
	- just copying data or being able to boot off either disk
	with the other one unplugged  and that data resync itself
	onto the new disk

c ya
alvin


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-02-01 23:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-01 19:01 Migrating from SINGLE DISK to RAID1 Robert Heinzmann
2005-02-01 19:34 ` Mike Hardy
2005-02-01 21:40   ` Robert Heinzmann
2005-02-01 23:52   ` Alvin Oga
2005-02-01 19:41 ` Paul Clements
2005-02-01 22:57 ` berk walker

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).