From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f171.google.com ([209.85.223.171]:33853 "EHLO mail-io0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751294AbbHELao (ORCPT ); Wed, 5 Aug 2015 07:30:44 -0400 Received: by ioea135 with SMTP id a135so45840876ioe.1 for ; Wed, 05 Aug 2015 04:30:43 -0700 (PDT) Subject: Re: mount btrfs takes 30 minutes, btrfs check runs out of memory To: John Ettedgui References: <55BADEC4.3020409@cn.fujitsu.com> <55BAFEF9.1070107@cn.fujitsu.com> <55BB0A39.1050208@cn.fujitsu.com> <55C017E7.40704@cn.fujitsu.com> <55C02AF9.3070600@cn.fujitsu.com> <55C0A1ED.6020407@gmail.com> Cc: Qu Wenruo , btrfs From: Austin S Hemmelgarn Message-ID: <55C1F3DD.7020603@gmail.com> Date: Wed, 5 Aug 2015 07:30:37 -0400 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-512; boundary="------------ms010201040606090809090300" Sender: linux-btrfs-owner@vger.kernel.org List-ID: This is a cryptographically signed message in MIME format. --------------ms010201040606090809090300 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 2015-08-04 13:36, John Ettedgui wrote: > On Tue, Aug 4, 2015 at 4:28 AM, Austin S Hemmelgarn > wrote: >> On 2015-08-04 00:58, John Ettedgui wrote: >>> >>> On Mon, Aug 3, 2015 at 8:01 PM, Qu Wenruo w= rote: >>>> >>>> Although the best practice is staying away from such converted fs, e= ither >>>> using pure, newly created btrfs, or convert back to ext* before any >>>> balance. >>>> >>> Unfortunately I don't have enough hard drive space to do a clean >>> btrfs, so my only way to use btrfs for that partition was a >>> conversion. >> >> If you could get your hands on a decent sized flash drive (32G or more= ), you >> could do an incremental conversion offline. The steps would look some= thing >> like this: >> >> 1. Boot the system into a LiveCD or something similar that doesn't nee= d to >> run from your regular root partition (SystemRescueCD would be my perso= nal >> recommendation, although if you go that way, make sure to boot the >> alternative kernel, as it's a lot newer then the standard ones). >> 2. Plug in the flash drive, format it as BTRFS. >> 3. Mount both your old partition and the flash drive somewhere. >> 4. Start copying files from the old partition to the flash drive. >> 5. When you hit ENOSPC on the flash drive, unmount the old partition, = shrink >> it down to the minimum size possible, and create a new partition in th= e free >> space produced by doing so. >> 6. Add the new partition to the BTRFS filesystem on the flash drive. >> 7. Repeat steps 4-6 until you have copied everything. >> 8. Wipe the old partition, and add it to the BTRFS filesystem. >> 9. Run a full balance on the new BTRFS filesystem. >> 10. Delete the partition from step 5 that is closest to the old partit= ion >> (via btrfs device delete), then resize the old partition to fill the s= pace >> that the deleted partition took up. >> 11. Repeat steps 9-10 until the only remaining partitions in the new B= TRFS >> filesystem are the old one and the flash drive. >> 12. Delete the flash drive from the BTRFS filesystem. >> >> This takes some time and coordination, but it does work reliably as lo= ng as >> you are careful (I've done it before on multiple systems). >> >> > I suppose I could do that even without the flash as I have some free > space anyway, but moving Tbs of data with Gbs of free space will take > days, plus the repartitioning. It'd probably be easier to start with a > 1Tb drive or something. > Is this currently my best bet as conversion is not as good as I thought= ? > > I believe my other 2 partitions also come from conversion, though I > may have rebuilt them later from scratch. > > Thank you! > John > Yeah, you're probably better off getting a TB disk and starting with=20 that. In theory it is possible to automate the process, but I would=20 advise against that if at all possible, it's a lot easier to recover=20 from an error if you're doing it manually. --------------ms010201040606090809090300 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgMFADCABgkqhkiG9w0BBwEAAKCC Brgwgga0MIIEnKADAgECAgMQblUwDQYJKoZIhvcNAQENBQAweTEQMA4GA1UEChMHUm9vdCBD QTEeMBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0IFNp Z25pbmcg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