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.
My solution, please tell me if I'm right:
-remove the entire sdb disk from raid -remove sda2 from raid -resize sda1 (the rest of disk) -copy partition table from sda to sdb -make raid between sda1/sdb1 and sda3 and sdb3
Is this possible?
On Sun, 05 Oct 2008 15:15:40 -0700, John R Pierce pierce@hogranch.com wrote:
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. _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Iulian Badea wrote:
My solution, please tell me if I'm right:
-remove the entire sdb disk from raid -remove sda2 from raid -resize sda1 (the rest of disk)
I dislike resizing partitions in place. I'd far rather backup the partitions with dump (8), then repartition, mkfs, and restore with restore (8)
-copy partition table from sda to sdb -make raid between sda1/sdb1 and sda3 and sdb3
Is this possible?
In theory.
I think you are saying not only do you want to keep the data but also keep the whole system setup. Not sure how to do that...however..
If I could back the whole drive up on a third I would just start over and then move my config files and data over after done.
Hope this tutorial helps, this is how I figured out how to do a raid 1. But does not cover your exact issue, but since you are new like me, maybe this will help you. http://www.bobhoffman.com/wordpress/?page_id=44
Good luck. Sometimes it is just quiker to start over.
Bob Hoffman wrote:
I think you are saying not only do you want to keep the data but also keep the whole system setup.
I tersely outlined how to do this earlier.
in more detail...
1) boot a rescue CD, 2) drop the mirrors on sdb, 3) repartition and mkfs on sdb1 to use as temporary file space to hold the backups of the existing md0, md1 4) dump both file systems on md0, md1 to the temp file system on sdb1 5) delete both metadisks 6) repartition sda as 2 x raid1 w/o any active mirrors, 7) mkfs on the new md0, md1 8) restore the dumps on sdb1 to these new md0, md1 9) repartition sdb again as the two mirrors and join them to md0, md1
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@centos.org http://lists.centos.org/mailman/listinfo/centos
I 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)?
Thanks
It 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.