This sounds like a very basic question, but I have yet to find an answer for it.
I have a partition layout which looks like this:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 108G 0 disk
├─xvda1 202:1 0 46G 0 part /
├─xvda2 202:2 0 1K 0 part
└─xvda5 202:5 0 2G 0 part
└─cryptswap1 252:0 0 2G 0 crypt
xvde 202:64 0 1.5G 1 disk
└─xvde1 202:65 0 1.5G 1 part
xvdf 202:80 0 6G 1 disk
How can I grow the first partition xvda1 ? I only have remote command line only access to the server.
I tried using resize2fs but it seems to fail with a cryptic error
$ sudo resize2fs /
resize2fs 1.42.12 (29-Aug-2014)
open: Is a directory while opening /
EDIT: This is the result from gparted. Rebooting is not a problem, and I do have a backup ready (but I would prefer not to need it of course).
Command (m for help): p
Disk /dev/xvda: 108 GiB, 115964116992 bytes, 226492416 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: 0x000da796
Device Boot Start End Sectors Size Id Type
/dev/xvda1 2048 96452607 96450560 46G 83 Linux
/dev/xvda2 96454654 100661247 4206594 2G 5 Extended
/dev/xvda5 96454656 100661247 4206592 2G 82 Linux swap / Solaris
And the output of "sudo parted -l /dev/xvda"
bob@bob:~% sudo parted -l /dev/xvda
[sudo] password for bob:
Model: Linux device-mapper (crypt) (dm)
Disk /dev/mapper/cryptswap1: 2154MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags
1 0.00B 2154MB 2154MB linux-swap(v1)
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvda: 116GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 49.4GB 49.4GB primary ext3
2 49.4GB 51.5GB 2154MB extended
5 49.4GB 51.5GB 2154MB logical
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvde: 1611MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 4000kB 1611MB 1607MB primary ext3
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvdf: 6442MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags
1 0.00B 6442MB 6442MB ext3
/xvda
you'd also need access to the XenServer command line interface. Otherwise the most you may get is 2 GB from disabling swap (xvda5
). – Takkat Jan 26 '16 at 13:01xvda5
withinxvda2
... try to disableswap
. You then may be able to movexvda2
to the end ofxvda
in order to be able to growxvda1
. I have however no idea if Xen has some extra tools to make that more comfortanle. – Takkat Jan 26 '16 at 13:12sudo parted -l /dev/xvda
(orsudo parted -l
if the other doesn't work) to your question ([edit] it!). It will show us where the exact partition boundaries are and where the free space is located. Thanks. – Byte Commander Jan 26 '16 at 13:36xvda
drive. That means you need to movexvda2
(which containsxvda5
) to the end of the disk. To do that, first make sure they're both unmounted (and swap is off). Then growxvda2
to occupy all available space, movexvda5
inside it to the right border, and shrinkxvda2
again to its minimum size by moving its left border. Then you have about 60 GB space afterxvda1
. At this point, you can follow the linked question. – Byte Commander Jan 26 '16 at 14:05