My 3 NAS drives show this level of fragmentation with
sudo fsck.ext2 -fn /dev/sd_1
2.8%
7.7%
17.0%
ext4 is believed to be unfragmentable, but I'm wondering if 17% frag is why that disk is showing slow performance.
sudo fsck.ext2 -fn /dev/sdb1
e2fsck 1.44.5 (15-Dec-2018)
Warning! /dev/sdb1 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Inode 164364376 extent tree (at level 1) could be narrower. Optimize? no
Inode 164364378 extent tree (at level 1) could be narrower. Optimize? no
Inode 164364404 extent tree (at level 1) could be narrower. Optimize? no
Inode 164364488 extent tree (at level 1) could be narrower. Optimize? no
Inode 164364543 extent tree (at level 1) could be narrower. Optimize? no
Inode 164364560 extent tree (at level 1) could be narrower. Optimize? no
Inode 164364621 extent tree (at level 1) could be narrower. Optimize? no
Inode 164495635 extent tree (at level 1) could be narrower. Optimize? no
Inode 164496749 extent tree (at level 1) could be narrower. Optimize? no
Inode 164496798 extent tree (at level 1) could be narrower. Optimize? no
Inode 164496882 extent tree (at level 2) could be narrower. Optimize? no
Inode 164626683 extent tree (at level 1) could be narrower. Optimize? no
Inode 164757580 extent tree (at level 1) could be narrower. Optimize? no
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (335041402, counted=311261078).
Fix? no
Free inodes count wrong (183143227, counted=183143222).
Fix? no
asdf: 5317/183148544 files (17.0% non-contiguous), 397524870/732566272 blocks
Alles anzeigen
One 25 GB file shows 51 extants which supposedly isn't supposed to have perf impact:
filefrag -v /qwer/zxcv.mkv
Filesystem type is: ef53
File size of /qwer/zxcv.mkv is 25021423581 (6108746 blocks of 4096 bytes)
ext: logical_offset: physical_offset: length: expected: flags:
0: 0.. 63487: 34816.. 98303: 63488:
1: 63488.. 96255: 100352.. 133119: 32768: 98304:
2: 96256.. 116735: 133120.. 153599: 20480:
3: 116736.. 124927: 155648.. 163839: 8192: 153600:
4: 124928.. 129023: 81889280.. 81893375: 4096: 163840:
5: 129024.. 131071: 81895424.. 81897471: 2048: 81893376:
6: 131072.. 135167: 81901568.. 81905663: 4096: 81897472:
7: 135168.. 137215: 81907712.. 81909759: 2048: 81905664:
8: 137216.. 139263: 81911808.. 81913855: 2048: 81909760:
9: 139264.. 143359: 82010112.. 82014207: 4096: 81913856:
10: 143360.. 167935: 81985536.. 82010111: 24576: 82014208:
11: 167936.. 217087: 82018304.. 82067455: 49152: 82010112:
12: 217088.. 264191: 82069504.. 82116607: 47104: 82067456:
13: 264192.. 266239: 82147328.. 82149375: 2048: 82116608:
14: 266240.. 270335: 108972032.. 108976127: 4096: 82149376:
15: 270336.. 272383: 108922880.. 108924927: 2048: 108976128:
16: 272384.. 276479: 216598528.. 216602623: 4096: 108924928:
17: 276480.. 280575: 216606720.. 216610815: 4096: 216602624:
18: 280576.. 284671: 216614912.. 216619007: 4096: 216610816:
19: 284672.. 288767: 216623104.. 216627199: 4096: 216619008:
20: 288768.. 294911: 216643584.. 216649727: 6144: 216627200:
21: 294912.. 299007: 216633344.. 216637439: 4096: 216649728:
22: 299008.. 303103: 216653824.. 216657919: 4096: 216637440:
23: 303104.. 309247: 216664064.. 216670207: 6144: 216657920:
24: 309248.. 315391: 216676352.. 216682495: 6144: 216670208:
25: 315392.. 323583: 216688640.. 216696831: 8192: 216682496:
26: 323584.. 329727: 216705024.. 216711167: 6144: 216696832:
27: 329728.. 337919: 216717312.. 216725503: 8192: 216711168:
28: 337920.. 344063: 216733696.. 216739839: 6144: 216725504:
29: 344064.. 352255: 216748032.. 216756223: 8192: 216739840:
30: 352256.. 360447: 216764416.. 216772607: 8192: 216756224:
31: 360448.. 368639: 216780800.. 216788991: 8192: 216772608:
32: 368640.. 372735: 216565760.. 216569855: 4096: 216788992:
33: 372736.. 376831: 216573952.. 216578047: 4096: 216569856:
34: 376832.. 380927: 216582144.. 216586239: 4096: 216578048:
35: 380928.. 385023: 216590336.. 216594431: 4096: 216586240:
36: 385024.. 387071: 241104896.. 241106943: 2048: 216594432:
37: 387072.. 450559: 241108992.. 241172479: 63488: 241106944:
38: 450560.. 942079: 241205248.. 241696767: 491520: 241172480:
39: 942080.. 1433599: 241729536.. 242221055: 491520: 241696768:
40: 1433600.. 1925119: 242253824.. 242745343: 491520: 242221056:
41: 1925120.. 2416639: 242778112.. 243269631: 491520: 242745344:
42: 2416640.. 2779135: 243302400.. 243664895: 362496: 243269632:
43: 2779136.. 2906111: 243666944.. 243793919: 126976: 243664896:
44: 2906112.. 3397631: 243826688.. 244318207: 491520: 243793920:
45: 3397632.. 3889151: 244350976.. 244842495: 491520: 244318208:
46: 3889152.. 4380671: 244875264.. 245366783: 491520: 244842496:
47: 4380672.. 4872191: 245399552.. 245891071: 491520: 245366784:
48: 4872192.. 5363711: 245923840.. 246415359: 491520: 245891072:
49: 5363712.. 5855231: 246448128.. 246939647: 491520: 246415360:
50: 5855232.. 5959679: 246972416.. 247076863: 104448: 246939648:
51: 5959680.. 6108745: 247078912.. 247227977: 149066: 247076864: last,eof
/qwer/zxcv.mkv: 51 extents found
Alles anzeigen
My NAS is mostly a media server with typical single files running 10-70 GB. I either write the files from Windows with SMB or write them with nzbget. the system is an ARM odroid hc4.
I know I am on omv 5.x but I intend to upgrade very soon. While I'm upgrading I'd like to see if I can prevent this level of fragmentation, possibly by tuning ext4 parameters. Or am I totally barking up the wrong tree? Web sources on ext4 fragmentation say it doesn't even exist, so I can't trust them to be authoritative on its impact (especially on an rpi-3 equivalent arm box).
I did find some interesting links: