Find the answer to your Linux question:
Results 1 to 2 of 2
I have a problem extending an existing logical volume when adding a new hard drive. This is what my disk setup looked like before: Code: [root@centos ~]# df -h Filesystem ...
  1. #1
    Just Joined!
    Join Date
    Aug 2008
    Posts
    9

    Extending a logical volume

    I have a problem extending an existing logical volume when adding a new hard drive.

    This is what my disk setup looked like before:
    Code:
    [root@centos ~]# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
                           64G  1.4G   60G   3% /
    /dev/sda1              99M   19M   76M  20% /boot
    tmpfs                 633M     0  633M   0% /dev/shm
    I added a second hard drive to my server (/dev/sdb), formatted it with Linux LVM as its primary partition, and then put a logical ext3 partition on it.

    Code:
    [root@centos ~]# fdisk -l
    
    Disk /dev/sda: 73.4 GB, 73407868928 bytes
    255 heads, 63 sectors/track, 8924 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        8924    71577607+  8e  Linux LVM
    
    Disk /dev/sdb: 36.9 GB, 36954401792 bytes
    255 heads, 63 sectors/track, 4492 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               1        4492    36081958+  8e  Linux LVM
    I then created a physical volume for the disk with the command

    Code:
    pvcreate /dev/sdb1
    I then ran

    Code:
    [root@centos ~]# vgextend /dev/VolGroup00 /dev/sdb1
      Volume group "VolGroup00" successfully extended
    then

    Code:
    [root@centos ~]# lvextend /dev/VolGroup00/LogVol00 /dev/sdb1
      Extending logical volume LogVol00 to 100.16 GB
      Logical volume LogVol00 successfully resized
    My first hard disk is ~65 GB and my second is ~35. So the combined total should be ~100.
    So this output looks correct:

    Code:
    [root@centos ~]# lvdisplay
      --- Logical volume ---
      LV Name                /dev/VolGroup00/LogVol00
      VG Name                VolGroup00
      LV UUID                qYo1cg-ldD0-ursB-pbhi-EjUP-7yH8-eeLDIf
      LV Write Access        read/write
      LV Status              available
      # open                 1
      LV Size                100.16 GB
      Current LE             3205
      Segments               2
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           253:0
       
      --- Logical volume ---
      LV Name                /dev/VolGroup00/LogVol01
      VG Name                VolGroup00
      LV UUID                Uvc0br-Fq2U-WYvi-9I98-ADLH-aKSj-COxsor
      LV Write Access        read/write
      LV Status              available
      # open                 1
      LV Size                2.50 GB
      Current LE             80
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           253:1
    (the combined total is ~100 GB)

    But, "df -h" looks unchanged:
    Code:
    [root@centos ~]# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
                           64G  1.4G   60G   3% /
    /dev/sda1              99M   19M   76M  20% /boot
    tmpfs                 633M     0  633M   0% /dev/shm
    How do I fix this? Must you "commit" the changes to the filesystem somehow?

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...