Skip to content
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

copyonwrite = false gives read-only system #169

Open
hartmark opened this issue Sep 19, 2024 · 6 comments
Open

copyonwrite = false gives read-only system #169

hartmark opened this issue Sep 19, 2024 · 6 comments

Comments

@hartmark
Copy link

% cat /etc/nbd-server/config
[generic]
        # The [generic] section is required, even if nothing is specified
        # there.
        # When either of these options are specified, nbd-server drops
        # privileges to the given user and group after opening ports, but
        # _before_ opening files.
        user = nbd
        group = nbd
        allowlist = true
[arch]
    exportname = /srv/nbd/arch.img
    copyonwrite = false

Then on another machine:

% sudo nbd-client -name arch staropramen /dev/nbd2
Negotiation: ..size = 6144MB
Connected /dev/nbd2
% sudo mount /dev/nbd2 /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.

However if I change copyonwrite = true and try again:

% sudo nbd-client -name arch staropramen /dev/nbd3
Negotiation: ..size = 6144MB
Connected /dev/nbd3
% sudo mount /dev/nbd3 /mnt
% sudo touch /mnt/foo

journal gives not much detail

% journalctl -u nbd.service -b

log with copyonwrite = true
Sep 19 02:55:43 staropramen nbd_server[113549]: Spawned a child process
Sep 19 02:55:43 staropramen nbd_server[114370]: virtstyle ipliteral
Sep 19 02:55:43 staropramen nbd_server[114370]: connect from 192.168.1.66, assigned file is /srv/nbd/arch.img
Sep 19 02:55:43 staropramen nbd_server[114370]: No authorization file, granting access.
Sep 19 02:55:43 staropramen nbd_server[114370]: Size of exported file/device is 6442450944
Sep 19 02:55:43 staropramen nbd_server[114370]: About to create map and diff file /srv/nbd/nbd-192.168.1.66-114370.diff

copyonwrite = false
Sep 19 02:58:13 staropramen nbd_server[119825]: Spawned a child process
Sep 19 02:58:13 staropramen nbd_server[120884]: virtstyle ipliteral
Sep 19 02:58:13 staropramen nbd_server[120884]: connect from 192.168.1.66, assigned file is /srv/nbd/arch.img
Sep 19 02:58:13 staropramen nbd_server[120884]: No authorization file, granting access.
Sep 19 02:58:13 staropramen nbd_server[120884]: Size of exported file/device is 6442450944
Sep 19 02:58:13 staropramen nbd_server[120884]: Starting to serve
@hartmark
Copy link
Author

I tried installing nbdkit and this command was able to make my img mounted writable:
sudo nbdkit file arch.img --no-fork

@yoe
Copy link
Member

yoe commented Sep 28, 2024

Which version of nbd-server was this with? I believe we fixed a bug very similar to this one not that long ago.

@hartmark
Copy link
Author

I used the standard version of arch Linux so it should be this version
https://archlinux.org/packages/extra/x86_64/nbd/

@hartmark
Copy link
Author

There's an AUR package but it tracks the git repo on sourceforge. Is it still syncing over there?
https://aur.archlinux.org/packages/nbd-git

I can try again with that version or change the package to point to GitHub and see how that works out.

@hartmark
Copy link
Author

There's an AUR package but it tracks the git repo on sourceforge. Is it still syncing over there? https://aur.archlinux.org/packages/nbd-git

I can try again with that version or change the package to point to GitHub and see how that works out.

Answering my own question. The sourceforge repo seems to not be mirrored with GitHub-commits so I have flagged the AUR package nbd-git as out of date.

@yoe
Copy link
Member

yoe commented Sep 30, 2024

There's an AUR package but it tracks the git repo on sourceforge. Is it still syncing over there? https://aur.archlinux.org/packages/nbd-git

No, we stopped syncing to sourceforge a while back.

I can try again with that version or change the package to point to GitHub and see how that works out.

Probably should try that, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants