Skip to contentSkip to conversation

RAID 0 -> 1 possible?

DISCUSSION Jeff Hoffmann 4 participants 6 messages Mar 11, 2004 – Mar 12, 2004 MD RAID

lore
Share & tools
lore
#0 lore raw

Hello list,

Is it possible to convert from RAID 0 to 1 without data loss?

Given a system with two disks, three partitions on each: boot, /, and swap.

Convert / from RAID 0 to 1 without requiring a backup/reinstall/restore scenario

Any RAID-mojo-masters with the answer?

TIA,

Jeff Hoffmann

#1 lore raw
Quoted 3 lines · Jeff Hoffmann

Hello list,

Is it possible to convert from RAID 0 to 1 without data loss?

No, obviously. Raid 1 is mirrored, so your useable space is only half of your total capacity at best. Raid 0 uses the full capacity of the disks, so until you can solve how to put twice as many data onto the same space, one cannot convert from raid0 -> raid1 without 'losing data'...

Quoted 4 lines

Given a system with two disks, three partitions on each: boot, /, and swap.

Convert / from RAID 0 to 1 without requiring a backup/reinstall/restore scenario

Even without the <total data size> problems as outlined above, you cannot touch either disks of a raid 0 set without destroying data, that is the whole point of raid 0. So, even an online-migration tool sounds implaudible.

Quoted 1 line

Any RAID-mojo-masters with the answer?

I'm not a RAID-mojo-master, but then again I don't believe one needs to be one to answer this. It stems directly from the theory of operation of the levels.

Maarten

#2 lore raw
In reply to Jeff Hoffmann

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeff Hoffmann wrote:

| Hello list,
|
| Is it possible to convert from RAID 0 to 1 without data loss?
|
| Given a system with two disks, three partitions on each: boot, /, and
swap.
|
| Convert / from RAID 0 to 1 without requiring a backup/reinstall/restore
| scenario
|
| Any RAID-mojo-masters with the answer?

I think that can't work unless you add two more disks. Raid 0 is strip where 1 is mirroring.

- --
Clemens Schwaighofer - IT Engineer & System Administration
==========================================================
Tequila Japan, 6-17-2 Ginza Chuo-ku, Tokyo 104-8167, JAPAN
Tel: +81-(0)3-3545-7703 Fax: +81-(0)3-3545-7343
http://www.tequila.jp
==========================================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAUVA9jBz/yQjBxz8RAiSnAJ9qeBSBhpWLjlfUqZoGarM6smgw8gCgxnf+ +6ScO+vbTIu9u5XKNpqDrHw=
=Jvfs
-----END PGP SIGNATURE-----

#3 lore raw
Quoted 7 lines · Clemens Schwaighofer
| Convert / from RAID 0 to 1 without requiring a backup/reinstall/restore
| scenario
|
| Any RAID-mojo-masters with the answer?

I think that can't work unless you add two more disks. Raid 0 is strip where 1 is mirroring.

Indeed. In my case, the data actually on the partition is < 25%. Perhaps there's a way to shrink the RAID 0 set? That would allow a new partition (not striped) to be created to store the data.

Thanks for your input,

Jeff Hoffmann

#4 lore raw
Quoted 4 lines · Jeff Hoffmann
Quoted 2 lines

| Convert / from RAID 0 to 1 without requiring a backup/reinstall/restore | scenario

Indeed. In my case, the data actually on the partition is < 25%.

Well, in that case you just might be able to do it. You'll need to shrink your filesystem (if you have one) ala resize2fs or similar. Then raidreconf the raid0. Then edit the partition table (there are tools to help with this, or just use fdisk very carefully) to shrink the partition. Then you can create a new partition and dump the data there. Create another similarly sized partition and raid1 them together...

It's certainly possible...but it's starting to sound like a backup/restore might be easier than all that (you probably want to backup before doing these types of things anyway, if you care about the data).

--
Paul

#5 lore raw
Quoted 6 lines · Paul Clements

Well, in that case you just might be able to do it. You'll need to shrink your filesystem (if you have one) ala resize2fs or similar. Then raidreconf the raid0. Then edit the partition table (there are tools to help with this, or just use fdisk very carefully) to shrink the partition. Then you can create a new partition and dump the data there. Create another similarly sized partition and raid1 them together...

That seems like it would work, but I thought raidreconf was used for adding disks to arrays, not making them smaller. How do you use raidreconf in this manner?

Thanks for your help,

Jeff Hoffmann