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