我正在检查ec2-instance (centos-7)内的映射卷。我已经将两个500 GB的卷附加到一个ec2实例,但我找不到哪个卷映射了哪个磁盘名称。
磁盘名称显示为/dev/nvme3n1 and /dev/nvme5n1,但亚马逊网络服务控制台显示为/dev/sde /dev/sdd
fdisk -l和aws ec2 describe-volumes .. device_names是不同的。有没有办法找出哪个卷映射到哪个设备名称?
fdisk -l
[root@ip-192-168-66-22 deploy]# fdisk -l
Disk /dev/nvme3n1: 536.9 GB, 536870912000 bytes, 1048576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/nvme5n1: 536.9 GB, 536870912000 bytes, 1048576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesAWS客户端结果
aws ec2 describe-volumes --filters Name=attachment.instance-id,Values=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
{
"AvailabilityZone": "eu-central-1a",
"Attachments": [
{
"AttachTime": "2021-10-06T14:24:28.000Z",
"InstanceId": "i-sss",
"VolumeId": "vol-ss",
"State": "attached",
"DeleteOnTermination": false,
"Device": "/dev/sde"
}
],
"Tags": [
{
"Value": "Disk1",
"Key": "Name"
}
],
"Encrypted": false,
"VolumeType": "gp2",
"VolumeId": "vol-ss",
"State": "in-use",
"Iops": 1500,
"SnapshotId": "",
"CreateTime": "2021-10-06T14:24:28.872Z",
"Size": 500
},
{
"AvailabilityZone": "eu-central-1a",
"Attachments": [
{
"AttachTime": "2021-10-06T14:24:28.000Z",
"InstanceId": "i-ss",
"VolumeId": "vol-yy",
"State": "attached",
"DeleteOnTermination": false,
"Device": "/dev/sdd"
}
],
"Tags": [
{
"Value": "Disk-2",
"Key": "Name"
}
],
"Encrypted": false,
"VolumeType": "gp2",
"VolumeId": "vol-yy",
"State": "in-use",
"Iops": 1500,
"SnapshotId": "",
"CreateTime": "2021-10-06T14:24:28.963Z",
"Size": 500
},发布于 2021-10-22 09:10:32
您可以将其中一个卷增加1 GB,以区分这两个卷
https://stackoverflow.com/questions/69674213
复制相似问题