We’ll start by detaching the EBS volume from the EC2 instance.
First, stop the web server with the following command:
sudo systemctl stop httpd
Then, unmount the volume from your EC2 instance:
sudo umount -d /dev/xvdf
Then, detach the volume from the instance as explained in “Step 2: Detach the volume from the instance” of these these instructions.
Once the volume is detached from the EC2 Instance, follow these instructions to delete the volume.