AWS EBS snapshot mount failure for XFS filesystem due duplicate UUID

ismail yenigül
2 min readNov 16, 2018

--

I am taking daily EBS snapshot backups with a lamba function at https://github.com/osiegmar/aws-lambda-backup

There was a problem with one of my instance due AWS CodeDeploy. I changed location of deployment directory in the appspec.yml and triggered a new deploy from BitBucket web console. Unfortunately, AWS CodeDeploy deleted all files from old apache web directory. I had to run another version of site in the old directory. I restored files in git repo from previous deployment zip in the s3 bucket and changed apache virtualhost DocumentRoot with a different path then I deleted remainig files in the previous directory.

Later I remembered that there were some files which is not exist in git repo in deleted directory. So I had to restore from last snapshot.

I created a new volume from the last working snaphot and I attached to the prod instance. When I try to mount second disk,I got the following error:

# mount /dev/nvme1n1p1 /disk
mount: /disk: wrong fs type, bad option, bad superblock on /dev/nvme1n1p1, missing codepage or helper program, or other error.

The error was fearful 😨. But no worries 😃. It is about XFS UUID checks.

when create volume from snapshot for an XFS partition, xfs duplicates UUID’s and XFS doesn’t allow multiple volumes to be mounted with the same UUID.

#blkid
/dev/nvme0n1: PTUUID=”d644e4b4–1955–43e3-bbbb-5773780bdee7" PTTYPE=”gpt”
/dev/nvme0n1p1: LABEL=”/” UUID=”e9c3e7c2-e039–4b2b-9991–955a8c7cd8c0" TYPE=”xfs” PARTLABEL=”Linux” PARTUUID=”a9e8ddc6-e4df-44e6–8c06-a8b069a67bb9"
/dev/nvme0n1p128: PARTLABEL=”BIOS Boot Partition” PARTUUID=”a5db01cb-186e-474d-a97a-90dc0be8f062"
/dev/nvme1n1: PTUUID=”d644e4b4–1955–43e3-bbbb-5773780bdee7" PTTYPE=”gpt”
/dev/nvme1n1p1: LABEL=”/” UUID=”e9c3e7c2-e039–4b2b-9991–955a8c7cd8c0" TYPE=”xfs” PARTLABEL=”Linux” PARTUUID=”a9e8ddc6-e4df-44e6–8c06-a8b069a67bb9"
/dev/nvme1n1p128: PARTLABEL=”BIOS Boot Partition” PARTUUID=”a5db01cb-186e-474d-a97a-90dc0be8f062"

You can force it to mount without verifying the UUID uniqueness:

# mount -o nouuid /dev/nvme1n1p1 /path/to/mount

--

--

ismail yenigül
ismail yenigül

Written by ismail yenigül

CKA/CKAD,AWS certified Freelancer DevOps Engineer

Responses (1)