steps to add a new physical disk to existing LVM setup in new centos box?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Not a centos specific question here, but if anyone can save me from 
shooting myself in the foot would appreciate any pointers.... I have an 
older centos 4.7 box that I recently replaced with a newer one running 
centos 5.3.  I'd like to add the hard disk from the older one to the 
newer one before I scrap it for good.  I don't care about the data on 
it, would just like the extra drive on the newer one for my home lan usage.

The disk layout on the older one is a 2 partition (/boot and /) with / 
being a logical volume.  Laying out what I think I need to do looks like 
this :

1. yank old drive and cable up to newer system, expecting this 2nd drive 
to now be /dev/sdb on the new box
2. pvcreate /dev/sdb1
3. vgextend VolGroup00 /dev/sdb1 (VolGroup00 is the volume group name on 
both system, pretty much default installs in both cases)
3. lvextend -l+100% /dev/VolGroup00
4. resize2fs /

The disk in the old system looks like :
[root@cow ~]# fdisk -l /dev/hda

Disk /dev/hda: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14       14946   119949322+  8e  Linux LVM
[root@cow ~]# fdisk -l -u /dev/hda

Disk /dev/hda: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders, total 240121728 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *          63      208844      104391   83  Linux
/dev/hda2          208845   240107489   119949322+  8e  Linux LVM
[root@cow ~]# pvscan
  PV /dev/hda2   VG VolGroup00   lvm2 [114.38 GB / 32.00 MB free]
  Total: 1 [114.38 GB] / in use: 1 [114.38 GB] / in no VG: 0 [0   ]
[root@cow ~]# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "VolGroup00" using metadata type lvm2
[root@cow ~]# lvscan
  ACTIVE            '/dev/VolGroup00/LogVol00' [113.84 GB] inherit
  ACTIVE            '/dev/VolGroup00/LogVol01' [512.00 MB] inherit


I'm curious if my 1-4 seem sane, or if I'll need to cfdisk and nuke the 
existing partitions on the disk once in the newer system, or if pvcreate 
will do what I need.

If there is a preferred method to my madness, and you can save me from 
shooting a hole in my foot, appeciate any comments.

Thanks in Advance,
Jerry Queirolo

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

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux