nbd icon indicating copy to clipboard operation
nbd copied to clipboard

Sharing file: Wrong file size / File cut off

Open mani9876 opened this issue 4 years ago • 1 comments

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

mani9876 avatar Apr 11 '21 17:04 mani9876

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 avatar Apr 23 '21 12:04 yoe

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

yoe avatar Jul 28 '23 17:07 yoe