For centralised backup purpose of specific data from my instances, i was using EBS Volume mounted to that instances. Now we are planning to migrate to another region, but EFS service is not available in that specific region. Is there any way i can use S3 as centralised backup by mounting it to EC2 instances.
3 Answers
You can mount S3 as a file system using S3fs. I'm not sure if it's production ready.
A better alternative could be running backup software on your instance that does incremental backup to S3. I use Restic for this, but note that it's not up to v1.0 yet, and it's missing compression but does de-duplication.
A better option I use for critical data is to use the aws s3 sync command to a version controlled S3 bucket. There's no compression or de-duplication, but it's reliable and safe. You can store in IA class and use a lifecycle policy to either delete old versions or move them to glacier to reduce costs.
![](../../users/profiles/306795.webp)
- 30,383
- 6
- 47
- 77
Storage Gateway will work, but you mind find it to be overkill for your purposes.
If all you are doing is backing up data you might be better served by setting up a nightly cron job to run the aws s3 sync /path/to/data s3://bucket/folder/
command to sync up whatever data you need directly to S3 without going through a mounted file share intermediary.
Couple that with versioning and lifecycle management on the bucket and you can build a fairly robust backup solution.
However, that being said, the best approach is not to store anything on the instances that needs to be backed up. Of course, that depends greatly on your specific use case.
![](../../users/profiles/145848.webp)
- 244
- 2
- 5
-
"not to store anything on the instances that needs to be backed up" - I'm amazed that never occurred to me. In hindsight, that is totally the right answer. – ToolmakerSteve Apr 05 '19 at 22:46
You can use AWS Storage Gateway that's backed up by S3 and can be used as iSCSI or SMB (aka Windows share). It can be deployed on AWS EC2: Deploying File Gateway on an Amazon EC2 Host
Hope that helps :)
![](../../users/profiles/122588.webp)
- 23,798
- 5
- 54
- 81