Linux Enlarge the LV

1,View the free spaces

#vgs
              vsize  xx

2,View file system and LV

# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/datavg-backup

                     1008M   34M  924M   4% /opt/backup



# lvdisplay  /dev/datavg/backup

  --- Logical volume ---

  LV Name                /dev/datavg/backup

  VG Name                datavg

  LV UUID                20vC1U-32uu-yxJk-FGxS-is2B-iAEo-zh3tF6

  LV Write Access        read/write

  LV Status              available

  # open                 1

  LV Size                1.00 GB

3,Enlarge the LV 

 
# lvresize -L +500M /dev/datavg/backup
  Extending logical volume backup to 1.49 GB

  Logical volume backup successfully resized

# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/datavg-backup

                     1008M   34M  924M   4% /opt/backup

   We have increased the size of the logical volume, the size of the file system has been unaffected.

4, Resize the filesystem 

   We now need to resize the ext3 file system to utilize the remaining available space within the logical volume 

# resize2fs -p /dev/datavg/backup
resize2fs 1.39 (29-May-2006)

Filesystem at /dev/datavg/backup is mounted on /opt/backup; on-line resizing required

Performing an on-line resize of /dev/datavg/backup to 390144 (4k) blocks.

The filesystem on /dev/datavg/backup is now 390144 blocks long.

5, Check out

# df -h
Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/datavg-backup

                      1.5G   34M  1.4G   3% /opt/backup

 

转载于:https://my.oschina.net/am313/blog/680400

你可能感兴趣的:(Linux Enlarge the LV)