When I try to mount my Amazon Elastic Block Store (Amazon EBS) volume, I get the error: "root@:~# mount /dev/nvme2n1 /lv2mount: /lv2: wrong fs type, bad option, bad superblock on /dev/nvme2n1, missing codepage or helper program, or other error."
Resolution
When you mount your Amazon EBS volume, you get the following error because the UUID conflicts with the XFS file system:
"root@:~# mount /dev/nvme2n1 /lv2mount: /lv2: wrong fs type, bad option, bad superblock on /dev/nvme2n1, missing codepage or helper program, or other error."
First, confirm that you have a UUID conflict issue. Then, change the UUID of the file system or ignore the UUID check to resolve the issue.
Confirm that you have a UUID conflict issue
Complete the following steps:
-
Run the blkid command to check the UUID of the file system:
root@:~# blkid/dev/nvme0n1p1: LABEL="cloudimg-rootfs" UUID="ce780dbf-6f70-412d-87dd-61654730a231" TYPE="ext4" PARTUUID="bf0d338c-01"
.......
/dev/nvme1n1: UUID="2ddd89c4-415a-4aee-8431-abecdd8c79b8" TYPE="xfs"
/dev/nvme2n1: UUID="2ddd89c4-415a-4aee-8431-abecdd8c79b8" TYPE="xfs"
-
Check the Linux kernel ring buffer to confirm that it's a UUID conflict issue:
root@:~# dmesg | grep -i "Filesystem has duplicate UUID"
[ 5444.389157] XFS (nvme2n1): Filesystem has duplicate UUID 2ddd89c4-415a-4aee-8431-abecdd8c79b8 - can't mount
Ignore the UUID check, or change the UUID of one of the file systems
To change the UUID of one of the file systems, run the following command:
root@:~# xfs_admin -U $(cat /proc/sys/kernel/random/uuid) /dev/nvme2n1
Clearing log and setting UUID
writing all SBs
new UUID = 02f8750a-c482-4ed1-949c-4088f2ecc04a
root@:~# blkid
/dev/nvme0n1p1: LABEL="cloudimg-rootfs" UUID="ce780dbf-6f70-412d-87dd-61654730a231"
TYPE="ext4" PARTUUID="bf0d338c-01"
/dev/nvme1n1: UUID="2ddd89c4-415a-4aee-8431-abecdd8c79b8" TYPE="xfs"
/dev/nvme2n1: UUID="02f8750a-c482-4ed1-949c-4088f2ecc04a" TYPE="xfs"
root@:~# mount /dev/nvme2n1 /lv2
root@:~# df -h |grep lv2
/dev/nvme2n1 1014M 40M 975M 4% /lv2
Or, use the nouuid option to ignore the UUID check:
root@:~# mount -o nouuid /dev/nvme2n1 /lv2
root@:~# df -h |grep lv2
/dev/nvme2n1 1014M 40M 975M 4% /lv2