From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f182.google.com ([209.85.213.182]:44449 "EHLO mail-ig0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753459AbaHDRJb (ORCPT ); Mon, 4 Aug 2014 13:09:31 -0400 Received: by mail-ig0-f182.google.com with SMTP id c1so5730604igq.3 for ; Mon, 04 Aug 2014 10:09:30 -0700 (PDT) Message-ID: <53DFBE43.2050901@gmail.com> Date: Mon, 04 Aug 2014 13:09:23 -0400 From: Austin S Hemmelgarn MIME-Version: 1.0 To: Peter Waller CC: Hugo Mills , Chris Samuel , linux-btrfs@vger.kernel.org Subject: Re: ENOSPC with mkdir and rename References: <53DEE40C.6020403@cn.fujitsu.com> <17833067.mzxAL4oqZq@quad> <20140804102206.GA31950@carfax.org.uk> In-Reply-To: Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms050904080203080106060506" Sender: linux-btrfs-owner@vger.kernel.org List-ID: This is a cryptographically signed message in MIME format. --------------ms050904080203080106060506 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2014-08-04 06:31, Peter Waller wrote: > Thanks Hugo, this is the most informative e-mail yet! (more inline) >=20 > On 4 August 2014 11:22, Hugo Mills wrote: >> >> * btrfs fi show >> - look at the total and used values. If used < total, you're OK. >> If used =3D=3D total, then you could potentially hit ENOSPC. >=20 > Another thing which is unclear and undocumented anywhere I can find is > what the meaning of `btrfs fi show` is. >=20 > I'm sure it is totally obvious if you are a developer or if you have > used it for long enough. But it isn't covered in the manpage, nor in > the oracle documentation, nor anywhere on the wiki that I could find. >=20 You didn't look very hard then, because there is information in the manpage (oh wait, you mentioned Oracle, your probably using RHEL or CentOS, which are the last thing you should be using if you want to use stuff like BTRFS that is under heavy development), and it is documented on the wiki. > When I looked at it in my problematic situation, it said "500 GiB / > 500 GiB". That sounded fine to me because I interpreted the output as > what fraction of which RAID devices BTRFS was using. In other words, I > thought "Oh, BTRFS will just make use of the whole device that's > available to it.". I thought that `btrfs fi df` was the source of > information for how much space was free inside of that. >=20 >> * btrfs fi df >> - look at metadata used vs total. If these are close to zero (on >> 3.15+) or close to 512 MiB (on <3.15), then you are in danger of= >> ENOSPC. >=20 > Hmm. It's unfortunate that this could indicate an amount of space > which is free when it actually isn't. That depends on what you mean by 'free'. >=20 >> - look at data used vs total. If the used is much smaller than >> total, you can reclaim some of the allocation with a filtered >> balance (btrfs balance start -dusage=3D5), which will then give >> you unallocated space again (see the btrfs fi show test). >=20 > So the filtered balance didn't help in my situation. I understand it's > something to do with the "5" parameter. But I do not understand what > the impact of changing this parameter is. It is something to do with a > fraction of something, but those things are still not present in my > mental model despite a large amount of reading. Is there an > illustration which could clear this up? >=20 Think of each chunk like a box, and each block as a block, and that you have two different types of block (data and metadata) and two different types of box (also data and metadata). The data boxes are four times the size of the metadata boxes, and they all have to fit in one really big container (the device itself). You can only put data blocks in the data boxs, and you can only put metadata blocks in metadata boxes. Say that in total, you can fit 128 data boxes in the large container, or you can replace one data box with up to four metadata boxes. Even though you may only have a few blocks in a given box, the box still takes up the same amount of space in the larger container. Thus, it's possible to have only a few blocks stored, but not be able to add any more boxes to the larger container. A balance operation is essentially the equivalent of taking all of the blocks of a given type, and fitting them into the smallest number of boxes possible. > Among other things I also got the kernel stack trace I pasted at the > bottom of the first e-mail to this thread when I did the rebalance. >=20 >> This FAQ entry is pretty horrible, I'm afraid. I actually started >> rewriting it here to try to make it clearer what's going on. I'll try >> to work on it a bit more this week and put out a better version for >> the wiki. >=20 > This is great to hear! :) >=20 > Thanks for your response Hugo, that really cleared up a lot of mental > model problems. I hope the documentation can be improved so that > others can learn from my mistakes. > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >=20 --------------ms050904080203080106060506 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGuDCC BrQwggScoAMCAQICAw8BRDANBgkqhkiG9w0BAQ0FADB5MRAwDgYDVQQKEwdSb290IENBMR4w HAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNBIENlcnQgU2lnbmlu ZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRAY2FjZXJ0Lm9yZzAeFw0xNDA1 MTIxNDEwMzJaFw0xNDExMDgxNDEwMzJaMGMxGDAWBgNVBAMTD0NBY2VydCBXb1QgVXNlcjEj MCEGCSqGSIb3DQEJARYUYWhmZXJyb2luN0BnbWFpbC5jb20xIjAgBgkqhkiG9w0BCQEWE2Fo ZW1tZWxnQG9oaW9ndC5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDbLUaL Gs4JTdU7sgr0MzD57CMUAv307ddC9pxooDMN3PiUvzEd5kLtBCh8KDB1wbMdfm4hte2rDd+j hM1tIq67BvNbdDPztOcBZwT2/3OVyyG4B1ddCqUyt03zGKw6Y34eHNfapsZiiItX0GBNfjHU Wv+WDo+XNha/WmGSSMv21HkftF9XA1KC9Bpr9JJI23MKK7T2g/7b3KoGZlx3ekLIJsF5B7+B DMPPDqOHQbRnccyOHEMyhM13g6WoAbU+3aKYc+C/9UsYtDV+xlvBLWagky1acstD5wOA35V6 uDRbUhD+vOjuMRMCj9jJOIYqa6AeSagBjxRnisJr0RFzQ4f+NjGCHPaFTvRvbkiXh4q22doT 0SxbNBUm7B9ANugIOtS9/VQhTWKDi//WTqZQ7Ecl4yVJbMCUg/iaRHMCGS41vqMICPszRidW rL04NwS9D2cREEY1y/xrNo0ZvKPZu6tLhxhPf7w+5rsN3+wWxGaR1hNpnVUT9AeacLKZO6W9 FsRT3Unkr91IhQATHTKYr4EA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