New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Unable to find an etc directory with fstab" upon launching NixOS on EC2 #71770
Comments
The problem was resolved by:
|
Would you mind sharing the modification you made to upload ? I'm facing the exact same issue. |
So after you build the image using the command:
You can use the script here to upload it to your AWS. The modifications in the script should be made here:
You can probably leave the
There is another line at line 38:
Note that this is using a command-line argument, so you can pass the
After that, you should be able to execute the script and the custom AMI can be found is AMIs tabs in your EC2 management page. You can choose to launch it on AWS Console or using AWS CLI. If you decided to do it manually. Then here is the summary of what needs to be done:
I was having that error coz I forgot to register the snapshot. And register the snapshot gives it an EBS volume, and this created the fstab. |
Thank you very much, it has indeed worked :). |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/fstab-error-while-creating-a-custom-amazon-ec2-ami/6697/2 |
See NixOS/nixpkgs#71770 (comment) Signed-off-by: Roman Volosatovs <roman@profian.com>
See NixOS/nixpkgs#71770 (comment) Signed-off-by: Roman Volosatovs <roman@profian.com>
For those who come across this: you should use |
If you wanted to use You may get aws to stop complaining about the fstab error with:
By default the fstab will be a symlink to the nix store but aws when it imports images will break the abstraction and make various changes to the image, including changes to the fstab. But even if you were to fix the fstab issue, you'd get stuck further down the pipe. (it get stuck and operation will never complete). AWS also wants to install drivers and change the initrd. Which obviously won't work. |
Raised the issue with support, not much they could do, but they gave me an "official" image checker: I didn't take time to run it on our generated images yet. |
Brief Description:
I built a NixOS image locally and launched it using AWS EC2. An error "ClientError: Unable to find an etc directory with fstab." was raised during launching the instance.
Might not be a bug on NixOS but I barely able to find anyone talking about this issue.
Steps to reproduce the behavior:
Inside the
nixpkgs
directory. Build an image using this command:nix-build -A amazonImage.x86_64-linux nixos/release.nix
The image built is stored in
./result
directory namednixos-amazon-image-20.03pre130979.gfedcba-x86_64-linux.vhd
Upload this image to AWS S3 storage.
Use awscli to import and launch the image from S3.
Use awscli to check the status of the launch process and the error was produced here.
Expected behavior
The NixOS image is successfully launched on EC2 and running normally.
Screenshots
This is the output when I was checking the launch process. The status message indicates the error.
Additional context
NixOS Version: 19.09
Nixpkgs Version: Just updated within a week.
Failed Attempts
ova
format instead ofamazonImage
like this:nix-build -A ova.x86_64-linux nixos/release.nix
, same error.https://logs.nix.samueldr.com/nixos-dev/2019-05-10
Metadata
Something went wrong when retrieving Metadata..
Thanks everyone.
The text was updated successfully, but these errors were encountered: