/etc/fstab not found when launching from AWS EC2

Hi everyone! I’m new to Nix OS so this might be a dumb question but I can’t find anyone talking about this either…

I built a nixos amazonImage using nix-build, uploaded to aws S3 storage and tried to launch it. EC2 told me “ClientError: Unable to find an etc directory with fstab”

I built an image using this command inside nixpkgs directory:
nix-build -A amazonImage.x86_64-linux nixos/release.nix

The resultant files were stored in the result directory:

I uploaded the file to S3 storage and I’ve setup the service role vmimport so I can launch it using aws import-image command.

After launching it, an error occured saying “ClientError: Unable to find an etc directory with fstab”

Relevant Files
The release.nix I used is identical to this:

The amazon-image.nix I used is identical to this:

Relevant Discussion but no solution
Some other devs(?) also had this issue back in may 2019 and they didnt seem to solve it either.

** Other Questions **
Do you nix-build amazonImage.x86_64-linux or ova.x86_64-linux or anyother image format for aws ec2?

Thanks guys.

1 Like