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

btrfs.mkfs reports incorrect minimum size #70

Closed
WesleyAC opened this issue Oct 2, 2017 · 8 comments
Closed

btrfs.mkfs reports incorrect minimum size #70

WesleyAC opened this issue Oct 2, 2017 · 8 comments
Labels
bug
Milestone

Comments

@WesleyAC
Copy link

@WesleyAC WesleyAC commented Oct 2, 2017

If I run mkfs.btrfs on a disk that is less than 41943040 bytes, I get:

ERROR: 'test.img' is too small to make a usable filesystem
ERROR: minimum size for each btrfs device is 41943040

However, the actual minimum size seems to be much higher. Disks of up to 80MB in size report:

ERROR: not enough free space to allocate chunk

It seems like it would be more useful to report the size needed to successfully complete in the first message.

Checked on mkfs.btrfs, part of btrfs-progs v4.12.1.

@kdave kdave added bug new labels Oct 10, 2017
@adam900710
Copy link
Contributor

@adam900710 adam900710 commented Oct 12, 2017

Are you using --rootdir option?

In that case, it will need extra space for the content.
The minimal size reported is just to make an empty, mountable fs with some spare space.

@WesleyAC
Copy link
Author

@WesleyAC WesleyAC commented Oct 12, 2017

No, I wasn't using the --rootdir flag. The command was mkfs.btrfs filesystem.img.

@adam900710
Copy link
Contributor

@adam900710 adam900710 commented Oct 12, 2017

OK, this is a regression.

v4.0 btrfs-progs is still OK, I assume it's chunk allocator causing the problem.
Bisect under way.

@adam900710
Copy link
Contributor

@adam900710 adam900710 commented Oct 12, 2017

commit c11e36a
Author: Chandan Rajendra chandan@linux.vnet.ibm.com
Date: Wed Oct 14 23:09:37 2015 +0530

Btrfs-progs: Do not force mixed block group creation unless '-M' option is specified

OK, that's because we're no longer forcing mixed block group for small filesystem.
While the minimal size calculation is still based on mixed block group.

I'll update the minimal size calculator to handle both mixed block group and current separate profiles.

@adam900710
Copy link
Contributor

@adam900710 adam900710 commented Oct 12, 2017

@WesleyAC
Patch sent. You could help review/ test the patch.
(Sorry, I just sent it to mail list)

https://patchwork.kernel.org/patch/10001161/
https://patchwork.kernel.org/patch/10001159/

@cmurf
Copy link

@cmurf cmurf commented Nov 23, 2017

@adam900710
Copy link
Contributor

@adam900710 adam900710 commented Nov 23, 2017

Will be addressed by pull request #66

@kdave
Copy link
Owner

@kdave kdave commented Nov 28, 2017

The mkfs and minimal size fixes have been merged to devel branch, this was an independent part of the #66 pull.

@kdave kdave closed this Nov 28, 2017
@kdave kdave removed the new label Nov 28, 2017
@kdave kdave added this to the v4.14.1 milestone Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.