Add Disk Space to a VM when a Partition is Full



Similar documents
BackTrack Hard Drive Installation

HP LeftHand SAN Solutions

Creating a Cray System Management Workstation (SMW) Bootable Backup Drive

How you configure Iscsi target using starwind free Nas software & configure Iscsi initiator on Oracle Linux 6.4

Oracle VM Server Recovery Guide. Version 8.2

LBNC and IBM Corporation Document: LBNC-Install.doc Date: Path: D:\Doc\EPFL\LNBC\LBNC-Install.doc Version: V1.0

Module 4 - Introduction to XenServer Storage Repositories

Deploying a Virtual Machine (Instance) using a Template via CloudStack UI in v4.5.x (procedure valid until Oct 2015)

How To Set Up Software Raid In Linux (Amd64)

Setup software RAID1 array on running CentOS 6.3 using mdadm. (Multiple Device Administrator) 1. Gather information about current system.

Installing a Second Operating System

NI Real-Time Hypervisor for Windows

USB 2.0 Flash Drive User Manual

USB Bare Metal Restore: Getting Started

AlienVault Offline Key Activation

Linux Template Creation Guide. How to build your own Linux VM templates for deployment in Cloudturk.

ucloud server User Guide v3.0 ( )

Configure NFS Staging for ACS 5.x Backup on Windows and Linux

How to Backup XenServer VM with VirtualIQ

Navigating the Rescue Mode for Linux

Sage Timberline Office

VOICE IMPROVEMENT PROCESSOR (VIP) BACKUP AND RECOVERY PROCEDURES - Draft Version 1.0

Drobo How-To Guide. What You Will Need. Use a Drobo iscsi Array with a Linux Server

The Logical Volume Manager (LVM)

Drobo How-To Guide. Cloud Storage Using Amazon Storage Gateway with Drobo iscsi SAN

Creating a Linux Virtual Machine using Virtual Box

How To Align A File System In Virtual Environments

Windows Template Creation Guide. How to build your own Windows VM templates for deployment in Cloudturk.

Backtrack 4 Bootable USB Thumb Drive with Full Disk Encryption

Using Virtual Machines

ECT362 Installing Linux Virtual Machine in KL322

Operating System Installation Guidelines

13.1 Backup virtual machines running on VMware ESXi / ESX Server

POD INSTALLATION AND CONFIGURATION GUIDE. EMC CIS Series 1

Backup & Disaster Recovery Appliance User Guide

How to Install Microsoft Windows Server 2008 R2 in VMware ESXi

Upgrading Cisco UCS Central

LVM2 data recovery. Milan Brož LinuxAlt 2009, Brno

ClearPass Policy Manager 6.3

How to Install Windows on Xen TM 3.0

MTA Course: Windows Operating System Fundamentals Topic: Understand backup and recovery methods File name: 10753_WindowsOS_SA_6.

Basic ESXi Networking

Reborn Card NET. User s Manual

Set Up Panorama. Palo Alto Networks. Panorama Administrator s Guide Version 6.0. Copyright Palo Alto Networks

RedHat (RHEL) System Administration Course Summary

Installing Sun's VirtualBox on Windows XP and setting up an Ubuntu VM

Support for Storage Volumes Greater than 2TB Using Standard Operating System Functionality

Sage Document Management. User's Guide Version 13.1

Servers and two Client with failover

Bringing the Eko VM Home (302)

Using and Contributing Virtual Machines to VM Depot

Required Virtual Interface Maps to... mgmt0. bridge network interface = mgmt0 wan0. bridge network interface = wan0 mgmt1

On Disk Encryption with Red Hat Enterprise Linux

Operating System Installation Guide

Memory management. Chapter 4: Memory Management. Memory hierarchy. In an ideal world. Basic memory management. Fixed partitions: multiple programs

How To Manage Your Volume On Linux (Evms) On A Windows Box (Amd64) On A Raspberry Powerbook (Amd32) On An Ubuntu Box (Aes) On Linux

Installing Windows 98 in Windows Virtual PC 7 (Windows Virtual PC)

Red Hat Linux 7.2 Installation Guide

Converting a Parallels Virtual Machine to Run in VMware Fusion VMware Fusion 1.0

Sage Document Management. User's Guide Version 12.1

vsphere Replication for Disaster Recovery to Cloud

Do it Yourself System Administration

Data Recovery. Introduction

WatchGuard Dimension v1.1 Update 1 Release Notes

NVIDIA RAID Installation Guide

How to Restore a Linux Server Using Bare Metal Restore

Bare Metal Backup And Restore

Virtual Appliance for VMware Server. Getting Started Guide. Revision Warning and Disclaimer

CommandCenter Secure Gateway

Penetration Testing LAB Setup Guide

How To Protect Your Data From Being Damaged On Vsphere Vdp Vdpa Vdpo Vdprod (Vmware) Vsphera Vdpower Vdpl (Vmos) Vdper (Vmom

VMware vsphere 5 Quick Start Guide

Bare Metal Recovery Quick Start Guide

Creating a Windows XP Virtual Machine using Virtual Box

Setup Cisco Call Manager on VMware

vsphere Replication for Disaster Recovery to Cloud

Acronis Backup & Recovery 10 Server for Linux. Command Line Reference

WES 9.2 DRIVE CONFIGURATION WORKSHEET

istar User Manual for Comsol USB Flash Drive

Cisco Prime Collaboration Deployment Troubleshooting

ServerPronto Cloud User Guide

Red Hat Linux Administration II Installation, Configuration, Software and Troubleshooting

NetVault : Backup. User s Guide for the VaultDR System Plugins

Support Notes for SUSE LINUX Enterprise Server 9 Service Pack 3 for the Intel Itanium 2 Processor Family

Red Hat Certifications: Red Hat Certified System Administrator (RHCSA)

Converting Linux and Windows Physical and Virtual Machines to Oracle VM Virtual Machines. An Oracle Technical White Paper December 2008

Hyper-V Installation Guide for Snare Server

Updates Click to check for a newer version of the CD Press next and confirm the disc burner selection before pressing finish.

NATIONAL POPULATION REGISTER (NPR)

LucidNAS Quick Start Guide

AMD RAID Installation Guide

Linux Server (Web, FTP, File) on Vmware

User Guide for VMware Adapter for SAP LVM VERSION 1.2

Overview Customer Login Main Page VM Management Creation... 4 Editing a Virtual Machine... 6

Vembu VMBackup v3.1.0 BETA

Linux Boot Camp. Our Lady of the Lake University Computer Information Systems & Security Department Kevin Barton Artair Burnett

Transcription:

Add Disk Sace to a VM when a Partition is Full Document ID: 119025 Contributed by Mike Dooley, Cisco TAC Engineer. Jun 29, 2015 Contents Introduction Background Information Procedure Section 1 Determine where you need to add sace and decide how much Section 2 Check for available unallocated sace in the volume grou Section 3 Check to see if there is enough available sace in the datastore Section 4 Use Free Sace in the Datastore in order to increase sace for the VM Section 5 Add the new sace to the artition Section 6 Resize the Physical Volume Section 7 Extend the size of the Volume Grou in order to use the new sace Section 8 Resize the filesystem on the logical volume in order to use the new sace Introduction This document describes how to add disk sace to Linux Virtual Machines (VMs). Background Information Linux (and Linux VMs) are installed on hard disks, whether real or virtual. On to of this is stacked a Volume Manager followed by a filesystem which is what is tyically used. For a Linux VM, these stes are required in order to increase the size of a filesystem: 1. Determine where you need to add sace and decide how much. 2. Check to see if unallocated sace is available in the volume grou. 3. Check to see if there is available sace in the datastore. 4. Use free sace in the datastore in order to increase sace for the VM. 5. Add the new sace to the artition. 6. Resize the hysical volume. 7. Extend the size of the volume grou so that it uses the new sace. 8. Resize the filesystem on the logical volume so that it uses the new sace. Note: Many of the resizing otions are RISKY and can leave the VM in an unbootable state or corrut data. Use caution. Note: Before you increase disk sace ensure you have cleaned u the existing filesystem. Often there are files in /tm, /var/tm, /var/tm/broadho and /var/log that are not needed and can be deleted instead of the addition of disk sace. Procedure

Section 1 Determine where you need to add sace and decide how much 1. 2. Use the Disk Free (df) command in order to find which artition needs more sace and where it is located. Record the Filesystem and Mounted On values. For examle, Filesystem: /dev/maer/volgrou00 LogVol03 Mounted On: /data. #df h Filesystem: Mounted On: This is samle outut for the df h command: [root@sessionmgr02 ~]# df h Filesystem Size Used Avail Use% Mounted on /dev/maer/volgrou00 LogVol00 18G 2.4G 15G 15% / /dev/maer/volgrou00 LogVol02 5.7G 140M 5.3G 3% /home /dev/maer/volgrou00 LogVol03 30G 27G 1.5G 97% /data /dev/sda1 99M 40M 55M 43% /boot tmfs 16G 0 16G 0% /dev/shm tmfs 8.0G 1.1G 7.0G 13% /data/sessions.1 Use the Physical Volume Dislay command (vdislay) in order to see the Physical Volume (PV) Name where the Volume Grou is located. Record the PV Name value (for examle 'PV Name: /dev/sda2'). # vdislay PV Name: This is samle outut for the vdislay command: [root@sessionmgr02 ~]# vdislay Physical volume PV Name /dev/sda2 VG Name VolGrou00 PV Size 69.89 GB / not usable 18.64 MB Allocatable yes PE Size (KByte) 32768 Total PE 2236 Free PE 320 Allocated PE 1916 PV UUID HO3ICX nrho FaBA MvB3 Zlzv JLG4 vnfqeu Note: The PV Name (/dev/sda2) shows two things. The first art (/dev/sda) shows the device and the second art (2) shows the artition number. 3. Write down how much disk sace you want (or need) to add here (for examle, 5 for 5 gigabytes). Disk Sace to Add <amount>: Section 2 Check for available unallocated sace in the volume grou 1. Enter the Volume Grou Dislay command (vgdislay) in order to check the Free Physical Extent (PE) Size. Record the Alloc PE / Size and Free PE / Size values. For examle, Alloc PE / Size: 59.88 Free PE / Size: 15.00.

2. # vgdislay Alloc PE / Size: Free PE / Size: This shows samle outut for the vgdislay command: [root@sessionmgr02 ~]# vgdislay Volume grou VG Name VolGrou00 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 9 VG Access read/write VG Status resizable MAX LV 0 Cur LV 4 Oen LV 4 Max PV 0 Cur PV 1 Act PV 1 VG Size 74.88 GB PE Size 32.00 MB Total PE 2396 Alloc PE / Size Free PE / Size 1916 / 59.88 GB 480 / 15.00 GB VG UUID PSNBU FRWO z3ac iaxs ewaw joft dtcbkd If the Free PE Size sace is larger than the sace you need to add, roceed to Section 7 of this document. Otherwise, continue to Section 3. Section 3 Check to see if there is enough available sace in the datastore 1. Log into the vshere client as an administrator (e.g. root). 2. Select the to level item in the tree (usually the IP of the system).

3. Check the Free sace on the Datastore under the Summary tab in order to ensure there is enough room to exand the artition. Note: If there is enough free sace for this exansion, continue with Section 4. If there is not enough free sace, sto this rocedure and add disk sace to the datastore before you roceed. Section 4 Use Free Sace in the Datastore in order to increase sace for the VM 1. Log into the VM and ower it down with the shutdown h now command. # shutdown h now This samle shows outut for the shutdown h now command: [root@sessionmgr02 ~]# shutdown h now Broadcast message from root (ts/0) (Wed Dec 18 11:48:20 2013): The system is going down for system halt NOW! 2. In the VMWare vshere Client, select/highlight the Virtual Machine. Then in the Getting Started tab click Edit virtual machine settings.

3. In the o u window, choose Hard Disk 1. 4. Increase the Provisioned Size of the Hard Disk by the amount you chose in Section 1 Ste 3. Then click OK. Note: The increased amount must be less than the amount of free sace on the datastore. Do not overrovision.

5. In vshere, click on the Green triangle in order to ower on the highlighted VM. Note: Wait 5 minutes for the VM to comletely load. 6. After the VM boots u, log into the VM as root. # ssh <vm_name> This samle shows outut for the ssh command: [root@crfclient01 ~]# ssh 172.10.1.30 \\Last login: Wed Dec 18 11:48:14 2013 from 172.10.1.9 Sacewalk kickstart on 2010 08 23 [root@sessionmgr02 ~]# 7. Find the disk size with the Fixed Disk (fdisk) command for the PV Name you wrote down in Section 1 Ste 2. Record the disk size. For examle, Disk Size: 75.0 GB. # fdisk l /dev/sda Disk Size: This samle shows outut for the fdisk l /dev/sda command: [root@sessionmgr02 ~]# fdisk l /dev/sda Disk /dev/sda2: 75.0 GB, 75047454720 bytes 255 heads, 63 sectors/track, 9124 cylinders

This examle outut shows that /dev/sda2 currently has 75G allocated to it. Section 5 Add the new sace to the artition 1. In order to resize the artition, enter the fdisk command and use the PV Name (from Section 1 Ste 2) without the number on the end. # fdisk <v_name without the number on the end> This samle shows outut for the fdisk /dev/sda command: [root@sessionmgr02 ~]# fdisk /dev/sda The number of cylinders for this disk is set to 9137. There is nothing wrong with that, but this is larger than 1024, and could in certain setus cause roblems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and artitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for hel): 2. At the command romt, enter and ress Enter in order to view the artition table. Command (m for hel): This examle shows outut that shows the artition table after you tye the letter '': Command (m for hel): 255 heads, 63 sectors/track, 9137 cylinders Command (m for hel): 3. Record the Start and Id values for the artition that you want to resize. For examle, from the examle outut in Ste 2, Start: 14 Id: 8e. Start: Id: 4. Delete the Partition entry for the device you want to resize. Enter d at the command romt. This examle shows the results after you enter d: 255 heads, 63 sectors/track, 9137 cylinders Partition number (1 4):

5. At the Partition number romt, enter the artition number you want to delete and ress Enter. (The number at the end of the Device name is the artition number.) Partition number (1 4): <number> This examle shows the results after you enter the artition number: 255 heads, 63 sectors/track, 9137 cylinders Command (m for hel): 6. At the Command romt, enter n in order to create a new artition. This examle shows the results after you enter n: 7. Enter for a rimary artition. Command (m for hel): This examle shows outut after you enter :

Partition number (1 4): 8. At the Partition number romt enter the artition number and ress Enter (same artition number as the one deleted). In this examle, the number is 2. This examle shows the results after you enter the artition number: First cylinder (14 9137, default 14): 9. Verify that the default value for the First cylinder number matches the Start value from Ste 3 of this Section. If it does, ress Enter in order to accet the default. If it does not match, ensure that it does not overla with any existing artitions then manually enter the value and ress Enter. This examle shows the results after you accet the default value and ress Enter: First cylinder (14 9790, default 14): Using default value 14 Last cylinder or +size or +sizem or +sizek (14 9790, default 9790): 10. For the Last cylinder value ress Enter in order to use the default value. This samle shows the results after you accet the default value and ress Enter:

11. First cylinder (14 9790, default 14): Using default value 14 Last cylinder or +size or +sizem or +sizek (14 9790, default 9790): Using default value 9790 Command (m for hel): At the Command romt, enter t and ress Enter. Command (m for hel): t This examle shows the results after you enter t: First cylinder (14 9790, default 14): Using default value 14 Last cylinder or +size or +sizem or +sizek (14 9790, default 9790): Using default value 9790 Command (m for hel): t Partition number (1 4): 12. At the Partition number romt, enter the artition number you want to resize and ress Enter. This examle shows the results after you enter the artition number:

13. First cylinder (14 9790, default 14): Using default value 14 Last cylinder or +size or +sizem or +sizek (14 9790, default 9790): Using default value 9790 Command (m for hel): t Hex code (tye L to list codes): At the Hex code romt, tye the hex code. This is the Id value from Ste 3 in this Section. Press Enter. Hex code (tye L to list codes): 8e This examle shows the results after you enter the hex code: First cylinder (14 9790, default 14): Using default value 14 Last cylinder or +size or +sizem or +sizek (14 9790, default 9790): Using default value 9790 Command (m for hel): t Hex code (tye L to list codes): 8e Changed system tye of artition 2 to 8e (Linux LVM) Command (m for hel): 14. At the Command romt, enter w in order to write the artition to the disk. Command (m for hel): w This examle shows the results after you enter w at the romt:

15. First cylinder (14 9790, default 14): Using default value 14 Last cylinder or +size or +sizem or +sizek (14 9790, default 9790): Using default value 9790 Command (m for hel): t Hex code (tye L to list codes): 8e Changed system tye of artition 2 to 8e (Linux LVM) Command (m for hel): w The artition table has been altered! Calling ioctl() to re read artition table. WARNING: Re reading the artition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. [root@sessionmgr02 ~]# This exits fdisk and takes you to the root romt. Reboot the VM in order to ensure the new settings match u with the kernel. # init 6 16. After the VM comletes the reboot (about 5 minutes) log into (ssh) the VM as root. 17. Check in order to ensure the disk size is now larger with the fdisk l <PV Name> command in order to view the new artition size (PV Name is from Section 1 Ste 2). [root@sessionmgr02 ~]# fdisk l /dev/sda Disk /dev/sda2: 80.4 GB, 80418562560 bytes 255 heads, 63 sectors/track, 9777 cylinders This examle outut shows that /dev/sda now has 80Gigabytes allocated to it. Section 6 Resize the Physical Volume Warning: This rocedure is somewhat RISKY. Use caution. 1. Enter the Physical Volume Resize (vresize) command followed by the PV Name in order to resize the artition to fit into the currently allocated disk sace. # vresize /dev/sda2 This examle shows the results after you enter the vresize command: [root@sessionmgr02 ~]# vresize /dev/sda2

Physical volume "/dev/sda2" changed 1 hysical volume(s) resized / 0 hysical volume(s) not resized 2. Enter the vgdislay command in order to check the Free PE Size to see the additional sace added. This examle shows the results after you enter the vgdislay command: [root@sessionmgr02 ~]# vgdislay Volume grou VG Name VolGrou00 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 9 VG Access read/write VG Status resizable MAX LV 0 Cur LV 4 Oen LV 4 Max PV 0 Cur PV 1 Act PV 1 VG Size 74.88 GB PE Size 32.00 MB Total PE 2396 Alloc PE / Size 1916 / 59.88 GB Free PE / Size 480 / 15.00 GB VG UUID PSNBU FRWO z3ac iaxs ewaw joft dtcbkd The examle shows the disk sace added in the revious section. Section 7 Extend the size of the Volume Grou in order to use the new sace 1. Enter the df command in order to locate the artition that needs more sace again in order to verify the information originally recorded in Section 1 Ste 1 is correct. Record the Filesystem and Mounted on values from the outut of the df command. # df h Filesystem: Mounted on: [root@sessionmgr02 ~]# df h Filesystem Size Used Avail Use% Mounted on /dev/maer/volgrou00 LogVol00 18G 2.4G 15G 15% / /dev/maer/volgrou00 LogVol02 5.7G 140M 5.3G 3% /home /dev/maer/volgrou00 LogVol03 30G 27G 1.5G 97% /data /dev/sda1 99M 40M 55M 43% /boot tmfs 16G 0 16G 0% /dev/shm tmfs 8.0G 1.1G 7.0G 13% /data/sessions.1 2. Write the amount of sace you need to add to the artition (same as Section 1 Ste 3). Disk Sace to Add <amount>:

3. Enter the Logical Volume Extend command (lvextend L+<amount>G <Filesystem>) in order to add the new disk sace (<amount> from Section 1 Ste 2) to the Filesystem that needs it (from Section 7 Ste 1). # lvextend L+5G /dev/maer/volgrou LogVol 03 This examle shows the results after you enter the lvextend command: [root@sessionmgr02 ~]# lvextend L+5G /dev/maer/volgrou00 LogVol03 Extending logical volume LogVol03 to 45.00 GB Logical volume LogVol03 successfully resized [root@sessionmgr02 ~]# This adds the newly added sace to the Logical Volume. Section 8 Resize the filesystem on the logical volume in order to use the new sace 1. Enter the Resize Filesystem command (resize2fs <Filesystem>) in order to resize the filesystem (from Section 1 Ste 1). This makes the additional disk sace available for use. Warning: This command may take some time to comlete. # resize2fs <filesystem> This examle shows the results after you enter the resize2fs command: [root@sessionmgr02 ~]# resize2fs /dev/maer/volgrou00 LogVol03 resize2fs 1.39 (29 May 2006) Filesystem at /dev/maer/volgrou00 LogVol03 is mounted on /data; on line resizing required Performing an on line resize of /dev/maer/volgrou00 LogVol03 to 11796480 (4k) blocks. The filesystem on /dev/maer/volgrou00 LogVol03 is now 11796480 blocks long. [root@sessionmgr02 ~]# 2. Enter the df h command in order to see if the disk sace is now available. # df h Examle results from entering the df h command: [root@sessionmgr02 ~]# df h Filesystem Size Used Avail Use% Mounted on /dev/maer/volgrou00 LogVol00 18G 2.4G 15G 15% / /dev/maer/volgrou00 LogVol02 5.7G 140M 5.3G 3% /home /dev/maer/volgrou00 LogVol03 44G 22G 21G 52% /data /dev/sda1 99M 40M 55M 43% /boot tmfs 16G 0 16G 0% /dev/shm tmfs 8.0G 4.0K 8.0G 1% /data/sessions.1 Udated: Jun 29, 2015 Document ID: 119025