-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Block device mount in guest (ZFS zvol) #273
Comments
The extra group and the former config look right. What's the error message you are getting? |
When I use the volume as I described, without the
When I set a dummy volume size ( |
That's weird because |
I checked and don't see it in the FYI I have not set the following ZFS dataset options, as I believe they do not apply to block devices:
talked about here: #246 (comment) |
What is the filesystems.nix file? NixOS options don't end up in /nix/store directly. |
Ah, my bad. I found that with
which shows:
and I looked into Sorry for the mixup. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I have made the error of rebuilding the declarative VM with I am keeping the issue for now and will close it once I get it working, should be quick. |
The microMV now outputs an error on startup, as it tries to mount my block device as a ext4 filesystem.
How can I mount it as a raw block device in the guest ? |
I miss the The |
You are right that
However I do see the dev node appearing in the guest fileSystems declaration (I guess that's coherent with it ending up in the fstab):
If it has to be done explicitly I didn't import it. (Adding |
It's just |
Yes I did import that in my guest config. This is, roughly, the config I use for the host:
And this is, roughly, the config I use for the guest:
Everything seems to be working as expected, except this last block device mount that is mounted as a filesystem on the guest |
BTW, what are you trying to achieve by copying the Nix configuration into the VM? The VM is supposed to be built by the host. |
It was not supposed to be there, I removed it (it was from one of my first tests). Sorry for the mess!
Understood, I switched back to |
Can please post the mount error message? |
With the command
And since the VM is in emergency mode, I can't connect via SSH and get the full error message |
microvm.nix does not detect if it's a zvol, therefore you must create it manually and also run mkfs.ext4 yourself. PR welcome :-) |
I was, and am, considering contributing however I can, despite my very modest level here ;-) still very much in the learning process.
Ah! to be sure we are on the same page, for such a PR, microvm would have to see that it is a zvol, but both cases would be possible:
The first is what it tries to do right now, but the second would require an additional parameter in the volumes attribute set, right ? |
Not necessary, |
Ah, makes sense, thanks. I'll try to look into it. |
I would like to access a ZFS zvol (block device) from the VM but can't figure it out for the life of me.
I saw references to block devices mounting in the documentation, and this comment that was posted:
https://astro.github.io/microvm.nix/faq.html#how-do-i-let-the-microvm-user-access-block-devices
Originally posted by @astro in #222 (comment)
To mount it, I have tried :
Adding microvm user to
disk
groupThen:
Would you have any pointers on how to proceed ?
(disclaimer: I am rather new to nixos, and qemu, may not have seen the obvious)
The text was updated successfully, but these errors were encountered: