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
질문됨 10달 전357회 조회
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
전문가
답변함 10달 전
profile pictureAWS
전문가
검토됨 10달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠