howto extendlvm

madunix madunix at gmail.com
Wed May 19 18:27:31 UTC 2010


i have done the following and it w0rks
[root at localhost ~]# fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 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        3916    31350847+  8e  Linux LVM
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       10240    10485744   8e  Linux LVM
Disk /dev/sdc: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk /dev/sdc doesn't contain a valid partition table
[root at localhost ~]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or
OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 10240.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
  (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
  e   extended
  p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-10240, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-10240, default 10240):
Using default value 10240

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root at localhost ~]# pvcreate /dev/sdc1
 Physical volume "/dev/sdc1" successfully created
[root at localhost ~]# vgextend VolGroup00 /dev/sdc1
 Volume group "VolGroup00" successfully extended
VolGroup00-LogVol00  VolGroup00-LogVol01
[root at localhost ~]# lvextend -L +9.9G /dev/mapper/VolGroup00-LogVol00
Rounding up size to full physical extent 9.91 GB
Extending logical volume LogVol00 to 45.78 GB
Logical volume LogVol00 successfully resized
[root at localhost ~]# resize2fs /dev/mapper/VolGroup00-LogVol0
VolGroup00-LogVol00  VolGroup00-LogVol01
[root at localhost ~]# resize2fs /dev/mapper/VolGroup00-LogVol00
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/mapper/VolGroup00-LogVol00 is mounted on /; on-line
resizing required
Performing an on-line resize of /dev/mapper/VolGroup00-LogVol00 to
12001280 (4k) blocks.
The filesystem on /dev/mapper/VolGroup00-LogVol00 is now 12001280 blocks long.
[root at localhost ~]# df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      45G  2.2G   40G   6% /
/dev/sda1              99M   13M   81M  14% /boot
tmpfs                1006M     0 1006M   0% /dev/shm
[root at localhost ~]#

On Wed, May 19, 2010 at 9:04 PM, bastian v.s <bastianvs at gmail.com> wrote:
> example
>
> lvdisplay
>
> umount  /dev/mapper/VolGroup00-LogVol00
> lvextend -L <mention size> /dev/VolGroup00-LogVol00
> resize2fs  -f /dev/VolGroup00-LogVol00
>
> init 6
> mount  -a
>
> On Wed, May 19, 2010 at 1:31 PM, madunix <madunix at gmail.com> wrote:
>
>> I want to extend an existing lvm ( volume group "VolGroup00" using
>> metadata type lvm2)
>> [root at linux2 ~]# df -kh
>> Filesystem            Size  Used Avail Use% Mounted on
>> /dev/mapper/VolGroup00-LogVol00
>>                       58G   12G   44G  21% /
>> /dev/sda1              99M   27M   68M  29% /boot
>> tmpfs                 7.9G     0  7.9G   0% /dev/shm
>> [root at linux2 ~]# vgscan
>>  Reading all physical volumes.  This may take a while...
>>  Found volume group "VolGroup00" using metadata type lvm2
>> [root at linux2 ~]# lvmdiskscan
>>  /dev/ram0                [       16.00 MB]
>>  /dev/root                [       58.84 GB]
>>  /dev/ram                 [       16.00 MB]
>>  /dev/sda1                [      101.94 MB]
>>  /dev/VolGroup00/LogVol01 [        8.78 GB]
>>  /dev/ram2                [       16.00 MB]
>>  /dev/sda2                [       67.65 GB] LVM physical volume
>>  /dev/ram3                [       16.00 MB]
>>  /dev/ram4                [       16.00 MB]
>>  /dev/ram5                [       16.00 MB]
>>  /dev/ram6                [       16.00 MB]
>>  /dev/ram7                [       16.00 MB]
>>  /dev/ram8                [       16.00 MB]
>>  /dev/ram9                [       16.00 MB]
>>  /dev/ram10               [       16.00 MB]
>>  /dev/ram11               [       16.00 MB]
>>  /dev/ram12               [       16.00 MB]
>>  /dev/ram13               [       16.00 MB]
>>  /dev/ram14               [       16.00 MB]
>>  /dev/ram15               [       16.00 MB]
>>  2 disks
>>  17 partitions
>>  0 LVM physical volume whole disks
>>  1 LVM physical volume
>> [root at linux2 ~]# fdisk -l
>>
>> Disk /dev/sda: 72.7 GB, 72746008576 bytes
>> 255 heads, 63 sectors/track, 8844 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        8844    70935007+  8e  Linux LVM
>> [root at linux2 ~]#
>>
>> Can you point out the safe way to do it?
>> Am thinking to do the following steps on my RHEL5.1
>> vgs
>> pvcreate /dev/lun2
>> vgextend vg01 /dev/lun2
>> lvextend -L +1G /dev/vg01/lv01
>> resize2fs /mount/point/of/lv01
>>
>> Thanks
>>
>> --
>> redhat-list mailing list
>> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
>> https://www.redhat.com/mailman/listinfo/redhat-list
>>
>
>
>
> --
> With Regard`s
>                       Bastian V.S
>                       Redhat Certified Engineer
>                       Mob :+919846363663
>                       bastianvs at gmail.com
>                       linuxcrazyworld.blogspot.com
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>




More information about the redhat-list mailing list