Hello all, I have 2 x 250GB sata disks (sda and sdb). # fdisk -l /dev/sda Disk /dev/sda: 250.0 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 14939 119997486 fd Linux raid autodetect /dev/sda2 14940 29878 119997517+ fd Linux raid autodetect /dev/sda3 29879 30400 4192965 fd Linux raid autodetect # fdisk -l /dev/sdb Disk /dev/sdb: 250.0 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 * 1 522 4192933+ fd Linux raid autodetect # cat /proc/mdstat Personalities : [raid1] md2 : active raid1 sdb1[1] sda3[0] 4192832 blocks [2/2] [UU] md1 : active raid1 sda2[1] sda1[0] 119997376 blocks [2/2] [UU] What I want to do: - have on each disk 2 partitions (4gb for swap and the 200gb+ the rest for /) - raid 1 between them This is what I wanted in the beginning, but...I didn't paid attention... What can I do to rebuild it to my needs (without loosing data or reformatting)? Thanks
Iulian Badea wrote:> Hello all, > > I have 2 x 250GB sata disks (sda and sdb). > > # fdisk -l /dev/sda > > Disk /dev/sda: 250.0 GB, 250059350016 bytes > 255 heads, 63 sectors/track, 30401 cylinders > Units = cylinders of 16065 * 512 = 8225280 bytes > > Device Boot Start End Blocks Id System > /dev/sda1 * 1 14939 119997486 fd Linux raid > autodetect > /dev/sda2 14940 29878 119997517+ fd Linux raid > autodetect > /dev/sda3 29879 30400 4192965 fd Linux raid > autodetect > > # fdisk -l /dev/sdb > > Disk /dev/sdb: 250.0 GB, 250059350016 bytes > 255 heads, 63 sectors/track, 30401 cylinders > Units = cylinders of 16065 * 512 = 8225280 bytes > > Device Boot Start End Blocks Id System > /dev/sdb1 * 1 522 4192933+ fd Linux raid > autodetect > > # cat /proc/mdstat > Personalities : [raid1] > md2 : active raid1 sdb1[1] sda3[0] > 4192832 blocks [2/2] [UU] > > md1 : active raid1 sda2[1] sda1[0] > 119997376 blocks [2/2] [UU] > > What I want to do: > - have on each disk 2 partitions (4gb for swap and the 200gb+ the rest for > /) > - raid 1 between them > > This is what I wanted in the beginning, but...I didn't paid attention... > > What can I do to rebuild it to my needs (without loosing data or > reformatting)? >ouch. I'd boot a rescue CD, drop the mirrors, repartition and mkfs on sdb1, dump both file systems to it, drop both metadisks, repartition sda1 as 2 x raid1 w/o any active mirrors, mkfs on them, restore the dumps to these new md0, md1, then repartition sdb again as the two mirrors and join them to md0, md1 but thats just me. others might do it differently.
Iulian Badea wrote:> Hello all, > > I have 2 x 250GB sata disks (sda and sdb). > > # fdisk -l /dev/sda > > Disk /dev/sda: 250.0 GB, 250059350016 bytes > 255 heads, 63 sectors/track, 30401 cylinders > Units = cylinders of 16065 * 512 = 8225280 bytes > > Device Boot Start End Blocks Id System > /dev/sda1 * 1 14939 119997486 fd Linux raid > autodetect > /dev/sda2 14940 29878 119997517+ fd Linux raid > autodetect > /dev/sda3 29879 30400 4192965 fd Linux raid > autodetect > > # fdisk -l /dev/sdb > > Disk /dev/sdb: 250.0 GB, 250059350016 bytes > 255 heads, 63 sectors/track, 30401 cylinders > Units = cylinders of 16065 * 512 = 8225280 bytes > > Device Boot Start End Blocks Id System > /dev/sdb1 * 1 522 4192933+ fd Linux raid > autodetect > > # cat /proc/mdstat > Personalities : [raid1] > md2 : active raid1 sdb1[1] sda3[0] > 4192832 blocks [2/2] [UU] > > md1 : active raid1 sda2[1] sda1[0] > 119997376 blocks [2/2] [UU] > > What I want to do: > - have on each disk 2 partitions (4gb for swap and the 200gb+ the rest for > /) > - raid 1 between them > > This is what I wanted in the beginning, but...I didn't paid attention... > > What can I do to rebuild it to my needs (without loosing data or > reformatting)? > > Thanks > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centosI don't know if you are going to keep lvm or not but here is a howto: http://www.howtoforge.com/set-up-raid1-on-a-running-lvm-system-fedora8 Also just search for "raid1" on that website and you can find more stuff. Sam
on 10-5-2008 2:58 PM Iulian Badea spake the following:> Hello all, > > I have 2 x 250GB sata disks (sda and sdb). > > # fdisk -l /dev/sda > > Disk /dev/sda: 250.0 GB, 250059350016 bytes > 255 heads, 63 sectors/track, 30401 cylinders > Units = cylinders of 16065 * 512 = 8225280 bytes > > Device Boot Start End Blocks Id System > /dev/sda1 * 1 14939 119997486 fd Linux raid > autodetect > /dev/sda2 14940 29878 119997517+ fd Linux raid > autodetect > /dev/sda3 29879 30400 4192965 fd Linux raid > autodetect > > # fdisk -l /dev/sdb > > Disk /dev/sdb: 250.0 GB, 250059350016 bytes > 255 heads, 63 sectors/track, 30401 cylinders > Units = cylinders of 16065 * 512 = 8225280 bytes > > Device Boot Start End Blocks Id System > /dev/sdb1 * 1 522 4192933+ fd Linux raid > autodetect > > # cat /proc/mdstat > Personalities : [raid1] > md2 : active raid1 sdb1[1] sda3[0] > 4192832 blocks [2/2] [UU] > > md1 : active raid1 sda2[1] sda1[0] > 119997376 blocks [2/2] [UU] > > What I want to do: > - have on each disk 2 partitions (4gb for swap and the 200gb+ the rest for > /) > - raid 1 between them > > This is what I wanted in the beginning, but...I didn't paid attention... > > What can I do to rebuild it to my needs (without loosing data or > reformatting)? > > ThanksIt looks like you can fail sdb1 from md2 and start fresh with it. You can build 2 new arrays on the single drive using the -missing parameter. That will let you create the raid1 with only one partition. You can then copy all the data from md1 and md2 to what will become md3 and md4. Then you can wipe sda and copy the partition table from sdb to sda and add the partitions to md3 and md4. If the out of sequence numbering of md3 and md4 bothers you, you can renumber them from a rescue CD. -- MailScanner is like deodorant... You hope everybody uses it, and you notice quickly if they don't!!!! -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 250 bytes Desc: OpenPGP digital signature URL: <http://lists.centos.org/pipermail/centos/attachments/20081007/aa1813d6/attachment-0003.sig>