before resizing the logical volume

13
Increasing Oracle Enterprise Linux Disk Resource in a VMware Environment. February 15, 2008 Zachary Buckholz [email protected] Summary: This document provides step-by-step instructions for increasing the disk resources for a VMware guest system running Oracle Enterprise Linux under VMware 3.x.

Upload: zbuckholz

Post on 30-May-2018

233 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Before Resizing the Logical Volume

8/14/2019 Before Resizing the Logical Volume

http://slidepdf.com/reader/full/before-resizing-the-logical-volume 1/12

Increasing Oracle Enterprise Linux

Disk Resource in a VMware

Environment.February 15, 2008

Zachary Buckholz

[email protected]

Summary: This document provides step-by-step instructions for increasing the disk resources for a VMware

guest system running Oracle Enterprise Linux under VMware 3.x.

Page 2: Before Resizing the Logical Volume

8/14/2019 Before Resizing the Logical Volume

http://slidepdf.com/reader/full/before-resizing-the-logical-volume 2/12

 

Using the VIC client right-click the VM Guest you are going to add disk resources to. When the context

menu appears left-click “Edit Settings” 

Page 3: Before Resizing the Logical Volume

8/14/2019 Before Resizing the Logical Volume

http://slidepdf.com/reader/full/before-resizing-the-logical-volume 3/12

On the next screen left-click the “Add” button which is highlighted below. 

Page 4: Before Resizing the Logical Volume

8/14/2019 Before Resizing the Logical Volume

http://slidepdf.com/reader/full/before-resizing-the-logical-volume 4/12

Page 5: Before Resizing the Logical Volume

8/14/2019 Before Resizing the Logical Volume

http://slidepdf.com/reader/full/before-resizing-the-logical-volume 5/12

On the next screen “Create a new virtual disk” should be selected by default, if not select it and left-

click “Next”. 

Page 6: Before Resizing the Logical Volume

8/14/2019 Before Resizing the Logical Volume

http://slidepdf.com/reader/full/before-resizing-the-logical-volume 6/12

On the next screen set the disk size and location. Additional disks can always be added in the future so

there is no need to over commit disk resources. Just add what is justified at this time. The “Location”

option should be left at the default setting of “Store with the virtual machine”. Left-click “Next” to

continue.

Page 7: Before Resizing the Logical Volume

8/14/2019 Before Resizing the Logical Volume

http://slidepdf.com/reader/full/before-resizing-the-logical-volume 7/12

On the next screen the “Virtual Device Node” will default to the next available, leave everything alone

here. Left-click “Next”. 

Page 8: Before Resizing the Logical Volume

8/14/2019 Before Resizing the Logical Volume

http://slidepdf.com/reader/full/before-resizing-the-logical-volume 8/12

On the next screen just left-click “Finish”. 

Page 9: Before Resizing the Logical Volume

8/14/2019 Before Resizing the Logical Volume

http://slidepdf.com/reader/full/before-resizing-the-logical-volume 9/12

On the next screen just left-click “Ok”. 

Page 10: Before Resizing the Logical Volume

8/14/2019 Before Resizing the Logical Volume

http://slidepdf.com/reader/full/before-resizing-the-logical-volume 10/12

The VIC screen will show the status of the task at the bottom, once it completes the VM Guest needs to

rescan the SCSI bus to detect the new disk.

Log into the VM Guest and run the rescan-scsi-bus.sh shell script located under /root as the root user.

If the rescan-scsi-bus.sh shell script is not available on the system, it can be obtained from

http://bash.cyberciti.biz/diskadmin/rescan-scsi-bus.sh.php  

[root@oelvm ~]# ./rescan-scsi-bus.sh

Host adapter 0 (mptspi) found.Scanning hosts 0 channels 0 for

SCSI target IDs 0 1 2 3 4 5 6 7 , LUNs 0

Scanning for device 0 0 0 0 ...

OLD: Host: scsi0 Channel: 00 Id: 00 Lun: 00

Vendor: VMware Model: Virtual disk Rev: 1.0

Type: Direct-Access ANSI SCSI revision: 02

Scanning for device 0 0 1 0 ...

OLD: Host: scsi0 Channel: 00 Id: 01 Lun: 00

Vendor: VMware Model: Virtual disk Rev: 1.0

Type: Direct-Access ANSI SCSI revision: 02

Scanning for device 0 0 2 0 ...

NEW: Host: scsi0 Channel: 00 Id: 02 Lun: 00

Vendor: VMware Model: Virtual disk Rev: 1.0

Type: Direct-Access ANSI SCSI revision: 02

1 new device(s) found.

0 device(s) removed.

Page 11: Before Resizing the Logical Volume

8/14/2019 Before Resizing the Logical Volume

http://slidepdf.com/reader/full/before-resizing-the-logical-volume 11/12

Now the logical volume can be extended using the LVM tools.

Issue an fdisk –l to list the current disks and partitions, and obtain the new device name assigned by the

system to the new disk. The new disk is highlighted below.

Now create a physical lvm disk by issuing pvcreate

Next extend the volume group to include the newly created physical lvm disk using the vgextend command.

Issue a vgdisplay to obtain the volume group name. The volume group is highlighted below.

[root@oelvm ~]# fdisk –l

Disk /dev/sda: 8589 MB, 8589934592 bytes

255 heads, 63 sectors/track, 1044 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 1044 8281507+ 8e Linux LVM

Disk /dev/sdb: 32.2 GB, 32212254720 bytes

255 heads, 63 sectors/track, 3916 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 8589 MB, 8589934592 bytes

255 heads, 63 sectors/track, 1044 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table

[root@oelvm ~]# pvcreate /dev/sdc

Physical volume "/dev/sdc" successfully created

[root@oelvm ~]# vgdisplay

--- Volume group ---

VG Name VolGroup00

System ID

Format lvm2

Metadata Areas 2Metadata Sequence No 5

VG Access read/write

VG Status resizable

MAX LV 0

Cur LV 2

Open LV 2

Max PV 0

Cur PV 2

Act PV 2

VG Size 37.84 GB

Page 12: Before Resizing the Logical Volume

8/14/2019 Before Resizing the Logical Volume

http://slidepdf.com/reader/full/before-resizing-the-logical-volume 12/12

 

Now extend the volume group, passing as parameters the Volume Group name and the new physical LVM device.

Next extend the logical volume to include 100% of the newly added free space in the volume group.

The last step is to increase the file system size to include the newly created logical volume disk space.

Use the Linux resize2fs command and pass as a parameter the Logical Volume device.

Before resizing the Logical Volume: (3.2 GB free space)

Initial VM Guest

After adding a new disk in the VMware Console, and resizing the Logical Volume: (31 GB free space)

After adding one 20GB disk

After adding another disk and resizing the file system: (44 GB free space)

After adding one 8GB disk

[root@oelvm ~]# df –h

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

6.7G 3.2G 3.2G 51% /

/dev/sda1 99M 19M 75M 21% /boot

tmpfs 250M 0 250M 0% /dev/shm 

[root@oelvm ~]# df –h

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

36G 3.3G 31G 10% /

/dev/sda1 99M 19M 75M 21% /boot

tmpfs 250M 0 250M 0% /dev/shm

[root@oelvm ~]# vgextend VolGroup00 /dev/sdc

Volume group "VolGroup00" successfully extended

[root@oelvm ~]# lvextend -l +100%FREE /dev/VolGroup00/LogVol00

Extending logical volume LogVol00 to 44.81 GB

Logical volume LogVol00 successfully resized

[root@oelvm ~]# 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 11747328 (4k) blocks.

The file system on /dev/VolGroup00/LogVol00 is now 11747328 blocks long.

[root@oelvm ~]# df –h

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

44G 7.0G 35G 17% /

/dev/sda1 99M 19M 75M 21% /boot

tmpfs 250M 0 250M 0% /dev/shm