New volume created for EC2 when I stop / start

0

I created an EC2 instance, T2.nano, and had some files stored in it at the /home/ubuntu/folderA directory. I then stopped this instance because we do not have any running applications in it. After a few days, i turn it back on, and found out that all my files are gone. my /home/ubuntu/ directory is empty.

After some investigation, I noticed that this instance now has 2 attached volume: 2 volumes attached

Then i also found out that 1 of the volume is not mounted. result of sudo lsblk -f:

NAME     FSTYPE LABEL           UUID                                 FSAVAIL FSUSE% MOUNTPOINT
loop0                                                                      0   100% /snap/amazon-ssm-agent/7628
loop1                                                                      0   100% /snap/core18/2790
loop2                                                                      0   100% /snap/core20/2015
loop3                                                                      0   100% /snap/lxd/24061
loop4                                                                      0   100% /snap/snapd/20290
xvda                                                                                
├─xvda1  ext4   cloudimg-rootfs                                         5.5G    28% /
├─xvda14                                                                            
└─xvda15 vfat   UEFI                                                       
xvdf                                                                                
├─xvdf1  ext4   cloudimg-rootfs 
├─xvdf14                                                                            
└─xvdf15 vfat   UEFI                                                   98.3M     6% /boot/efi

I then proceed to mount the /dev/xvdf1 volume at /data, following this guide: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html and I can see my files at /data/home/ubuntu/folderA.

my questions are:

  1. I don't recall specifying 2 volumes for this instance when creating it. why did it create the new volume?
  2. Why did it make the "new" volume as the root device?
  3. Why did it not auto mount the "original" volume?
Harith
質問済み 5ヶ月前276ビュー
1回答
1

Hello.

I don't recall specifying 2 volumes for this instance when creating it. why did it create the new volume?

Maybe you added EBS by mistake when creating EC2?
It will be added by clicking "Add new volume" as shown below when creating EC2 from the management console.
You may also be able to check when EBS was added from CloudTrail's API history.
a

Why did it make the "new" volume as the root device?

It is unclear why the home directory was created in the added EBS, but if you check the system logs when EC2 was created, you may be able to find out something.

Why did it not auto mount the "original" volume?

To automatically mount the added EBS volume, you need to add settings to "/etc/fstab".
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html#ebs-mount-after-reboot

profile picture
エキスパート
回答済み 5ヶ月前
profile pictureAWS
エキスパート
レビュー済み 5ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ