Monday, March 7, 2011

How to extend disk space in Linux LVM

Environment
Quater rack Exadata

Problem
Limited disk space in the DB server.

[oracle@thordb02 ~]$ df -h
Filesystem                                           Size  Used   Avail       Use%   Mounted on
/dev/mapper/VGExaDb-LVDbSys1
                                                          30G  4.4G    24G       16%     /
/dev/sda1                                        124M   16M   102M     14%     /boot
/dev/mapper/VGExaDb-LVDbOra1
                                                         99G   12G    82G        13%    /u01
tmpfs                                                81G   192M   81G       1%     /dev/shm

However, "vgdisplay" shows that there are 403 GB free physical extends:

[root@exadata02~]# vgdisplay
  --- Volume group ---
  VG Name               VGExaDb
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               557.62 GB
  PE Size               4.00 MB
  Total PE              142751
  Alloc PE / Size       39424 / 154.00 GB
  Free  PE / Size       103327 / 403.62 GB
  VG UUID               97W2L1-SnRc-MyS2-UvNJ-hkiB-df6t-b0SdWf


Solution
I followed instructions found in this article to extend the free disk space in the server, here are the commands I used:
1 lvcreate --name u02 --size 400g VGExaDb
2 mkfs.ext3 /dev/VGExaDb/u02
3 mount /dev/VGExaDb/u02 /u02
4 Edit /etc/fstab file to add /u02 so that when server reboots, /u02 will be automatically mounted.

References

  1. A Beginner's Guide To LVM - Page 2
  2. Extending a logical volume
  3. Linux Logical Volume Manager Walkthrough
  4. Can I run fsck or e2fsck when Linux file system is mounted?
  5. Extending a Logical Volume
  6. Logical Volume Manager: How can I extend a Volume Group?
  7. Quick HOWTO : Ch27 : Expanding Disk Capacity
  8. The Linux Logical Volume Manager





Labels: ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home