Skip to content

Create Space on Target

rossphilipson edited this page Oct 22, 2014 · 5 revisions

Create a little space on target

This works within the 1G that is spare on a default install.

 df -h
 lvresize -L +1G  /dev/xenclient/root 
 resize2fs -p /dev/xenclient/root
 df -h

Create a lot of space on target

This is for when you need more expansion than will fit in the spare room of the install.

Stop xenmgr so nobody use storage anymore:

$ /etc/init.d/xenmgr stop

$ umount /storage

Resize storage filesystem (shrink it to 100G):

$ e2fsck -f /dev/xenclient/storage

$ resize2fs /dev/xenclient/storage 100G

Make the storage lv 101G to be on the safe side:

$ lvresize /dev/xenclient/storage -L101G

Remount storage and restart xenmgr:

$ mount /storage

$ /etc/init.d/xenmgr start

Make more space on root (10G):

$ lvresize /dev/xenclient/root -L10G

Do the online resize in the background:

$ resize2fs /dev/xenclient/root &

df will tell you live how big root is:

$ df -h

NOTE: it takes a while for the root resize. Don't start installing packages etc. until it is done.

Here it is as a script

 # Stop xenmgr so nobody use storage anymore:
 /etc/init.d/xenmgr stop
 umount /storage
 # Resize storage filesystem (shrink it to 100G):
 e2fsck -f /dev/xenclient/storage || exit 1
 resize2fs /dev/xenclient/storage 100G || exit 1
 # Make the storage lv 101G to be on the safe side:
 lvresize /dev/xenclient/storage -L101G
 # Remount storage and restart xenmgr:
 mount /storage
 /etc/init.d/xenmgr start
 # Make more space on root (10G):
 lvresize /dev/xenclient/root -L10G
 # Do the online resize in the background:
 resize2fs /dev/xenclient/root &
 # df will tell you live how big root is:
 df -h

Clone this wiki locally