I have created an Ansible playbook, which performs the following tasks:
- Create an EBS volume.
- Attach the volume to an existing EC2 instance.
Mount the volume in the instance.
- name: Creating a Volume hosts: all sudo: yes tasks: - name: Creating a Volume ec2_vol: aws_access_key: "{{ lookup('env', 'AWS_ACCESS_KEY_ID') }}" aws_secret_key: "{{ lookup('env', 'AWS_SECRET_ACCESS_KEY') }}" instance: 'i-7edebfdb' volume_size: 5 device_name: /dev/xvdf region: 'ap-northeast-1' volume_type: gp2 register: ec2_vol - name: Printing the volume information debug: var=ec2_vol - name: mounting the volume mount: name=/mnt fstype=ext4 state=mounted src=/dev/xvdf
But when I executed the playbook, received the following error.
failed: [172.30.1.237] => {"failed": true}
msg: Error mounting /mnt: mount: wrong fs type, bad option, bad superblock on /dev/xvdf,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
When I perfromed fdisk -l
I can see the volume. But it is not mounted.
In dmesg
there is can see the error message
Can't find ext4 filesystem
How to resolve this issue.