To move an EBS volume from one AWS region to another, you can't directly move it. Instead, you need to create an EBS snapshot of the volume, copy the snapshot to the target region, and then create a new EBS volume from the copied snapshot in the target region.
Yes, when you reboot an EC2 instance, the data in attached EBS volumes persists. EBS volumes are designed to be persistent, meaning they retain data even after the instance is stopped or restarted. This is different from instance store volumes, which loose data when the instance is stopped or terminated.
If you try to detach the root EBS volume while the instance is running, you'll get an error. Amazon EC2 doesn't allow detaching the root volume from a running instance, as this would cause the instance to immediately stop functioning. Detaching non-root volumes can lead to data loss if not done properly and can prevent the instance from accessing data on that volume.
When creating an EBS volume for an EC2 instance, best practices include using separate volumes for the operating system and data, regularly backing up data with snapshots, and ensuring the instance and volume throughput match. Encrypting EBS volumes and snapshots, using proper tagging, and optimizing costs by deleting unused volumes are also crucial.
To ensure an EBS volume persists when an EC2 instance is stopped and restarted, you need to configure the root volume's DeleteOnTermination attribute to False. By default, this attribute is set to True for root volumes, meaning they are deleted when the instance is terminated, but not when it's stopped. For other attached EBS volumes, the default DeleteOnTermination is False, so they will persist even when the instance is terminated.