Why does attaching a non-root EBS drive created from a snapshot not maintain the partitions?

0

When I create a snapshot of an auxiliary RHEL8 EC2 root volume, I can then create a new EBS device from the snapshot. I have a need to attach the new available EBS snapshot as a secondary drive on my running RHEL8 EC2 instance. When I attach the EBS drive created from the snapshot, I'm seeing the root partition is no longer present on the disk. Here is a look at the lsblk configuration after attaching the secondary disk:

[root@ip-172-31-76-220 ec2-user]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
nvme0n1     259:0    0   10G  0 disk
├─nvme0n1p1 259:2    0  200M  0 part /boot/efi
├─nvme0n1p2 259:3    0  512M  0 part /boot
└─nvme0n1p3 259:4    0  9.3G  0 part /
nvme1n1     259:1    0   10G  0 disk

Please note, /dev/nvme1n1 disk has no partitions, when this drive was created from a RHEl8 root device. I'm expecting at least one partition with the root OS present.

If I create a new auxiliary RHEL8 instance, stop the instance and detach the drive, I can then attach the available drive to my running EC2 instance and am able to see the OS partitions as expected. In the following lsblk config, the /dev/nvme2n1 disk retains the OS disk partitions.

[root@ip-172-31-76-220 ec2-user]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
nvme0n1     259:0    0   10G  0 disk
├─nvme0n1p1 259:2    0  200M  0 part /boot/efi
├─nvme0n1p2 259:3    0  512M  0 part /boot
└─nvme0n1p3 259:4    0  9.3G  0 part /
nvme1n1     259:1    0   10G  0 disk
nvme2n1     259:6    0   10G  0 disk
├─nvme2n1p1 259:7    0  200M  0 part
├─nvme2n1p2 259:8    0  512M  0 part
└─nvme2n1p3 259:9    0  9.3G  0 part
  • can you check. entries in fstab before and after to validate the issue

  • I'm not at the point of manipulating or saving information in fstab, but here is a look at the fstab before and after the attachment of the disk:

    [ec2-user@ip-172-31-78-116 tmp]$ cat /etc/fstab UUID=4df66650-964a-4178-b95f-97717f4059a5 /boot xfs defaults 0 0 UUID=b2de97b2-9d86-42ff-94f2-ed2c0bc1d661 / xfs defaults 0 0 UUID=7B77-95E7 /boot/efi vfat defaults,uid=0,gid=0,umask=077,shortname=winnt 0 2

    Looks like it is only holding entries for the root block device, which doesn't seem unexpected at this time.

  • And parted doesn't seem to know anything about the drive either: [ec2-user@ip-172-31-78-116 tmp]$ sudo parted /dev/nvme2n1 GNU Parted 3.2 Using /dev/nvme2n1 Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) p Error: /dev/nvme2n1: unrecognised disk label Model: NVMe Device (nvme) Disk /dev/nvme2n1: 21.5GB Sector size (logical/physical): 512B/4096B Partition Table: unknown Disk Flags:

asked a year ago513 views
2 Answers
0
Accepted Answer

Dag nab it, thanks for the response. After taking a few days away from the issue, I started looking at the creation of the EBS device script again with fresh eyes and noticed I was omitting the snapshot-id option. So it was indeed creating a blank EBS device. After adding the snapshot-id option, I'm seeing the partitions present as expected.

answered a year ago
0

Hello, thank you for your post. I understand you have created a snapshot of a root volume of a RHEL 8 EC2 instance. You then created a new EBS volume from the snapshot and then attached the new EBS volume to a RHEL 8 EC2 instance as a secondary volume. After this, lsblk does not show any partitions on the new EBS volume, even though there were multiple partitions originally.

I was unable to reproduce this issue when following the same procedure.

I launched a new EC2 instance using a RHEL 8 AMI, then created a snapshot of its root volume. From the snapshot I created a new EBS volume. I then launched a new EC2 instance using a RHEL 8 AMI again, and attached the EBS volume from the previous step. When I ran the lsblk command, I was able to see that all of the original partitions were present and visible for the secondary volume:

# lsblk
NAME        MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme0n1     259:0    0  10G  0 disk
├─nvme0n1p1 259:1    0   1M  0 part
└─nvme0n1p2 259:2    0  10G  0 part /
nvme1n1     259:3    0  10G  0 disk
├─nvme1n1p1 259:4    0   1M  0 part
└─nvme1n1p2 259:5    0  10G  0 part

I encourage you to open a support case so that one of our support engineers can inspect the details of the specific snapshot and EBS volume in question, and provide further assistance with this issue.

AWS
SUPPORT ENGINEER
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions