NetworkBlockDevice / nbd

Network Block Device
GNU General Public License v2.0
450 stars 116 forks source link

Sharing file: Wrong file size / File cut off #116

Closed mani9876 closed 1 year ago

mani9876 commented 3 years ago

Hello,

I am trying to use nbd, but my shared file has the wrong file size and because of that the file is cut off.

I am using: Server: Debian 10.9 with nbd-client 3.18 Client: Debian 10.9 with nbd-client 3.18

On the server ls -l tells me a file size of 241059 bytes.

On the client "lsblk -b" on the nbd0 device tells a size of 240640 bytes.

As my test file is a readable text file, I can also see that the file on the client side is cut off. If I am issuing the tail command on the client and on the server side, I can clearly see the difference.

Does anyone else have this kind of problem?

Thanks! Best regards

yoe commented 3 years ago

Hi,

On Sun, Apr 11, 2021 at 10:26:25AM -0700, mani9876 wrote:

Hello,

I am trying to use nbd, but my shared file has the wrong file size and because of that the file is cut off.

I am using: Server: Debian 10.9 with nbd-client 3.18 Client: Debian 10.9 with nbd-client 3.18

On the server ls -l tells me a file size of 241059 bytes.

On the client "lsblk -b" on the nbd0 device tells a size of 240640 bytes.

This is because a block device needs to consist of a particular number of whole blocks. If the size of your file is not an exact multiple of blocks, then the last incomplete block will indeed be dropped (as you show).

In other words, this means the software is working as designed.

-- @.***{be,co.za} wouter@{grep.be,fosdem.org,debian.org}

yoe commented 1 year ago

Explanation was given, no comments were left afterwards, so closing this.