I need to increase an Ubuntu partition, in a Xen environment. Through XenCenter, I increased the disk, from 10GB to 100 GB. Now I can see "xvda" size 100 GB. For reasons I don't know, in xvda, I have: xvda1, xvda2, xvda5 The root (/) is in xvda5, together with a swap. Follows my fdisk command:
Disk /dev/xvda: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x69465e7c
Device Boot Start End Sectors Size Id Type
/dev/xvda1 * 2048 999423 997376 487M 83 Linux
/dev/xvda2 1001470 20969471 19968002 9.5G 5 Extended
/dev/xvda5 1001472 20969471 19968000 9.5G 8e Linux LVM
Disk /dev/xvdd: 1.8 TiB, 1988569858048 bytes, 3883925504 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/xvdb: 1.8 TiB, 1988569858048 bytes, 3883925504 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/ubuntuservermain--vg-root: 8.5 GiB, 9126805504 bytes, 17825792 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/ubuntuservermain--vg-swap_1: 1020 MiB, 1069547520 bytes, 2088960 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
What are the commands I need? I tried solutions taken on the web and stack exchange, without luck. There is a command I found growpart that seems perfect for my needs, but it doesn't seem to work.
As requested, I add the results of another command, lsblk:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 67.8M 0 rom
xvda 202:0 0 100G 0 disk
├─xvda1 202:1 0 487M 0 part /boot
├─xvda2 202:2 0 1K 0 part
└─xvda5 202:5 0 9.5G 0 part
├─ubuntuservermain--vg-root 252:0 0 8.5G 0 lvm /
└─ubuntuservermain--vg-swap_1 252:1 0 1020M 0 lvm [SWAP]
xvdb 202:16 0 1.8T 0 disk
xvdd 202:48 0 1.8T 0 disk
I wrote a script that I am using to show the commands to resize volumes.
In your case you will need to:
pvresize
.lvresize --resizefs --size +1G
(to add 1GB to root volume).The script will generated the proper commands for your environment. The resize is possible to be done online, without stopping any application or unmounting any file system.
Download the script and run it:
Add the output to the question and I can explain the generated output.