[root@WEB ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      763G  6.1G  718G   1% /
/dev/sda1              99M   13M   81M  14% /boot
tmpfs                  24G     0   24G   0% /dev/shm
[root@WEB ~]# cat /etc/fstab
/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0

[root@WEB ~]# lvdisplay
  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol00
  VG Name                VolGroup00
  LV UUID                XIIaiU-nBG2-d9Xo-a3Xt-vnCx-Nte3-ahzeUN
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                787.41 GB
  Current LE             25197
  Segments               1
  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                KL8uyf-bAQs-qfkU-DkYU-fkzv-zjDS-S3zEBU
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                49.09 GB
  Current LE             1571
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

[root@WEB ~]# free -g
             total       used       free     shared    buffers     cached
Mem:            47          5         41          0          0          4
-/+ buffers/cache:          0         46
Swap:           49          0         49
[root@WEB ~]# swapoff -a
[root@WEB ~]# free -m
             total       used       free     shared    buffers     cached
Mem:         48256       5441      42814          0        124       4912
-/+ buffers/cache:        404      47851
Swap:            0          0          0
[root@WEB ~]# lvreduce /dev/VolGroup00/LogVol01 -L -40G
  WARNING: Reducing active logical volume to 9.09 GB
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce LogVol01? [y/n]: y
  Reducing logical volume LogVol01 to 9.09 GB
  Logical volume LogVol01 successfully resized
[root@WEB ~]# mkswap /dev/VolGroup00/LogVol01
Setting up swapspace version 1, size = 9764335 kB
[root@WEB ~]# free -g
             total       used       free     shared    buffers     cached
Mem:            47          5         41          0          0          4
-/+ buffers/cache:          0         46
Swap:            0          0          0
[root@WEB ~]# swapon /dev/VolGroup00/LogVol01
[root@WEB ~]# free -g
             total       used       free     shared    buffers     cached
Mem:            47          5         41          0          0          4
-/+ buffers/cache:          0         46
Swap:            9          0          9
[root@WEB ~]# vgdisplay
  --- Volume group ---
  VG Name               VolGroup00
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               836.50 GB
  PE Size               32.00 MB
  Total PE              26768
  Alloc PE / Size       25488 / 796.50 GB
  Free  PE / Size       1280 / 40.00 GB
  VG UUID               xHcIzm-8I9Y-7wvZ-X8un-iHLx-8cZO-85Qwej
   
[root@WEB ~]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
[root@WEB ~]# free -g
             total       used       free     shared    buffers     cached
Mem:            47          5         41          0          0          4
-/+ buffers/cache:          0         46
Swap:            9          0          9
[root@WEB ~]# lvextend /dev/VolGroup00/LogVol00 -l +100%FREE
  Extending logical volume LogVol00 to 827.41 GB
  Logical volume LogVol00 successfully resized
[root@WEB ~]# resize2fs /dev/VolGroup00/LogVol00
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/VolGroup00/LogVol00 is mounted on /; on-line resizing required
Performing an on-line resize of /dev/VolGroup00/LogVol00 to 216899584 (4k) blocks.
The filesystem on /dev/VolGroup00/LogVol00 is now 216899584 blocks long.

[root@WEB ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      802G  6.1G  755G   1% /
/dev/sda1              99M   13M   81M  14% /boot
tmpfs                  24G     0   24G   0% /dev/shm
[root@WEB ~]# free -m
             total       used       free     shared    buffers     cached
Mem:         48256       6907      41348          0       1540       4912
-/+ buffers/cache:        454      47801
Swap:         9311          0       9311
[root@WEB ~]# 

发表评论

电子邮件地址不会被公开。 必填项已用*标注