• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1415
  • Last Modified:

Mirror existing system disk

I have a CentOS 5 machine set up with LVM2 set up on the first disk /dev/sda.  The other disk is /dev/sdb.  They are idential disks  and I would like to mirror them but have not been able to do so.  It must be possible to mirror /dev/sda to /dev/sdb even though it has already been partitioned and is in use, but I have not been able to figure out how.  The disks look like this:

fdisk -l

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          13      104391   83  Linux
/dev/sda2              14       30401   244091610   8e  Linux LVM

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          13      104391   83  Linux
/dev/sdb2              14       30401   244091610   8e  Linux LVM


When I try to mirror the first partition, I get the following:
mdadm --create /dev/md0 --level=1 --chunk=1024 --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm: Cannot open /dev/sda1: Device or resource busy
mdadm: create aborted


Do I need to boot to a CD distribution like knoppix to do this?  Thanks for any help you can give me.
0
barthalamu
Asked:
barthalamu
  • 2
  • 2
1 Solution
 
ravenplCommented:
Look at this tutorial. It's for novel, but works for any Linux OS.
http://www.novell.com/coolsolutions/appnote/15087.html
0
 
barthalamuAuthor Commented:
Thank you both.

PUNKY - Although this would work during installation, I already have a system installed.  I just need to make a RAID1 out of my existing boot/system disk.

ravenpl - This is very interesting, but it does not look like it is for LVM on RAID.  I suspect that it will probably not work, although I'm not sure.  I can seem to find the information of how to create a RAID1 mirror when I already have a system installed on /dev/sda using LVM.
0
 
ravenplCommented:
> ravenpl - This is very interesting, but it does not look like it is for LVM on RAID
Really does not matter. You may skip the LVM parts and create filesystem on /dev/mdX devices.
0
 
barthalamuAuthor Commented:
Thanks ravenpl.  I think I can make this work with LVM instead of regular partitions.  Thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now