I have a VPS which was installed by my hosting provider. Recently I ran out of space on the original 100GB drive and so they have now allocated an additional 100GB drive to me.
I would like to expand the partition over the new drive so that the server thinks it has a 200GB drive at its disposal.
I have done a number of searches and lots of guides talk about setting up LVMs. I'm not sure whether this applies to me because I have no idea how my server was originally partitioned.
The server is running Ubuntu 16.04 LTS. I only have SSH access to it.
Here is some output that may be relevant:
parted
:
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print all
Model: Msft Virtual Disk (scsi)
Disk /dev/sda: 107GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 538MB 537MB fat32 EFI System Partition boot, esp
2 538MB 1038MB 500MB ext4
3 1038MB 3038MB 2000MB linux-swap(v1)
4 3038MB 107GB 104GB ext4
Model: Msft Virtual Disk (scsi)
Disk /dev/sdb: 107GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 107GB 107GB primary ext3
I do know that /dev/sdb
is the new drive and it is entirely empty and unused. The partition was created just while fiddling. If it needs to be deleted/erased/removed, it can be easily.
fdisk -l
:
Disk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 03D5D2D0-6699-4DC6-9D52-986BC6F711FC
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 2027519 976896 477M Linux filesystem
/dev/sda3 2027520 5933055 3905536 1.9G Linux swap
/dev/sda4 5933056 209713151 203780096 97.2G Linux filesystem
Disk /dev/sdb: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x82a7d10f
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 209715199 209713152 100G 83 Linux
This guide talks about volume groups. When I run vgdisplay
nothing displays. Many other guides use gparted, which of course, I don't have access to over SSH.
I imagine that this is not a difficult issue to solve, but being inexperienced with partitioning drives in Linux and in a VPS environment that I don't have any control over, I'm loathe to experiment without at least having some guidance from someone who knows what they are talking about.