简体   繁体   English

将EBS卷附加到EC2实例

[英]attach EBS volume to EC2 instance

I create a Linux Amazon Instance with default 8G EBS volume. 我使用默认的8G EBS卷创建了一个Linux Amazon实例。 After that, I create a new 20G EBS volume and mount it to /mnt/my-data . 之后,我创建一个新的20G EBS卷并将其安装到/mnt/my-data

When I run $ df -h . 当我运行$ df -h It's show: 显示:

/dev/xvda1 7.9G Mounted on /
/dev/xvdf  20G  Mounted on /mnt/my-data

I am very new with Linux, so I just want to know: 我对Linux非常陌生,所以我只想知道:

  1. The folder /mnt/my-data can hold the file with maximize volume is 20G or 28G ? /mnt/my-data文件夹可以容纳最大容量为20G or 28G的文件?
  2. The folder /var can hold the file with maximize volume is 8G or 28G ? /var文件夹可以容纳最大容量为8G或28G的文件?
  3. Now I want to mount /dev/xvdf to /var , what should I do? 现在我想将/dev/xvdf/var ,该怎么办?

Thanks so much! 非常感谢!

The folder /mnt/my-data can hold the file with maximize volume is 20G or 28G ? / mnt / my-data文件夹可以容纳最大容量为20G或28G的文件?

20GB. 20GB。 what you see is what you get. 你所看到的就是你得到的。 (in fact a little less than 20GB as some space will be eaten up by filesystem metadata (实际上不到20GB,因为文件系统元数据会占用一些空间

The folder /var can hold the file with maximize volume is 8G or 28G ? / var文件夹可以容纳最大容量为8G或28G的文件?

8GB. 8GB。 again same reasoning as above 再次与上述相同

Now I want to mount /dev/xvdf to /var, what should I do? 现在我想将/ dev / xvdf挂载到/ var,该怎么办?

umount from /mnt/my-data and the mount it on /var. 从/ mnt / my-data umount ,然后将其挂载到/ var。 By doing this , you will lose all the stuff you have in /var. 这样,您将丢失/ var中拥有的所有内容。

cd /
umount /mnt/my-data
mount /dev/xvdf /var

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM