I need my EC2 instance to create EBS snapshots of its attached volumes. To ensure a consistent snapshot, I want to use
fsfreeze requires the mount point.
I can use AWS APIs to obtain the list of attached EBS volumes and their device names, but the device names are listed as
/dev/sd[a-z][1-6] and Ubuntu (or Xen?) renames these to
/dev/xvd[a-z][1-6]. The AWS documentation says "in most cases, the trailing letter remains the same." I know I can get the mount point from the device name with
mount -l, but this obviously requires I have the correct device name (i.e. not
For a given set of EBS volume IDs (e.g. "vol-abc123"), how can I reliably determine their mount-point on the file system?
Edited to add a new thought: If the API gives me
/dev/sda1 and neither that nor
/dev/xvda1 exist, can I safely assume the first existing
/dev/xvd[b-z]1 will be the same volume?
Background: I'm running Ubuntu 14.04 LTS Server; the Kernel log talks about loading Xen virtual drivers, so I assume that's what AWS is using for the HVM virtualisation. My current situation is trivial (one EBS volume, mounted at
/), but I'd like the solution to work for more complex scenarios (multiple EBS volumes, including the presence of instance volumes—which won't need snapshots, but may be around while I'm taking snapshots).