wamdam / backy2

backy2: Deduplicating block based backup software for ceph/rbd, image files and devices
http://backy2.com/
Other
194 stars 39 forks source link

mount: mount /dev/nbd0 on /mnt/test failed: Function not implemented #33

Closed yonchin closed 4 years ago

yonchin commented 5 years ago

`backy2 nbd -r 9353a59c-39df-11e9-80a8-525400597931 INFO: $ /usr/bin/backy2 nbd -r 9353a59c-39df-11e9-80a8-525400597931 INFO: Starting to serve nbd on 127.0.0.1:10809 INFO: You may now start INFO: nbd-client -l 127.0.0.1 -p 10809 INFO: and then get the backup via INFO: modprobe nbd INFO: nbd-client -N 127.0.0.1 -p 10809 /dev/nbd0

INFO: Incoming connection from 127.0.0.1:33572
INFO: [127.0.0.1:33572] Client aborted negotiation
INFO: Incoming connection from 127.0.0.1:33732
INFO: [127.0.0.1:33732] Negotiated export: 9353a59c-39df-11e9-80a8-525400597931
INFO: nbd is read only.`

error log:

mount /dev/nbd0 /mnt/test
mount: /dev/nbd0 is write-protected, mounting read-only
mount: mount /dev/nbd0 on /mnt/test failed: Function not implemented
yonchin commented 5 years ago

dmesg log:

XFS (nbd0): device supports 1024 byte sectors (not 512)
mennozon commented 5 years ago

Try supplying nbd-client with '-b 512'

yonchin commented 5 years ago

@mennozon it's ok, thks!!!

wamdam commented 5 years ago

So mount is trying to initialize the device with 1024 byte sectors? Is this something nbdserver should support?

mennozon commented 5 years ago

As far as I can tell it's nbd-client that defaults to 1024 while disks are usually 512 or 4096.

wamdam commented 5 years ago

Sounds like -b is mandatory then when opening a connection. So there's nothing to do at backy2's side as far as I can see...

mennozon commented 5 years ago

We could add -b 512 in the example backy2 shows when starting the service and perhaps add a few lines in the documentation specifying that nbd-clients' default is 1024.

I'll create a pull request if you want, just have to figure out how to create a new one without adding it to my previous request.

olifre commented 5 years ago

The default has also changed to 512 in more recent versions of nbd client: https://github.com/NetworkBlockDevice/nbd/commit/128fd556286ff5d53c5f2b16c4ae5746b5268a64

wamdam commented 5 years ago

If you like, just add a few lines how this could be described here, I'll happily add it to the docs.

wamdam commented 4 years ago

As nbd does not work reliably in recent versions of nbdclient (not only because of incompatible block sizes) I got rid of it all together and implemented a fuse mount. This is much more stable, reliable and a lot simpler than the old code.