[CentOS] Reorg of a RAID/LVM system

2013-02-28 Thread Harold Pritchett
I have a system with 4 disk drives, two 512 Gb and two 1 Tb.
It look like this:

CentOS release 5.9 (Final)

Disk /dev/sda: 500.1 GB, 500107862016 bytes
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdc: 500.1 GB, 500107862016 bytes
Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
=

Disk /dev/sda: 500.1 GB, 500107862016 bytes
16 heads, 63 sectors/track, 969021 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot  Start End  Blocks   Id  System
/dev/sda1   *   11985 1000408+  fd  Linux raid autodetect
/dev/sda219869923 4000752   82  Linux swap / Solaris
/dev/sda39924  969021   483385392   fd  Linux raid autodetect

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot  Start End  Blocks   Id  System
/dev/sdb1   *   1 125 1004031   fd  Linux raid autodetect
/dev/sdb2 126 624 4008217+  82  Linux swap / Solaris
/dev/sdb3 625  121601   971747752+  fd  Linux raid autodetect

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot  Start End  Blocks   Id  System
/dev/sdc1   *   1 125 1004031   fd  Linux raid autodetect
/dev/sdc2 126409631897057+  82  Linux swap / Solaris
/dev/sdc34097   60801   455482912+  fd  Linux raid autodetect

Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot  Start End  Blocks   Id  System
/dev/sdd1   *   1 125 1004031   fd  Linux raid autodetect
/dev/sdd2 126 624 4008217+  82  Linux swap / Solaris
/dev/sdd3 625  121601   971747752+  fd  Linux raid autodetect

The four 1 GB partitions (sd[abcd]1) are configured as a RAID 1 array with a 
single ext4
filesystem mounted as /boot.

Swap is Swap...

the two smaller drives (sd[ac]3) partitions are configured as a RAID 1 array 
containing an LVM
physical volume (md1).  the two larger drives (sd[bd]3) are configured as a 
RAID 1 array
containing an LVM physical volume (md2).


# pvdisplay
   --- Physical volume ---
   PV Name   /dev/md1
   VG Name   vg0
   PV Size   434.38 GB / not usable 7.44 MB
   Allocatable   yes
   PE Size (KByte)   32768
   Total PE  13900
   Free PE   7810
   Allocated PE  6090
   PV UUID   z5QGpO-6bKP-k8xm-vUha-CWYj-dkjG-UaHAE5

   --- Physical volume ---
   PV Name   /dev/md2
   VG Name   vg0
   PV Size   926.73 GB / not usable 12.31 MB
   Allocatable   yes (but full)
   PE Size (KByte)   32768
   Total PE  29655
   Free PE   0
   Allocated PE  29655
   PV UUID   RIliNF-SENU-O2S9-Qo4H-rtOC-2Yzr-7jzuB0

The two physical volumes are defined as a single volume group.

# vgdisplay
   --- Volume group ---
   VG Name   vg0
   System ID
   Formatlvm2
   Metadata Areas2
   Metadata Sequence No  17
   VG Access read/write
   VG Status resizable
   MAX LV0
   Cur LV10
   Open LV   10
   Max PV0
   Cur PV2
   Act PV2
   VG Size   1.33 TB
   PE Size   32.00 MB
   Total PE  43555
   Alloc PE / Size   35745 / 1.09 TB
   Free  PE / Size   7810 / 244.06 GB
   VG UUID dKKD3L-pcHy-F8KQ-6qNX-vFye-tXdv-6Qs98W

One of the 512 Gb drives is failing.  What I want to do is to replace the
two 512 Gb drives with 3 Tb drives, expand the RAID array on them and then
expand the LVM PV contained therein.  This much I can do.

I then want to move all of the date from the other PV into this one, and remove
the second PV, RAID array, and the two 1 Tb drives, leaving me with two 3 Tb
drves, a large RAID array and a single PV containing everything (except the 
/boot
and SWAP partitions.)

What I'm not sure about is how to move the date from the second PV to the
first so I can then delete the contents of the drive and physically remove them
from the system leaving me with only the two 3 Tb drives.

Help!

Thanks

Harold



___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Reorg of a RAID/LVM system

2013-02-28 Thread SilverTip257
On Thu, Feb 28, 2013 at 11:14 PM, Harold Pritchett har...@uga.edu wrote:

 I have a system with 4 disk drives, two 512 Gb and two 1 Tb.
 It look like this:

 CentOS release 5.9 (Final)

 Disk /dev/sda: 500.1 GB, 500107862016 bytes
 Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
 Disk /dev/sdc: 500.1 GB, 500107862016 bytes
 Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
 =

 ... snipped...


 One of the 512 Gb drives is failing.  What I want to do is to replace the
 two 512 Gb drives with 3 Tb drives, expand the RAID array on them and then
 expand the LVM PV contained therein.  This much I can do.


Make a backup.  You haven't said you did, but I won't go without saying it.
You're going to need a backup even _if_ you moving extents between PVs.


 I then want to move all of the date from the other PV into this one, and
 remove
 the second PV, RAID array, and the two 1 Tb drives, leaving me with two 3
 Tb
 drves, a large RAID array and a single PV containing everything (except
 the /boot
 and SWAP partitions.)

 What I'm not sure about is how to move the date from the second PV to the
 first so I can then delete the contents of the drive and physically remove
 them
 from the system leaving me with only the two 3 Tb drives.


You add your new PVs to the VG that your existing PVs are in.  Then run
pvmove [0] to migrate extents from the old PV to the new one.  There are a
couple of examples at the link I referenced.

[0]
http://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/online_relocation.html


 Help!

 Thanks

 Harold



 ___
 CentOS mailing list
 CentOS@centos.org
 http://lists.centos.org/mailman/listinfo/centos



-- 
---~~.~~---
Mike
//  SilverTip257  //
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos