Sign in
Categories
Your Saved List Become a Channel Partner Sell in AWS Marketplace Amazon Web Services Home Help

Reasonable, but block-device-mapping not working as expected

  • By Don
  • on 11/19/2019

Trying to launch via vagrant-aws using

aws.block_device_mapping = [ {'DeviceName' => '/dev/sda1',
'Ebs.VolumeSize' => CONF['ebs_volume_size'] } ]

which has worked in all other AMIs I've used. It allocates an EBS resource for /dev/sda1 but doesn't attach root filesystem to it:

$ df
Filesystem              1K-blocks    Used Available Use% Mounted on
.
.
.
/dev/mapper/centos-root   6486016 3043876   3442140  47% /
/dev/xvda1                1038336  202284    836052  20% /boot
.
.
.

It appears that the problem is that / is mapped to /dev/mapper/centos-root, which
maps to /dev/dm-0, but this is not considered a valid device name for mapping:

InvalidBlockDeviceMapping => Invalid device name /dev/dm-0



On the official AWS CentOS 7.6 AMI it's mounted as expected:

$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xvda1 15717356 1403480 14313876 9% /



  • By Andrew
  • on 12/04/2019

Sorry for you difficulties. This implementation is designed for those who are familiar with the CIS standard which recommends LVM for partitions. You cannot use an LVM as if it were a raw block device. Instead, use LVM commands. The links below show different ways of manipulating LVM volumes/disks. Use grub commands to make new root LVM disk bootable. https://www.tecmint.com/lvm-storage-migration/ or https://askubuntu.com/questions/161279/how-do-i-move-my-lvm-250-gb-root-partition-to-a-new-120gb-hard-disk