-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathREADME
More file actions
executable file
·43 lines (33 loc) · 1.72 KB
/
README
File metadata and controls
executable file
·43 lines (33 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
A FUSE filesystem for reflecting Amazon EC2 instance metadata (provided
via HTTP) into the VFS.
dependencies: FUSE/Python bindings ("python-fuse" or "fuse-python")
usage: ec2mdfs [-o subtree=path] /mountpoint
The subtree tells the filesystem what path under the EC2 metadata HTTP
service should be reflected at the mountpoint. The subtree specifies
an API version number, as well as allowing you to reflect only part of
the metadata. The default is "/latest", which gives the following:
$ ./ec2mdfs /ec2
$ ls -lF /ec2
total 0
dr-xr-xr-x 2 root root 0 2013-05-12 15:09 dynamic/
dr-xr-xr-x 2 root root 0 2013-05-12 15:09 meta-data/
You can isolate only the instance metadata with an alternate subtree:
$ ./ec2mdfs -osubtree=/latest/meta-data /ec2
$ ls -F /ec2
ami-id instance-id metrics/ public-keys/
ami-launch-index instance-type network/ reservation-id
ami-manifest-path kernel-id placement/ security-groups
block-device-mapping/ local-hostname profile
hostname local-ipv4 public-hostname
instance-action mac public-ipv4
ec2msfs may be used as an alternative to calling out to `curl` for instance
metadata.
Here's a useful entry for /etc/fstab:
ec2mdfs /ec2 fuse ro,allow_other 0 0
Or, same thing while mounting the metadata directory (disregarding
dynamic data and userdata):
ec2mdfs /ec2 fuse ro,allow_other,subtree=/latest/meta-data 0 0
If ec2mdfs is installed in /usr/bin, then "mount /ec2" will work, and
automatic mounts at system startup will mount /ec2 as well.
The allow_other option makes a FUSE filesystem accessible to users other
than the FUSE daemon owner (in this case, root).