How to increase XenServer virtual machine root or swap partition

Similar documents
Cloning and Repartitioning sessionmgr Disks

How to add additional disks to XenServer host

An introduction to Logical Volume Management

As this method focuses on working with LVM, we will first confirm that our partition type is actually Linux LVM by running the below command.

This section describes the procedures needed to add a new disk to a VM. vmkfstools -c 4g /vmfs/volumes/datastore_name/vmname/xxxx.

Changing user login password on templates

Back Up (And Restore) LVM Partitions With LVM Snapshots

Getting Started with Pentaho and Cloudera QuickStart VM

How To Resize ext3 Partitions Without Losing Data

Xen: How to Convert An Image-Based Guest To An LVM-Based Guest

Virtualization Provisioning & Centralized Management with iscsi. RACF Brookhaven National Laboratory James Pryor CHEP 2010

Red Hat Enterprise Linux 6 Server Instruction Guide for Creating Volume in Free Disk Space

Exam Name: Red Hat Certified Engineer on Redhat

jfield Documentation Release 1 Jason Field

Windows Method Using Linux Live CD and Gparted

Adding a block devices and extending file systems in Linux environments

Actual4Test. Actual4test - actual test exam dumps-pass for IT exams

Red Hat Enterprise Linux 5 Logical Volume Manager Administration. LVM Administrator's Guide Edition 1

LVM Administrator's Guide. Configuration and Administration 5.2

BT Cloud Compute. Adding a Volume to an existing VM running Linux. The power to build your own cloud solutions to serve your specific business needs

7. Try shrinking / -- what happens? Why? Cannot shrink the volume since we can not umount the / logical volume.

SCSI RDMA Protocol. Introduction. Configuring SRP CHAPTER

OPS235: Week 1. Installing Linux ( Lab1: Investigations 1-4)

Manage your disk space... for free :)

MFT / Linux Setup Documentation May 25, 2008

Detailed study on Linux Logical Volume Manager

RH202. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs) Exam.

CIS UNIX System Administration

OPS235: Week 1. Installing Linux ( Lab1: Investigations 1-4)

pv_path The block device path name of a physical volume.

Configure Windows Server 2003 Release 2 Server Network File Share (NFS) as an authenticated storage repository for XenServer

Quota LVM (Logical Volume Manager)

Disks, Filesystems Todd Kelley CST8177 Todd Kelley 1

If you need to pass extra parameters to the kernel, enter them at the prompt below after the name of the kernel to boot (huge.s etc).

Using IDS v10 on Linux Kernel 2.6

UUID and R1Soft. What is a UUID and what is it used for?

NVDIMM Overview. Technology, Linux, and Xen

The NetBSD Logical Volume Manager

Fedora 12 Essentials

DUAL OS INSTALLATION

makes floppy bootable o next comes root directory file information ATTRIB command used to modify name

Linux+ Guide to Linux Certification, Third Edition. Chapter 2 Linux Installation and Usage

3.5 Inch TFT Display

Partitioning and Formatting Guide

Using iscsi On Debian Lenny (Initiator And Target)

Lecture 29. Friday, March 23 CS 470 Operating Systems - Lecture 29 1

05. 5GB 7. cmd. VM E:\. ASM1.vdi 5GB Fixed / Shareable Data (shareable) Fixed Size. ASM2.vdi 5GB Fixed / Shareable. ASM3.vdi 5GB Fixed / Shareable

Linux System Administration, level 1. Lecture 4: Partitioning and Filesystems Part II: Tools & Methods

1. Set up the storage to allow access to the LD(s) by the server following the NEC storage user guides.

Red Hat Enterprise Linux 7

Build Your Own Oracle RAC 11g Release 2 Cluster on Red Hat 4 and iscsi

v5: How to restore a backup image

Disks & File Systems. Dick Gillman, ITSS. 1/19/06 10:20:11 am docs/disks.sxi

Volume Management in Linux with EVMS

iscsi storage is used as shared storage in Redhat cluster, VMware vsphere, Redhat Enterprise Virtualization Manager, Ovirt, etc.

The LILO Configuration Handbook. Virgil J. Nisly

File System Case Studies. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Exam Questions RH202

BTREE FILE SYSTEM (BTRFS)

A Frame Work for Virtual USB Devices under Linux Environment

Hard Drive Technologies

CIS 191A Final Exam. Fall CIS 191 Final Exam

RHEL 5 Essentials. Red Hat Enterprise Linux 5 Essentials

It is recommended to complete the tutorial using a web browser from the same operating system as your Putty or SSH client (e.g. Ubuntu terminal).

Creating A Virtual Machine for Microcosm

Author : admin. 1. Getting information about current file system partitions with fdisk and mount

VERITAS Volume Manager (VxVM) for HP-UX

CompTIA Linux+ Guide to Linux Certification Fourth Edition. Chapter 2 Linux Installation and Usage

File System Case Studies. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Production Installation and Configuration. Openfiler NSA

HP integrated Citrix XenServer 5.0 Release Notes

Red Hat Enterprise Linux 6

Soma s Installation Notes

for Cloud Computing University of Washington Tacoma Fall

Boot Process in details for (X86) Computers

Partitioning a disk prior to Linux Installation

Partitioning and Formatting Reference Guide

Testpassport.

CHAPTER 11: IMPLEMENTING FILE SYSTEMS (COMPACT) By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

The Contents and Structure of this Manual. This document is composed of the following ten chapters.

This is sometimes necessary to free up disk space on a volume that cannot have extra disk space easily added.

Disk Imaging with Knoppix

StorTrends - Citrix. Introduction. Getting Started: Setup Guide

Arch Linux with an SSD Cache using LVM on BCache. Jeremy Runyan

1Y0-A26 Citrix XenServer 6.0 Practice Exam

Installing Linux (Chapter 8) Note packet # 4. CSN 115 Operating Systems Ken Mead Genesee Community College. Objectives

Red Hat Enterprise Linux 4 Cluster Logical Volume Manager. LVM Administrator's Guide

A+ Guide to Managing and Maintaining your PC, 6e. Chapter 8 Hard Drives

A+ Guide to Hardware, 4e. Chapter 7 Hard Drives

CS370 Operating Systems

GRID SOFTWARE. DU _v4.6 January User Guide

8 ISSUE 02 SPECIAL EDITION. Installing opensuse Ready to get started? This article shows you how to install opensuse from the disc

Commands LVM information can be created, displayed, and manipulated with the following commands:

How to securely isolate Damn Vulnerable Linux with VirtualBox

Chapter 12: File System Implementation

This is Worksheet and Assignment 12. Disks, Partitions, and File Systems

File System Implementation. Sunu Wibirama

Slackware installation

-: Ronak Patel (Gozariya) :Windows XP installation

Ubuntu - How to Create Software RAID 1 in Ubuntu Linux - Tutorial

Transcription:

How to increase XenServer virtual machine root or swap partition When doing a standard Linux installation on a XenServer virtual machine, installation process typically allocates all of available virtual disk space to Linux file system and swap partitions. The size of virtual disk can easily be changed using XenCenter utility, but as neir partition table or file systems mselves are modified by XenCenter, guest system does not see new virtual disk size. This article describes how to safely change partitions. There are two scenarios: Linux system uses standard Linux partitions Linux system uses Logical Volume Manager (LVM) partitions The file system sits on top of a single block of data storage, such as a piece of harddisk or, in case of a XenServer virtual machine, a virtual block device. It can only be as large as this storage block, but not larger. Therefore, if file system is to be increased, this storage block must be increased first. After size of storage block has been increased, execute resize2fs command, which can be safely run even on a mounted filesystem. It is very simple to increase size of underlying storage block if you are using LVM (and this is a good reason to always use LVM). Just add more blocks to it using lvresize command. The blocks added to storage block are taken from current volume group. If volume group does not have free block, new blocks must be made available by adding a new physical device such as a second harddisk, or by increasing an existing physical device. Provide more disk space to guest system There are two ways to do this: you could eir increase size of existing XenServer virtual disk, or add a second virtual disk to this guest. Add a physical device (todo) Increase size of an existing XenServer virtual device The XenCenter administration software provides a dialog to change size of XenServer virtual disk. Select new storage size by entering value in dialog. The virtual disk will be resized to new value. When increasing size, data on disk is preserved. Note: do not decrease size without decreasing file system first. Orwise file system will be damaged. Increa sing size of XenS erver virtual disk size does not chang e filesys tem on that disk. So new disk

system must be extended (to use extra space). space is not yet visible to user. To use new disk space, partiti on table must be modifi ed (which makes new device size known to file syste m) and file The easiest way to do this is delete last partition and create it again which will n use all of remaining disk space by default. Obviously, this will work only if last partition is in fact partition that is to be increased. In example below, XenServer virtual disk size has been resized from 10 GByte to 50 GByte. The following steps will be performed with fd isk: print old partitions delete last partition (#2) create new partition using default settings (use whole virtual disk for this partition) set partition type to LVM print partitions settings again, note increased size for partition #2 reboot master:~# fdisk /dev/xvda The number of cylinders for this disk is set to 6527. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from or OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/xvda: 53.6 GB, 53687091200 bytes <-- note that fdisk already sees new device size of 53.6 GB 255 heads, 63 sectors/track, 6527 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x0004e475

Device Boot Start End Blocks Id System /dev/xvda1 * 1 31 248976 83 Linux /dev/xvda2 32 1305 10233405 8e Linux LVM <-- note that existing entry is still 10 GB Command (m for help): d Partition number (1-4): 2 Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 2 First cylinder (32-6527, default 32): Using default value 32 Last cylinder or +size or +sizem or +sizek (32-6527, default 6527): Using default value 6527 Command (m for help): t Partition number (1-4): 2 Hex code (type L to list codes): 8e Changed system type of partition 2 to 8e (Linux LVM) Command (m for help): p Disk /dev/xvda: 53.6 GB, 53687091200 bytes 255 heads, 63 sectors/track, 6527 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x0004e475 Device Boot Start End Blocks Id System /dev/xvda1 * 1 31 248976 83 Linux /dev/xvda2 32 6527 52179120 8e Linux LVM <-- note that new entry is now 50 GB Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading partition table failed with error 16: Device or resource busy. The kernel still uses old table. The new table will be used at next reboot. Syncing disks. master:~# reboot Broadcast message from root@master (pts/0) (Fri Oct 2 08:47:05 2009):

The system is going down for reboot NOW! Tell LVM of new resized physical volume The partition #2 has now successfully increased in size, now let LVM use new blocks. Note how "Free PE" value increases after pvre size command. pvdisplay --- Physical volume --- PV Name /dev/xvda2 PV Size 9.76 GB / not usable 1.37 MB Allocatable yes (but full) PE Size (KByte) 4096 Total PE 2498 Free PE 0 Allocated PE 2498 PV UUID 7TyUyk-hyVf-0kdC-OCok-QdSJ-lqTE-YFJAi0 master:~# pvresize /dev/xvda2 Physical volume "/dev/xvda2" changed 1 physical volume(s) resized / 0 physical volume(s) not resized master:~# pvdisplay --- Physical volume --- PV Name /dev/xvda2 PV Size 49.76 GB / not usable 3.98 MB Allocatable yes PE Size (KByte) 4096 Total PE 12738 Free PE 10240 Allocated PE 2498 PV UUID 7TyUyk-hyVf-0kdC-OCok-QdSJ-lqTE-YFJAi0 Resize logical volume The next step is to add those new blocks to logical volume. The volume group now has an extra 10240 free extents (each 4 KByte in size). New storage can be added to a logical volume with lvresize command. # vgdisplay --- Volume group --- System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 8 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 49.76 GB PE Size 4.00 MB Total PE 12738 Alloc PE / Size 2498 / 9.76 GB Free PE / Size 10240 / 40.00 GB VG UUID ncjl0f-xwps-g77z-oq0t-lmec-ulsj-2qfunw master:~# lvdisplay --- Logical volume --- LV Name /dev//root LV UUID QejNO3-8bB0-ykJ0-TUhR-56Ko-W5ed-SvF9fv LV Write Access read/write LV Status available # open 1 LV Size 7.76 GB Current LE 1986 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 254:0 master:~# lvresize -l +10240 /dev//root Extending logical volume root to 47.76 GB Logical volume root successfully resized master:~# vgdisplay --- Volume group --- System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 11 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 1 Max PV 0 Cur PV 1 Act PV 1 VG Size 49.76 GB PE Size 4.00 MB Total PE 12738 Alloc PE / Size 12738 / 49.76 GB

Free PE / Size 0 / 0 VG UUID ncjl0f-xwps-g77z-oq0t-lmec-ulsj-2qfunw Resize file system The last step is to resize file system. This can be done even when file system is currently in use. However, a reboot is recommended as massive changes have been made to file system. During reboot, a file system check is executed which will print out a scary warning message but that's normal. The system will reboot again and this time no messages or warnings should be sent. master:~# resize2fs /dev//root resize2fs 1.41.3 (12-Oct-2008) Filesystem at /dev//root is mounted on /; on-line resizing required old desc_blocks = 1, new_desc_blocks = 3 Performing an on-line resize of /dev//root to 12519424 (4k) blocks. The filesystem on /dev//root is now 12519424 blocks long. master:~# reboot Broadcast message from root@master (pts/0) (Fri Oct 2 08:47:05 2009): The system is going down for reboot NOW!