4.7 Upgrade EBS Volume Types - Lab2
Cont. Lab1
When you want to upgrade your volume, the basic steps has been shown in 4.6 Lab1. You need to aware that you'd better to stop your EC2 instance firstly, and then unmount the volume from mount point directory, then detach the volume from the instance, then create a snapshot for it, then create a new volume based on this snapshot, then attach this new volume to your EC2 instance, then start your instance again, then login to your instance and mount the volume to mount point directory. You can do these steps on the fly, but it is best practice to stop your instance first because it is going to be application consistent.
When you want to create file system on the volume (this could be done before or after you mount this volume to a specific mount point directory), you need to know that creating a new file system will actually wipe all data on the volume. You can use: file -s /dev/xvdf to check whether there is data on the volume or not. If there is data, you don't need to create a new file system.
Delete Instance
You can delete your EC2 instance, at the same time, the root volume will be deleted as well. For other volumes, you can go to Volumes and select the volumes and delete them. For the snapshots, you can also go to Snapshots and delete them.
Exam Tips
If your Amazon EBS volume is attached to an EC2 instance, you can increase its size, change its volume type, or adjust its IOPS performance, all without detaching instance.
EBS Volumes can be changed on the fly (except for Magnetic Standard). For the Magnetic Standard, we have to stop the EC2 instance firstly, then take a snapshot, then create a new volume from that snap and then we can change the volume type.
It is always best practice to stop the EC2 instance firstly and then change the volume.
You can change volume types by taking a snapshot and then using the snapshot to create a new volume.
If you change a volume on the fly you must wait for 6 hours before making another change. So when you are changing the volume type or when you are changing the volume size, if you do change the volume size you have to tell the file system to recheck the volume in order for it to see the new volume size. You can scale EBS volumes UP only, so you cannot scale down the size.
Volumes must be in the same AZ as the EC2 instances. If you want to migrate a volume to another AZ, you have to take a snapshot for it and then create a new volume at the destination AZ.
Last updated
Was this helpful?