Adjustable mount manager for Lambda Cloud persistent filesystems.
antman creates loop-mounted ext4 filesystems backed by image files on Lambda's persistent NFS storage (/lambda/nfs/<name>). You can create, expand, shrink, remove, and migrate these mounts across instances.
Lambda Cloud persistent filesystems are truly elastic (no fixed size), but sometimes you need a mount with a controlled size limit -- for quotas, sandboxing, or keeping a dataset bounded. antman gives you that by creating a fixed-size ext4 image on the elastic NFS and loop-mounting it.
Standard Linux utilities (present on Lambda Cloud instances by default):
truncate,mkfs.ext4,mount,umountlosetup,resize2fs,e2fsckrsync,ssh(for migration)sudoaccess
git clone https://github.com/LambdaLabsML/antman.git && cd antman
sudo make installTo uninstall:
sudo make uninstallantman [--yes|-y] <command> [options]
antman create --fs-lambda <lambda-fs-name> --fs-new <mount-name> --size <size>Creates a sized ext4 image at /lambda/nfs/<fs-lambda>/<mount-name>.img and mounts it to /mnt/<mount-name>.
Example:
antman create --fs-lambda my-persistent-fs --fs-new data --size 100MThis creates a 100MB filesystem at /lambda/nfs/my-persistent-fs/data.img mounted at /mnt/data.
antman expand --fs-new <mount-name> --size <new-size>Expands the filesystem to the new (larger) size. The mount stays active throughout -- no downtime.
--fs-lambda is auto-detected from the active mount. You can override it with --fs-lambda <name> if needed.
Example:
antman expand --fs-new data --size 2Tantman shrink --fs-new <mount-name> --size <new-size>Shrinks the filesystem to the new (smaller) size. The mount is temporarily unmounted during the operation.
Before proceeding, antman shows the current used space so you can verify the target size is safe. If resize2fs fails (e.g., data won't fit), the original image is remounted unchanged.
Example:
antman shrink --fs-new data --size 1Tantman remove --fs-new <mount-name>Unmounts the filesystem, deletes the image file, and removes the mount directory. Irreversible.
If the mount is not currently active, provide --fs-lambda explicitly so antman can find the image.
Example:
antman remove --fs-new data
# If not mounted:
antman remove --fs-new data --fs-lambda my-persistent-fsantman migrate --fs-local <local-mount-name> \
--remote-ip <ip> \
--ssh-key <key-name-or-path> \
--remote-fs-lambda <remote-lambda-fs-name> \
[--fs-remote <remote-mount-name>] \
[--remote-user <user>]Copies the image to a remote Lambda Cloud instance and mounts it there. Uses rsync for resumable transfers. The local mount is temporarily unmounted during the transfer to ensure a clean image.
--fs-local identifies the local mount to copy. --fs-remote sets the name on the remote side (defaults to the same as --fs-local).
Safety checks (run before transfer):
- Remote persistent FS (
/lambda/nfs/<remote-fs-lambda>) must exist - Remote image (
<remote-mount-name>.img) must NOT already exist - Remote mount point (
/mnt/<remote-mount-name>) must NOT be active
If any check fails, antman tells you what went wrong and prompts you to enter a corrected value (e.g., a different --remote-fs-lambda or --fs-remote). Checks are re-run automatically until all pass or you type q to abort.
The local copy is not removed. Run antman remove afterward if you want to clean up.
--remote-user defaults to ubuntu. --ssh-key accepts either a key name (looked up in ~/.ssh/) or a full path.
Examples:
# Same name on remote
antman migrate --fs-local data \
--remote-ip 203.0.113.42 \
--ssh-key lambda-key \
--remote-fs-lambda new-instance-fs
# Different name on remote
antman migrate --fs-local data --fs-remote data-backup \
--remote-ip 203.0.113.42 \
--ssh-key lambda-key \
--remote-fs-lambda new-instance-fsantman listDisplays all antman-managed filesystems, both mounted (detected via loop devices) and unmounted (found by scanning /lambda/nfs/*/*.img).
Example output:
ANTMAN MOUNTS
data fs-lambda=my-persistent-fs size=100M used=12M mounted at /mnt/data
archive fs-lambda=my-persistent-fs size=500M used=- not mounted
Use --yes / -y to skip confirmation prompts:
antman -y remove --fs-new data
antman -y shrink --fs-new data --size 50M/lambda/nfs/<persistent-fs>/ # Lambda's elastic NFS (no size limit)
└── <mount-name>.img # Fixed-size ext4 image (antman-managed)
↕ loop mount
/mnt/<mount-name>/ # Bounded mount point
truncatecreates a sparse file of the desired size on NFSmkfs.ext4formats it as ext4mount -o loopattaches it as a loop device and mounts it- Expand/shrink use
resize2fs+truncateto adjust the image and filesystem
MIT