[CentOS] raid 1 disks upgrade

Tim Verhoeven

tim.verhoeven.be at gmail.com
Mon Jul 13 10:20:26 UTC 2009


On Mon, Jul 13, 2009 at 12:13 PM, Coert
Waagmeester<lgroups at waagmeester.co.za> wrote:
>
> I have a machine with 2 SATA 250GB disks which I want to upgrade to 1TB
> SATAs
>
> This is the partition structure on both disks:
>
> 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          25      200781   fd  Linux raid
> autodetect
> /dev/sda2              26        1971    15631245   fd  Linux raid
> autodetect
> /dev/sda3            1972       30401   228363975   fd  Linux raid
> autodetect
>
> there are 3x RAID1 arrays.
> First is for /boot
> Second if for swap
> Third is for LVM (contains / and other filesystems)
>
> What is the easiest way to get this upgraded?
>
> I thought that I could maybe dd all the LVM volumes and /boot into
> files, setup the new RAID1 arrays on the 1TB disks, and dd everything
> back? or is there an easier way?
>

The software RAID 1 implementation of the kernel allows the array to
be extended. First you replace each old disk with the new 1TB disks
and each time rebuild the array. After this the array is still only
250GB but the partitions are already 1TB in size. Then use the --grow
option of mdadm to increase the array to 1TB. Then it starts rebuilded
the new space. When this is ready you can use the pvextend command to
tell LVM that the PV has grown. Then the new space should be available
in the volume group and you can increase the LV's and the filesystems
inside them.

Regards,
Tim

-- 
Tim Verhoeven - tim.verhoeven.be at gmail.com - 0479 / 88 11 83

Hoping the problem  magically goes away  by ignoring it is the
"microsoft approach to programming" and should never be allowed.
(Linus Torvalds)



More information about the CentOS mailing list