XenServer: Difference between revisions
Content added Content deleted
(→Adding Ubuntu VM free disk space: added) |
|||
Line 23: | Line 23: | ||
Now delete all partitions |
Now delete all partitions |
||
sudo fdisk /dev/xvda |
sudo fdisk /dev/xvda |
||
<pre> |
|||
Command (m for help): d |
|||
Partition number (1-5): 1 |
|||
Command (m for help): d |
|||
Partition number (1-5): 2 |
|||
</pre> |
|||
Now Create new partition and the Swap partition: |
|||
<pre> |
|||
Command (m for help): n |
|||
Partition type: |
|||
p primary (0 primary, 0 extended, 4 free) |
|||
e extended |
|||
Select (default p): p |
|||
Partition number (1-4, default 1): 1 |
|||
First sector (2048-31457279, default 2048): |
|||
Using default value 2048 |
|||
Last sector, +sectors or +size{K,M,G} (2048-31457279, default 31457279): 30410751 |
|||
Command (m for help): n |
|||
Partition type: |
|||
p primary (1 primary, 0 extended, 3 free) |
|||
e extended |
|||
Select (default p): p |
|||
Partition number (1-4, default 2): |
|||
Using default value 2 |
|||
First sector (30410752-31457279, default 30410752): |
|||
Using default value 30410752 |
|||
Last sector, +sectors or +size{K,M,G} (30410752-31457279, default 31457279): |
|||
Using default value 31457279 |
|||
</pre> |
|||
The primary partition is now correct but the swap partition is not. The type of the partition should not be “83” but “82” (marking it as a partition for the Linux swap) |
|||
<pre> |
|||
Command (m for help): p |
|||
Device Boot Start End Blocks Id System |
|||
/dev/xvda1 2048 30410751 15204352 83 Linux |
|||
/dev/xvda2 30410752 31457279 523264 83 Linux |
|||
Command (m for help): t |
|||
Partition number (1-4): 2 |
|||
Hex code (type L to list codes): 82 |
|||
Changed system type of partition 2 to 82 (Linux swap / Solaris) |
|||
Command (m for help): w |
|||
The partition table has been altered! |
|||
</pre> |
|||
Now reboot the VM: |
|||
shutdown -r now |
Revision as of 19:52, 21 December 2016
Increasing free disk space in Ubuntu VM
Source: vmotionhost.com
Increase disk size under Storage section in XenCenter.
Boot up the VM & log into it.
Verify Disk Space:
df -h
Check the partition layout
sudo fdisk -l /dev/xvda
To create new partitions, all old partiotions have to be deleted. To be able to delete the swap partitions the swap has to be turned off.
Verify Swap usage:
free -m
Turn off Swap disk
sudo swapoff -a
Now delete all partitions
sudo fdisk /dev/xvda
Command (m for help): d Partition number (1-5): 1 Command (m for help): d Partition number (1-5): 2
Now Create new partition and the Swap partition:
Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): 1 First sector (2048-31457279, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-31457279, default 31457279): 30410751 Command (m for help): n Partition type: p primary (1 primary, 0 extended, 3 free) e extended Select (default p): p Partition number (1-4, default 2): Using default value 2 First sector (30410752-31457279, default 30410752): Using default value 30410752 Last sector, +sectors or +size{K,M,G} (30410752-31457279, default 31457279): Using default value 31457279
The primary partition is now correct but the swap partition is not. The type of the partition should not be “83” but “82” (marking it as a partition for the Linux swap)
Command (m for help): p Device Boot Start End Blocks Id System /dev/xvda1 2048 30410751 15204352 83 Linux /dev/xvda2 30410752 31457279 523264 83 Linux Command (m for help): t Partition number (1-4): 2 Hex code (type L to list codes): 82 Changed system type of partition 2 to 82 (Linux swap / Solaris) Command (m for help): w The partition table has been altered!
Now reboot the VM:
shutdown -r now