Skip to contentSkip to conversation

Resize, off by 1024 bytes

DISCUSSION Lluís Batlle i Rossell 1 participant 1 message Sep 24, 2012 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hello,

I wanted to resize my filesystem to 512MiB less. I had created the btrfs after I had set the partitions some days ago, and it was like this:

# cat /sys/class/block/sda1/size
234436482

Getting in bytes:
234436482*512 = 120031478784

I run:

# btrfs fi resize -512m /

And I see in dmesg:
btrfs: new size for /dev/sda1 is 119494606848

But that's not the previous size - 512MiB. It is:
120031478784 - 119494606848 = 536871936 = 512*1024*1024 + 1024

So, there is an 'off by +1024'. I shrinked the partition to +1024 bytes bigger than would be by subtracting 512MiB, just in case.

What is that off by 1024?

This is 3.5.4.

Regards,
Lluís.