Blog Archives

Grow Oracle Linux Root Filesystem

It is always the case that in my Linux VM installations I run out of root file system space and need to grow it (I can hear you experienced admin, I should create another filesystem for my use and not use root file system for my joy). Here are the steps to grow root filesystem for Oracle Linux running on VMware:

Click on the wrench symbol to go to your virtual machine configuration menu

Screen Shot 2012-12-31 at 1.02.46 AM

Choose Hard Disk (SCSI) menu to increase the size of an availabe virtual disk (in this case your root file system disk)

Screen Shot 2012-12-31 at 1.07.12 AMGrow your virtual disk to a proper size (In this case I grow it form 28GB to 34GB)

Screen Shot 2012-12-31 at 1.07.23 AM

Now you can start your Oracle Linux on VM*.

First step at guest OS (Oracle Linux) is to grow disk partition size using fdisk. Here are the steps assuming that your root file system is on /dev/sda2 partition

  1. fdisk /dev/sda
  2. d (to delete)
  3. 2 (to delete partition 2)
  4. n (to create a new partition)
  5. p (to create a new partition with primary type)
  6. 2 (to create a new primary partition with id 2)
  7. Accept all defaults (to create a new primary partition with default offset and fully covering virtual disk you have already provisioned)
  8. w (write partition table)

Once you are done with disk partition modification rebounce Oracle Linux to ensure partition tables are read by Linux.

Once the guest OS is back, resize physical volume using pvresize. We will add 6GB (slightly less maybe) to existing physical partition using pvresize command

pvresize --setphysicalvolumesize 31G /dev/sda2

Now we can grow logical volume by 6GB

lvresize -L +6G /dev/VolGroup00/LogVol00

Final step is to grow file system online using resize2fs

resize2fs /dev/VolGroup00/LogVol00

You are done. You can continue filling root file system  🙂

* Before starting it is a good decision to protect your existing VM guest by using VMware snapshots.


VMware Tools for Oracle UEK

If you wish to use VMware Tools with Oracle UEK as the guest OS (you should use it in order to interact guest with the host, proper screen resolution and many other functionality) you need to perform some extra steps unlike some other Linux distros. Such as Ubuntu, which can be automatically configured by VMware

Here is the list of actions you should take for installation:

  1. Configure yum on your Linux installation
  2. Using VMware Virtual Machine menu choose Install VMware Tools option which will mount a pseudo device.
  3. Copy VMwareTools-8.8.4-730257.tar.gz  into /tmp and extract it using tar -xzvf VMwareTools-8.8.4-730257.tar.gz 
  4. yum install kernel-headers kernel-uek-devel
  5. ./ as root

You are done.