ext4到btrfs的转换:需要多长时间?空间需求?


9

我为ext4分区硬盘启动了btrfs-convert。我先做了一个fsck,很好。因此,既然它已经运行了4个小时以上(1.),我想知道它是否还会完成?我快速阅读了多篇有关转换的文章,但都没有提到空间需求。但是我猜想有人在考虑这篇文章:https : //oss.oracle.com/projects/btrfs/dist/documentation/btrfs-converter.html

因此,在开始之前,我的HDD使用了1.82TB的99.0%。(2.)如果无法完成,是否保存以取消(CTRL + C)提示?

iotop指示btrfs-convert仍从我的硬盘读取40MB / s的数据,并且top显示一个bpufs-convert已完全加载一个cpu内核。(3.)现在最明智的决定是什么?

更新:同时,转换过程已完成。花了将近3天。我必须补充说,这两者之间的速度下降到〜0-10MB / s,但100%I / O负载和CPU使用率相应下降。今天早上(运行2天后),转换过程只有大约9小时的CPU时间。总而言之,一切似乎都很好。


/是非根文件系统还是非根文件系统?
Terry Wang

这是一个非根fs。
kschurig

我刚刚将4TB驱动器上的大约2TB数据(因此已满50%)从ext4转换为btrfs,大约花费了6个小时。不知道您的速度是否慢了很多是因为您的计算机已满99%,还是带宽或CPU受到限制(我的intel core 2 CPU使用率始终约为50%,因此,CPU速度慢可能会花费更长的时间) 。
弗雷德·汉密尔顿

只是在这个问题上苦苦挣扎。7小时后,我的22G / 542G免费卷的当前进度为“ copy inodes [O] [4029324/3935939]”,这意味着完成了102%。让我们看看它需要多长时间以及结束了100%多远
Daniel Alder

Answers:


6

btrfs-convert将创建ext2_saved现有文件系统的快照(名为)作为备份。由于btrfs是CoW,因此很难预测快照将占用多少磁盘空间。

我之前已经/为Oracle Linux 6.3 x86_64 转换了a ,由于文件系统相对较小(数据存储在单独的逻辑卷上),因此只需不到10分钟的时间。一切顺利,没有问题。

在您的情况下,HDD的数据量超过1.8T,剩余空间很小,不知道要花多长时间(快照可能只占用很少的空间,因为文件系统自转换以来没有发生变化)。如果iotop显示它仍在运行,请保留它。

只有很少的人知道如果您中断转换会发生什么,请尝试btrfs邮件列表;-)

推荐读物:

https://blogs.oracle.com/wim/entry/btrfs_root_and_yum_update

5.4.6。将Ext2,Ext3或Ext4文件系统转换为Btrfs文件系统


1
同时,转换过程已完成。花了将近3天,但一切似乎都很好。无论如何,我都会去看那些文章,谢谢!
kschurig

牛?--------------
RobinJ 2013年

1
没关系:)“写时复制(有时也称为“ COW”)”
RobinJ

4
如果无法完成,是否保存以取消(CTRL + C)进程?

我只是试图转换一个8TB的文件系统,并且btrfs-convert似乎崩溃了,并btfsck给出了一个非特定的“错误”,但是回滚btrfs-convert -r 只花了一分钟,而旧的ext4系统看起来一切正常。

因此,流产btrfs-convert似乎是相对安全的。


1
我刚刚尝试过,在运行btrfs-convert时按Ctrl-C。它使ext4文件系统处于怪异状态。我可以挂载它,但不能挂载它,因为它说它正在使用中。最后,我必须重新启动才能进行fsck。
布莱恩·明顿

1
昨天我不小心关闭了运行btrfs-convert ssh客户端会话的计算机(这意味着该工具的stdout和stderr已关闭,最终也终止了该工具)。今天,当我检查文件系统时,ext4仍然处于干净状态,fsck没发现任何问题
Daniel Alder

2

只需添加另一个数据点即可:

最近,我在带有外部USB3 WD Ultra 4TB驱动器(5200rpm)的Odroid XU4(ARM硬件)上进行了此转换。操作系统是Debian Jessie,内核3.10.103+。Btrfs版本为v3.17

以前的fs是ext4,使用了约2TB的空间,2TB的可用空间,并且文件很大(电视节目,每个文件都超过几百mb)。

整个过程耗时约30个小时。

btrfs转换过程的顶部CPU反弹率在20%到80%之间,在iotop中徘徊在32MB / s左右。

输出原为

creating btrfs metadata.
creating ext2fs image file.
cleaning up system chunk.
conversion complete.

并且所有文件看起来都很好。

现在,我将删除ext4备份子卷,执行碎片整理并重新平衡。也会定时这些。

更新资料

在碎片整理期间,我遇到了一个内核错误:

btrfs filesystem defrag -v -r -f -t 32M /mnt/hdd_ultra_2

   

    Dec 13 12:24:59 Archimedes-I kernel: [3361889.858128] [c5] ------------[ cut here ]------------
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.861921] [c5] kernel BUG at fs/btrfs/inode.c:873!
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.867036] [c5] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.873461] [c5] Modules linked in: btrfs xor raid6_pq cdc_ether usbnet r8152 ads7846 ina231_sensor spidev i2c_s3c2410 spi_s3c64xx fuse
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.885764] [c5] CPU: 5 PID: 5730 Comm: btrfs-transacti Not tainted 3.10.103+ #1
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.893339] [c5] task: c2a6eb80 ti: d1836000 task.ti: d1836000
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.899641] [c5] PC is at __cow_file_range+0x518/0x610 [btrfs]
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.905637] [c5] LR is at run_delalloc_nocow+0x440/0xb74 [btrfs]
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.911465] [c5] pc : [<bf0c9560>]    lr : [<bf0c9a98>]    psr: 20010013
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.911465] sp : d1837810  ip : 00001000  fp : d18378a4
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.923720] [c5] r10: d6cd7d20  r9 : c2a59000  r8 : 000001c2
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.929507] [c5] r7 : d1837a98  r6 : cd9ce1a0  r5 : c2a59000  r4 : cd9cdf60
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.936627] [c5] r3 : 00000000  r2 : 000001c2  r1 : 00000000  r0 : 000001c2
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.943745] [c5] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.951645] [c5] Control: 10c5387d  Table: 43dac06a  DAC: 00000015
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.957967] [c5] CPU 1 / CLUSTER 0
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.961517] [c5] DFSR: 0000081f, ADFSR: 00000000, IFSR: 00000007, AIFSR: 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.969170] [c5] CPUMERRSR: 00000000_00000000, L2MERRSR: 00000000_00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.976192] [c5]
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.976192] SP: 0xd1837790:
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.981217] [c5] 7790  d1837704 d6cd7af0 00000000 c2a5e000 bf0c9564 00000000 c000e818 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.989952] [c5] 77b0  e7100000 d1836000 d18378a4 d18377c8 c000e56c c00081cc 000001c2 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361889.998716] [c5] 77d0  000001c2 00000000 cd9cdf60 c2a59000 cd9ce1a0 d1837a98 000001c2 c2a59000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.007478] [c5] 77f0  d6cd7d20 d18378a4 00001000 d1837810 bf0c9a98 bf0c9560 20010013 ffffffff
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.016242] [c5] 7810  d45bdd78 00000000 00000000 00cc00cb d45bdd94 c061c6b4 d183784c d1837838
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.025006] [c5] 7830  c061c6b4 c00613cc c144c6e0 d477e7b8 d183786c d1837850 bf0dc3b4 c061c688
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.033769] [c5] 7850  c2a59000 cd9cdf60 d45bdd78 00000000 d1837884 d1837870 bf0e2484 bf0dc300
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.042532] [c5] 7870  d6cd7d2c 00000006 d18378a4 00000000 00000000 0013ffff d1837a98 d1837a9c
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.051297] [c5]
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.051297] FP: 0xd1837824:
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.056337] [c5] 7824  c061c6b4 d183784c d1837838 c061c6b4 c00613cc c144c6e0 d477e7b8 d183786c
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.065092] [c5] 7844  d1837850 bf0dc3b4 c061c688 c2a59000 cd9cdf60 d45bdd78 00000000 d1837884
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.073864] [c5] 7864  d1837870 bf0e2484 bf0dc300 d6cd7d2c 00000006 d18378a4 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.082627] [c5] 7884  0013ffff d1837a98 d1837a9c c2a59000 d6cd7d20 d1837984 d18378a8 bf0c9a98
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.091391] [c5] 78a4  bf0c9054 00000000 00000000 0013ffff 00000000 d1837a98 d1837a9c 00000001
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.100155] [c5] 78c4  bf0deb4c 00140000 00000000 00000000 00000002 00000000 00000000 00140000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.108918] [c5] 78e4  00000000 00000000 00000000 00140000 00000000 00000000 c144c6e0 00140000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.117681] [c5] 7904  00000000 00000000 00000000 00140000 00000000 00140000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.126437] [c5]
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.126437] R4: 0xcd9cdee0:
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.131474] [c5] dee0  c0da9518 00000000 00000000 c07eeb20 cd9cdef0 cd9cdef0 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.140232] [c5] df00  00000000 cd9cdf04 cd9cdf04 00000000 0000008a 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.148995] [c5] df20  cd9ce838 97c2a3e5 c2a59000 000001c2 00000000 00000001 00000000 ae6ed700
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.157758] [c5] df40  00050005 dead4ead ffffffff ffffffff bf14ccc4 c0a94e68 00000000 bf1449ac
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.166522] [c5] df60  c4455880 c44558f4 c44558f4 00000000 deaf1eed ffffffff ffffffff bf14cd08
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.175285] [c5] df80  c0a932c8 00000000 bf144b3c c4c50650 d4fa0170 00000000 00000020 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.184050] [c5] dfa0  cd9ce2bc d8f9ccae 00000000 00000000 00000001 07980798 dead4ead ffffffff
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.192812] [c5] dfc0  ffffffff bf14cd5c c0a933d8 00000000 bf144da4 00000000 dead4ead ffffffff
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.201576] [c5]
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.201576] R5: 0xc2a58f80:
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.206614] [c5] 8f80  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.215371] [c5] 8fa0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.224135] [c5] 8fc0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.232898] [c5] 8fe0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.241662] [c5] 9000  d45bdd78 d4f9a668 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.250425] [c5] 9020  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.259189] [c5] 9040  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.267953] [c5] 9060  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.276727] [c5]
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.276727] R6: 0xcd9ce120:
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.281754] [c5] e120  cd9ce120 cd9ce120 cd9c9d31 cd9cfc58 cd9cb3d8 00000080 00000000 f82e2a7f
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.290511] [c5] e140  00000000 00000000 000000a8 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.299275] [c5] e160  00140000 00000000 00140000 00000000 ffffffff ffffffff 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.308038] [c5] e180  00000000 00000000 0000001b 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.316802] [c5] e1a0  00008180 00000000 00000000 00000000 00000000 00000000 bf13b480 c2a5c800
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.325565] [c5] e1c0  cd9ce2bc 000001c2 00000001 00000000 00140000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.334329] [c5] e1e0  00000000 00000000 584f4de9 27528e13 002c002c dead4ead ffffffff ffffffff
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.343092] [c5] e200  bf14a56c c0a92c68 00000000 c07eeb60 00000000 0000000c 00001e00 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.351856] [c5]
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.351856] R7: 0xd1837a18:
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.356894] [c5] 7a18  c0090e48 c008fce8 00000001 00000000 00000000 c00ea1f0 d1837a84 00000411
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.365652] [c5] 7a38  00000006 00000002 00000140 d1837b28 0000000e d1837b08 00000102 c00ea314
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.374424] [c5] 7a58  c1d2ae00 d1837b28 d1837abc d1837b0c 00000000 00000000 00000fff 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.383189] [c5] 7a78  00000000 00000000 00000000 c02897cc cd9ce1a0 00140000 c02897cc c00613cc
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.391952] [c5] 7a98  00000000 00000000 00000000 00000000 0013ffff 00000000 d1837adc 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.400706] [c5] 7ab8  d1837bb0 d1837b28 cd9ce2bc 0000000e c144c6e0 ffffffff d1837b8c d1837ae0
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.409471] [c5] 7ad8  bf0e17c0 bf0e08f8 0000000e 00000080 00000000 cd9ce1a0 00000000 00000002
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.418232] [c5] 7af8  d1837b0c 00000000 00000000 00000000 0000000e 00000000 cd9cdf90 bf0c4c2c
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.426997] [c5]
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.426997] R9: 0xc2a58f80:
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.432034] [c5] 8f80  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.440792] [c5] 8fa0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.449555] [c5] 8fc0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.458319] [c5] 8fe0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.467082] [c5] 9000  d45bdd78 d4f9a668 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.475846] [c5] 9020  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.484618] [c5] 9040  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.493381] [c5] 9060  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.502146] [c5]
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.502146] R10: 0xd6cd7ca0:
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.507284] [c5] 7ca0  00000000 00000000 00000000 d6cd7cac d6cd7ee0 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.516028] [c5] 7cc0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.524792] [c5] 7ce0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.533555] [c5] 7d00  00000000 00000000 00000000 00000000 00000001 00000000 00000008 d64eba00
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.542317] [c5] 7d20  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.551081] [c5] 7d40  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.559846] [c5] 7d60  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.568608] [c5] 7d80  00000000 00000000 00000000 00000000 d6cd7e70 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.577380] [c5] Process btrfs-transacti (pid: 5730, stack limit = 0xd1836238)
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.584782] [c5] Stack: (0xd1837810 to 0xd1838000)
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.589718] [c5] 7800:                                     d45bdd78 00000000 00000000 00cc00cb
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.598500] [c5] 7820: d45bdd94 c061c6b4 d183784c d1837838 c061c6b4 c00613cc c144c6e0 d477e7b8
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.607263] [c5] 7840: d183786c d1837850 bf0dc3b4 c061c688 c2a59000 cd9cdf60 d45bdd78 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.616026] [c5] 7860: d1837884 d1837870 bf0e2484 bf0dc300 d6cd7d2c 00000006 d18378a4 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.624789] [c5] 7880: 00000000 0013ffff d1837a98 d1837a9c c2a59000 d6cd7d20 d1837984 d18378a8
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.633552] [c5] 78a0: bf0c9a98 bf0c9054 00000000 00000000 0013ffff 00000000 d1837a98 d1837a9c
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.642317] [c5] 78c0: 00000001 bf0deb4c 00140000 00000000 00000000 00000002 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.651079] [c5] 78e0: 00140000 00000000 00000000 00000000 00140000 00000000 00000000 c144c6e0
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.659842] [c5] 7900: 00140000 00000000 00000000 00000000 00140000 00000000 00140000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.668608] [c5] 7920: 00000000 00000000 d477e7b8 cd9ce1a0 c2a59000 00000000 00140000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.677331] [c5] 7940: c1d11800 c2d99800 00000001 6c000000 00000000 00000000 d18379bc 0013ffff
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.686133] [c5] 7960: d1837a98 00000002 d1837a9c 00000000 cd9ce1a0 cd9cdf90 d18379fc d1837988
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.694896] [c5] 7980: bf0ca604 bf0c9664 0013ffff 00000000 d1837a98 00000001 d1837a9c 77817780
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.703663] [c5] 79a0: cd9ce1a0 00000000 00000001 c144c6e0 08000000 00000000 00000516 d4fa0160
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.712386] [c5] 79c0: 00000000 00000000 0013ffff 00000000 00000500 d1837a9c 00000000 d1837bb0
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.721150] [c5] 79e0: c144c6e0 00000000 d1837aa8 cd9cdf90 d1837adc d1837a00 bf0e11b4 bf0ca2a4
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.729913] [c5] 7a00: 0013ffff 00000000 d1837a98 d1837a9c d1837a6c d1837a20 c0090e48 c008fce8
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.738676] [c5] 7a20: 00000001 00000000 00000000 c00ea1f0 d1837a84 00000411 00000006 00000002
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.747439] [c5] 7a40: 00000140 d1837b28 0000000e d1837b08 00000102 c00ea314 c1d2ae00 d1837b28
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.756202] [c5] 7a60: d1837abc d1837b0c 00000000 00000000 00000fff 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.764966] [c5] 7a80: 00000000 c02897cc cd9ce1a0 00140000 c02897cc c00613cc 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.773730] [c5] 7aa0: 00000000 00000000 0013ffff 00000000 d1837adc 00000000 d1837bb0 d1837b28
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.782492] [c5] 7ac0: cd9ce2bc 0000000e c144c6e0 ffffffff d1837b8c d1837ae0 bf0e17c0 bf0e08f8
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.791267] [c5] 7ae0: 0000000e 00000080 00000000 cd9ce1a0 00000000 00000002 d1837b0c 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.800028] [c5] 7b00: 00000000 00000000 0000000e 00000000 cd9cdf90 bf0c4c2c 00000000 20010012
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.808792] [c5] 7b20: 0000000e 00000000 c144c6e0 c144c700 c144c720 c144c740 c144c760 c144c780
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.817556] [c5] 7b40: c144c7a0 c144c7c0 c144c7e0 c1bd4f00 c1d1b400 c1d28b00 c1d55700 c1d2ae00
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.826318] [c5] 7b60: 4e16a555 7fffffff 7fffffff ffffffff ffffffff 00000000 00000000 cd9ce1a0
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.835082] [c5] 7b80: d1837b9c d1837b90 bf0c48f8 bf0e1588 d1837bac d1837ba0 c00f5f08 bf0c48d4
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.843845] [c5] 7ba0: d1837be4 d1837bb0 c00ebae4 c00f5ee0 7fffffff 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.852609] [c5] 7bc0: ffffffff 7fffffff 00000001 00000000 ffffffff 7fffffff d1837c0c d1837be8
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.861373] [c5] 7be0: c00ecb58 c00eba94 ffffffff 7fffffff 00000001 0013ffff ffffffff 7fffffff
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.870137] [c5] 7c00: d1837c54 d1837c10 bf0dadac c00ecb38 ffffffff 7fffffff bf0de080 bf0dd198
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.878900] [c5] 7c20: ffffffff 7fffffff 00001008 00000000 00000050 ffffffff ffffffff 00000006
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.887663] [c5] 7c40: 00000000 cd9ce1a0 d1837d3c d1837c58 bf103748 bf0dad44 ffffffff ffffffff
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.896450] [c5] 7c60: d1837cac 00000050 00000000 00000000 00000000 60010013 d1837cd4 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.905215] [c5] 7c80: 0013ffff 00000000 00000001 00000000 00000000 cd9ce1a0 cd9cdf90 c2a59000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.913975] [c5] 7ca0: d40260c8 00000000 00000000 00000000 c014c5f0 cb594e34 cd9ce2a8 cd9ce1f0
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.922739] [c5] 7cc0: d1837cc0 d1837cc0 c2a59000 002a0029 cd9ce2a8 cb594e34 cb594e00 cb594e34
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.931502] [c5] 7ce0: c2a59000 05490548 cb594e34 00000000 00000000 c1d99800 de1de800 c2a59000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.940265] [c5] 7d00: 00001000 00000140 00000140 00000001 bf1039cc cb594e00 cb594e34 cd9ce1a0
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.949029] [c5] 7d20: d3dc5f50 c2a59000 d477e7b8 c8edef80 d1837d7c d1837d40 bf103d04 bf103010
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.957793] [c5] 7d40: d477e7b8 d3dc5f50 42000000 00000067 d1837d7c c2000000 00000066 cb594e00
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.966555] [c5] 7d60: d477e7b8 40000000 00000001 c2a5f800 d1837e04 d1837d80 bf0b0a24 bf103c80
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.975319] [c5] 7d80: 00000000 00000001 00140000 00000000 00140000 00000000 00140000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.984083] [c5] 7da0: d1837dd0 d477e7b8 d407988c 00000001 40000000 00000000 d477e7b8 c4ee4734
    Dec 13 12:24:59 Archimedes-I kernel: [3361890.992855] [c5] 7dc0: 02000000 00000009 d3dc5f50 00000000 81540000 00000001 d45bdd78 c2a5f800
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.001620] [c5] 7de0: d4027450 c2a59000 d477e7b8 c2a5f810 c2a5f9c7 c2a5fd04 d1837e64 d1837e08
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.010381] [c5] 7e00: bf0bf080 bf0b03e4 00000000 d1837e34 00000001 d4026000 c2a5b800 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.019144] [c5] 7e20: bf0c0bf8 d4026000 02a5c000 00000000 d1837e54 d45bdd78 bf112928 d477e7b8
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.027908] [c5] 7e40: d4079770 c2a59000 d4079824 00000049 00000000 d1836000 d1837eec d1837e68
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.036671] [c5] 7e60: bf0c0c28 bf0bef24 d1837ec4 d1837e78 00000000 00000001 00000001 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.045434] [c5] 7e80: 00000000 00000000 c2a6eb80 c0054a44 d1837e90 d1837e90 c06199d8 bf14cce4
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.054199] [c5] 7ea0: bf0b9344 00001364 00000000 c2a59000 d1836000 00001364 c09a24c0 d4079770
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.062968] [c5] 7ec0: 00000001 c2a59000 d1836000 00001364 c09a24c0 00000000 00000000 00001770
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.071727] [c5] 7ee0: d1837f24 d1837ef0 bf0b942c bf0c07a0 000000a8 00000000 bf0b92b0 d3081cd4
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.080489] [c5] 7f00: 00000000 c2a59000 bf0b92b0 00000000 00000000 00000000 d1837fac d1837f28
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.089214] [c5] 7f20: c0053ee0 bf0b92bc d1836000 00000000 c1e0a1c0 c2a59000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.097978] [c5] 7f40: dead4ead ffffffff ffffffff c09a0abc 00000000 00000000 c07dcc88 d1837f5c
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.106741] [c5] 7f60: d1837f5c 00000000 00000000 dead4ead ffffffff ffffffff c09a0abc 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.115504] [c5] 7f80: 00000000 c07dcc88 d1837f88 d1837f88 d3081cd4 c0053e2c 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.124267] [c5] 7fa0: 00000000 d1837fb0 c000e9a0 c0053e38 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.133030] [c5] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.141794] [c5] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 000002df 00000001
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.150556] [c5] Backtrace:
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.153796] [c5] [<bf0c9048>] (__cow_file_range+0x0/0x610 [btrfs]) from [<bf0c9a98>] (run_delalloc_nocow+0x440/0xb74 [btrfs])
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.165255] [c5] [<bf0c9658>] (run_delalloc_nocow+0x0/0xb74 [btrfs]) from [<bf0ca604>] (run_delalloc_range+0x36c/0x3b8 [btrfs])
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.176917] [c5] [<bf0ca298>] (run_delalloc_range+0x0/0x3b8 [btrfs]) from [<bf0e11b4>] (__extent_writepage+0x8c8/0x9cc [btrfs])
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.188709] [c5] [<bf0e08ec>] (__extent_writepage+0x0/0x9cc [btrfs]) from [<bf0e17c0>] (extent_writepages+0x244/0x370 [btrfs])
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.200203] [c5] [<bf0e157c>] (extent_writepages+0x0/0x370 [btrfs]) from [<bf0c48f8>] (btrfs_writepages+0x30/0x34 [btrfs])
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.211234] [c5] [<bf0c48c8>] (btrfs_writepages+0x0/0x34 [btrfs]) from [<c00f5f08>] (do_writepages+0x34/0x48)
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.221126] [c5] [<c00f5ed4>] (do_writepages+0x0/0x48) from [<c00ebae4>] (__filemap_fdatawrite_range+0x5c/0x64)
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.231361] [c5] [<c00eba88>] (__filemap_fdatawrite_range+0x0/0x64) from [<c00ecb58>] (filemap_fdatawrite_range+0x2c/0x34)
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.242549] [c5]  r5:7fffffff r4:ffffffff
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.246896] [c5] [<c00ecb2c>] (filemap_fdatawrite_range+0x0/0x34) from [<bf0dadac>] (btrfs_wait_ordered_range+0x74/0x16c [btrfs])
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.258513] [c5]  r5:7fffffff r4:ffffffff
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.263003] [c5] [<bf0dad38>] (btrfs_wait_ordered_range+0x0/0x16c [btrfs]) from [<bf103748>] (__btrfs_write_out_cache+0x744/0x980 [btrfs])
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.275614] [c5] [<bf103004>] (__btrfs_write_out_cache+0x0/0x980 [btrfs]) from [<bf103d04>] (btrfs_write_out_cache+0x90/0xd0 [btrfs])
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.287762] [c5] [<bf103c74>] (btrfs_write_out_cache+0x0/0xd0 [btrfs]) from [<bf0b0a24>] (btrfs_write_dirty_block_groups+0x64c/0x75c [btrfs])
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.300613] [c5] [<bf0b03d8>] (btrfs_write_dirty_block_groups+0x0/0x75c [btrfs]) from [<bf0bf080>] (commit_cowonly_roots+0x168/0x28c [btrfs])
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.313456] [c5] [<bf0bef18>] (commit_cowonly_roots+0x0/0x28c [btrfs]) from [<bf0c0c28>] (btrfs_commit_transaction+0x494/0xbc8 [btrfs])
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.325776] [c5] [<bf0c0794>] (btrfs_commit_transaction+0x0/0xbc8 [btrfs]) from [<bf0b942c>] (transaction_kthread+0x17c/0x1dc [btrfs])
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.337835] [c5] [<bf0b92b0>] (transaction_kthread+0x0/0x1dc [btrfs]) from [<c0053ee0>] (kthread+0xb4/0xc0)
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.347542] [c5] [<c0053e2c>] (kthread+0x0/0xc0) from [<c000e9a0>] (ret_from_fork+0x14/0x20)
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.356118] [c5]  r7:00000000 r6:00000000 r5:c0053e2c r4:d3081cd4
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.362354] [c5] Code: 0a000021 e3510000 03500001 0afffece (e7f001f2)
    Dec 13 12:24:59 Archimedes-I kernel: [3361891.369058] [c5] ---[ end trace 9728a729a64094a3 ]---
    Dec 13 12:28:46 Archimedes-I kernel: [3362118.317402] [c3] btrfs: defrag_file cancelled

另一个更新

尝试进行重新平衡后,内核会在每次安装时不断发出消息。最终,诸如mount和umount甚至ls之类的命令将永远卡在syscalls中。btrfs检查显示了很多错误,并且驱动器的剩余可用空间为零(元数据已全部使用)。

我最终安装了驱动器

sudo mount -o skip_balance,recovery,noatime /dev/sda1 /mnt/hdd_0

将驱动器上的所有2TB数据复制到备用ext4磁盘上,然后重新启动,重新格式化btrfs驱动器,然后再复制所有内容。

LESSON:从3.10内核开始(已有两年的历史),btrfs-convert  不好用,并且该内核有故障。糟糕!

因此,我不会打扰btrfs-convert。看起来这是一个不错的解决方案,但是最好将所有数据从驱动器上复制下来,进行格式化,然后再将其复制回去。


2

只是一个数据点而已...

我只是尝试转换一个200G分区并使用btrfs-tools V4.0,但在报告“没有足够的可用空间”(部分覆盖进度信息)后失败了-实际上似乎崩溃了。

# btrfs-convert -l trial /dev/trial/home
creating btrfs metadata.
not enough free space244027/    240502]
extent-tree.c:2628: btrfs_reserve_extent: Assertion `ret` failed.
btrfs-convert[0x41025d]
btrfs-convert[0x410281]
btrfs-convert(btrfs_reserve_extent+0x883)[0x41465e]
btrfs-convert(btrfs_alloc_free_block+0x63)[0x414715]
btrfs-convert(__btrfs_cow_block+0x101)[0x408edd]
btrfs-convert(btrfs_cow_block+0x89)[0x40948c]
btrfs-convert[0x409f57]
btrfs-convert[0x40a6a2]
btrfs-convert(btrfs_search_slot+0x7b3)[0x40b8a1]
btrfs-convert(btrfs_csum_file_block+0x26b)[0x417ee4]
btrfs-convert[0x42a062]
btrfs-convert[0x42a41d]
/lib/x86_64-linux-gnu/libext2fs.so.2(+0x147bd)[0x7f463c1f97bd]
/lib/x86_64-linux-gnu/libext2fs.so.2(+0x149ad)[0x7f463c1f99ad]
/lib/x86_64-linux-gnu/libext2fs.so.2(+0x154ab)[0x7f463c1fa4ab]
/lib/x86_64-linux-gnu/libext2fs.so.2(ext2fs_block_iterate2+0x2c [0x7f463c1faa7c]

fsck报告没有问题,并且文件系统仍然挂载:

# fsck -f /dev/trial/home
fsck from util-linux 2.26.2
e2fsck 1.42.12 (29-Aug-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/mapper/trial-home: 240502/13107200 files (19.2% non-contiguous), 52237869/52428800 blocks

有趣的一点是,所报告的进度超过了100%,即244027/240502。也许有人可以弄清楚它在计数什么?

无论如何,结论是200G(已使用的99.7%)中的744M没有足够的可用空间!

FWIW,我认为btrfs-convert会在销毁(复制和覆盖)1Mb(表明它是EXT4文件系统)之前将所有元数据保存到位。在执行该步骤之前,没有任何要撤消的内容。它只是在自由空间中书写。也许这也可以得到证实?


1

如果启用校验和(默认),则转换必须计算这些值,然后将其存储在元数据中。因此,基本上它是在转换中读取整个硬盘...您可以在转换中禁用校验和,但是这会禁用btrfs完整性检查和数据清理...

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.