Skip to content

Instantly share code, notes, and snippets.

@gtirloni
Created June 13, 2023 12:05
Show Gist options
  • Save gtirloni/cbd96ce1dfb118c94e63431ebb7a499d to your computer and use it in GitHub Desktop.
Save gtirloni/cbd96ce1dfb118c94e63431ebb7a499d to your computer and use it in GitHub Desktop.
mount-ec2-snapshot-same-server
  1. Locate the snapshot in EC2 > Snapshots
  2. Actions > Create volume from snapshot
  3. Locate the new volume in EC2 > Volumes
  4. Actions > Attach volume
  5. Confirm volume is attached to instance (ls -l /dev/nvme1*)
  6. Confirm volume has same UUID as the root disk (blkid)
  7. Change volume UUID to avoid conflicts (uuidgen && xfs_admin -U GENERATED_UUID_HERE /dev/nvme1n1p1)
  8. Confirm UUID was changed (blkdid)
  9. Mount filesystem (mount -t xfs /dev/nvme1n1p1 /mnt)

If step 7 complains about XFS log existing, run xfs_repair -L and retry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment