[linux-lvm] Adding PVs to a group

Charles Marcus CMarcus at Media-Brokers.com
Fri Apr 18 21:45:07 UTC 2008


Hello,

I'm still fairly new to using LVM, and I need to do something on a live 
server, so just need to be sure of what I'm doing...

Hardware:

3ware 9500S-8 Raid card with 8 Seagate 160GB hard drives

Ports 0 & 1 are mirrored, and contain:

    Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         100      803218+  83  Linux
/dev/sda2             101         163      506047+  82  Linux swap
/dev/sda3             164        2654    20008957+  83  Linux
/dev/sda4            2655       19450   134913870   83  Linux

The other 6 are set up in a Raid 10, and contain:

    Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       24900   200009218+  8e  Linux LVM
/dev/sdb2           24901       58352   268703190   8e  Linux LVM

pvscan shows:

myhost # pvscan
   /dev/cdrom: open failed: Read-only file system
   Attempt to close device '/dev/cdrom' which is not open.
   PV /dev/sdb1   VG vg2   lvm2 [190.74 GB / 0    free]
   Total: 1 [190.74 GB] / in use: 1 [190.74 GB] / in no VG: 0 [0   ]
myhost #

lvscan shows:

myhost # lvscan
   ACTIVE            '/dev/vg2/home' [50.00 GB] inherit
   ACTIVE            '/dev/vg2/usr' [20.00 GB] inherit
   ACTIVE            '/dev/vg2/var' [120.74 GB] inherit
myhost #

So, /dev/sdb2 was being used for backups, but I was finally able to 
convince the boss to let me get a QNAP NAS, so am using that for backups 
now.

What I want to do is make the space from /dev/sdb2 available to my vg2 
volume group, so I can extend my /var partition (it is filling up fast - 
damn email packrats)....

Am I correct in that all I need to do is:

vgextend vg2 /dev/sdb2

then I can extend any of the logical volumes?

What I want to do is add all of /dev/sdb2 to the /var partition, so am I 
correct taht to do this I would do:

lvextend -l %FREE /dev/vg2/var

(I think the %FREE is how I tell it to use all of it, right?)

then resize the filesystem (it is reiserfs):

umount /dev/vg2/var
resize_reiserfs /dev/vg2/var
mount -t reiserfs /dev/vg2/var /var

Thanks for any help and/or suggestions...

-- 

Best regards,

Charles




More information about the linux-lvm mailing list