2

i am facing connectivity issues with my AWS EC2 instance after resizing its volume. Here's what I did:

I had an EC2 instance running Ubuntu in a container with a full storage. I modified the volume to a larger size. Followed the steps in this link

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html[link][1]

to resize the disk. After resizing, I encountered an error while trying to run sudo:

sudo: unable to resolve host ip-xxx-xx-xx-xx: Name or service not known

A user in a forum suggested that it might be due to the full disk issue, which I had recently faced.

To resolve this, I rebooted the instance from the AWS console. However, after the reboot, I am unable to connect to the instance either through SSH or AWS console connect.

Interestingly, I created a new instance using the same security group, and it works perfectly. But, I still can't connect to the old instance.

Any insights into what might be causing this issue and how to resolve it would be greatly appreciated.

Shaugi
  • 131

2 Answers2

1

I manage to solve the issue with this steps :

  • Delete unnecessary file

Since the original issue was caused by a full disk, the first step was to reduce the storage usage. A new EC2 instance was created, and the original volume was attached as a secondary volume.

  • Connect to new instance

Connect to the new instance using SSH or AWS console connect.

  • Delete unnecessary files

Once connected to the new instance, identify and delete unnecessary files from the original volume to free up space.

  • Reattach volume to old instance

After freeing up space, detach the volume from the new instance and reattach it to the old instance.

  • Connect to old instance

Attempt to connect to the old instance again. This time it should work without any issues.

Shaugi
  • 131
0

There is a possibility that something is broken. You could try to attach Volume to another instance or restore from backups.

To attach to a new EC2 instance steps should be as follows:

  • create a new ec2 instance
  • stop non working one
  • detach the volume (write the id somewhere)
  • attach the volume to the new instance
  • check with fdisk -l if you can see the volume
  • mount on the new ec2 instance
  • copy data or fix (or find somebody to fix the issue)

make sure that stopping the instance does not terminate it

Martynas
  • 1,287