Setting new instance with existing boot disk as previous ran out of memory

78 Views Asked by At

I'm hoping someone can help me on this.

I have filled up a server and now i can't get in it. Support gave me the following instructions (except miss out number 4) but I'm come to a halt.

I can't get the code to work. How do i find out my device ID and partition number?

  1. Stop VM (Original)
  2. Click edit into your instance (Detach the boot disk) then save
  3. then Create new VM
  4. Add the disk of original VM in new VM as (existing disk which is relay-3) then click create
  5. Then SSH to new VM
  6. Perform extend method(growpart) on the additional disk. Please follow this documentation[1]:

sudo growpart /dev/DEVICE_ID PARTITION_NUMBER

Note: Please skip the number 4 step and just follow the step 1 to 7.

  1. Then mount to a directory
  2. Then execute resize2fs to newly mounted filesystem

sudo resize2fs /dev/DEVICE_IDPARTITION_NUMBER

  1. Once successfully extended, unmount the filesystem
  2. Then Detach additional disk
  3. Then Re-attach it as boot disk in the original VM

Thanks

1

There are 1 best solutions below

3
On

For determining your device paths, use mount command (without other args), to get a list of mounted devices. Your root device is mounted to /, your home device (if other than root) is mounted to /home etc...

For listing more information about disk volumes, use sudo blkid. It gives you a list of disk devices and their UUIDs.

$ sudo blkid
/dev/sda1: UUID="62bd22ec-c451-4a95-8c36-d6669c677005" TYPE="ext4" PTTYPE="dos" PARTUUID="00006a5a-01"
/dev/sda2: UUID="68eed4f2-4b04-4f72-a340-acaf83226839" TYPE="swap" PARTUUID="00006a5a-02"
/dev/sdb1: UUID="93615346-58dc-4e5c-a3a9-2eb5017a09b3" TYPE="ext4" PARTUUID="d95b3f78-8a2b-49dc-af16-7a10d9c7ad16"