Amazon 中基于 EBS 的实例
我正在运行基于 Amazon EBS 的小型实例。
这就是我的文件系统的样子:
root@ip-10-49-37-195:~# df --all
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 8256952 1310196 6527328 17% /
proc 0 0 0 - /proc
none 0 0 0 - /sys
fusectl 0 0 0 - /sys/fs/fuse/connections
none 0 0 0 - /sys/kernel/debug
none 0 0 0 - /sys/kernel/security
none 847852 116 847736 1% /dev
none 0 0 0 - /dev/pts
none 852852 0 852852 0% /dev/shm
none 852852 60 852792 1% /var/run
none 852852 0 852852 0% /var/lock
/dev/sda2 153899044 192068 145889352 1% /mnt
我有以下问题:
Amazon 说小型实例可为您提供 160GD 的磁盘。看起来“/mnt”正是声明的空间。那么为什么我在 Amazon 管理控制台中看不到该磁盘,而只看到安装到根目录的小型 (8GB) 磁盘?
如果我终止/停止实例,/mnt 和 Root 中的数据会发生什么情况?
I'm running Amazon EBS based small instance.
This is how my file system looks like:
root@ip-10-49-37-195:~# df --all
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 8256952 1310196 6527328 17% /
proc 0 0 0 - /proc
none 0 0 0 - /sys
fusectl 0 0 0 - /sys/fs/fuse/connections
none 0 0 0 - /sys/kernel/debug
none 0 0 0 - /sys/kernel/security
none 847852 116 847736 1% /dev
none 0 0 0 - /dev/pts
none 852852 0 852852 0% /dev/shm
none 852852 60 852792 1% /var/run
none 852852 0 852852 0% /var/lock
/dev/sda2 153899044 192068 145889352 1% /mnt
I have following questions:
Amazon says that small instance gives you 160GD of disk. Looks like '/mnt' is exactly that declarated space. Then why I dont see that disk in Amazon Management Console, but only small (8GB) disk mounted to the Root?
What will happen with my data in /mnt and in Root if I terminate/stop an instance?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回答我自己的问题:
1. 160GD 的磁盘是实例磁盘,在终止或任何硬件故障后将会丢失。因此,如果您不想丢失数据,则应该考虑使用另一个 EBS 磁盘。
为什么不使用 8GD EBS 设备(默认安装在每个基于 EBS 的 Amazon 实例上)来存储数据(例如数据库)?因为在启动期间安装的所有 EBS 设备也将在终止后被删除。因此,您保存在 /mnt 或任何其他目录中的所有内容都将无法在终止或硬件故障中幸存。
有一个技巧。看起来如果您分离 /mnt (又名 /dev/sda2)然后将其附加回来,它在实例终止期间不会被删除。因为它会被标记为启动后附加。
2.它将被删除
Answering my own question:
1. 160GD of disk is a Instance disk which will be lost after termination or any hardware fall. So, you should consider using another EBS disk if you dont want to loose your data.
Why not to use 8GD EBS device (mounted by default with every EBS based Amazon instance) for storing data (e.g. databases)? Because all EBS devices mounted during launch will also be removed after termination. So, everything you save in /mnt or in any other directory will no survive termination or hardware fail.
There is a trick. Looks like if you detach /mnt (aka /dev/sda2) and then attach it back, it will not be deleted during instance termination. Because it will be marked as being attached after launch.
2. it will be removed