Migrating from SINGLE DISK to RAID1
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
Quoted 6 lines · Robert Heinzmann
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
Quoted 4 lines
- Using a former disk of a raid1 array as a usual disk (not mounted as degrated
/dev/mdX, but instead mounted as/dev/sdXor/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
Hello Mike,
Quoted 7 lines · Mike Hardy
Quoted 4 lines · Robert Heinzmann
Hello,
can someone verify if the following statements are true ?
Quoted 7 lines
Quoted 2 lines
- 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
Quoted 7 lines · Mike Hardy
Quoted 6 lines · Robert Heinzmann
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 .. :-)
Quoted 4 lines
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 )
Quoted 4 lines
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
Hi Robert,
Quoted 4 lines · Robert Heinzmann
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
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-
Quoted 25 lines · Robert Heinzmann
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/sdXor/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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/