EXT4 - How To Disable Journaling?


Inimuk

Pandora User
Joined
Aug 22, 2016
Messages
64
Location
Earth
I cannot figure out how to disable journaling on /dev/mmcblk0p1 (it's already a formatted EXT4 part). /dev/mmcblk0p2 is linux-swap.
The appropriate R/W permissions exists for PNDs and sorts but what needs to be done is the appropriate optimizations so the card isn't killed by the filesystem. Can someone help out a fella with the appropriate optimizations?

No problems with having linux-swap enabled, just notice that journaling is actually slowing things down a little.
[doublepost=1473975518,1473972510][/doublepost]Wait, tune2fs is not present. "Command not found."
 
Honestly with 6 years of Pandora ownership I've never bothered with any kind of optimization and all my original SD cards are still working in all three of my Pandori...

If you need tune2fs you can install it via the opkg repo:

sudo opkg update
sudo opkg install e2fsprogs-tune2fs
 
Had to fix it using gparted and mkfs so it kinda worked out anyway (partition was somehow mucked up so reformatted).. No tune2fs needed. Don't think anything else is needed - not going to bother mucking around with fstab entries since it seems to be working fine now.
 
What are the good points by using EXT4 without journalism instead of using EXT2 on an SD card ?
 
What are the good points by using EXT4 without journalism instead of using EXT2 on an SD card ?

2.4. Extents
The traditionally Unix-derived filesystems like Ext3 use an indirect block mapping scheme to keep track of each block used for the blocks corresponding to the data of a file. This is inefficient for large files, specially on large file delete and truncate operations, because the mapping keeps a entry for every single block, and big files have many blocks -> huge mappings, slow to handle. Modern filesystems use a different approach called "extents". An extent is basically a bunch of contiguous physical blocks. It basically says "The data is in the next n blocks". For example, a 100 MB file can be allocated into a single extent of that size, instead of needing to create the indirect mapping for 25600 blocks (4 KB per block). Huge files are split in several extents. Extents improve the performance and also help to reduce the fragmentation, since an extent encourages continuous layouts on the disk.

2.5. Multiblock allocation
When Ext3 needs to write new data to the disk, there's a block allocator that decides which free blocks will be used to write the data. But the Ext3 block allocator only allocates one block (4KB) at a time. That means that if the system needs to write the 100 MB data mentioned in the previous point, it will need to call the block allocator 25600 times (and it was just 100 MB!). Not only this is inefficient, it doesn't allow the block allocator to optimize the allocation policy because it doesn't knows how many total data is being allocated, it only knows about a single block. Ext4 uses a "multiblock allocator" (mballoc) which allocates many blocks in a single call, instead of a single block per call, avoiding a lot of overhead. This improves the performance, and it's particularly useful with delayed allocation and extents. This feature doesn't affect the disk format. Also, note that the Ext4 block/inode allocator has other improvements, described in detail in this paper.

2.6. Delayed allocation
Delayed allocation is a performance feature (it doesn't change the disk format) found in a few modern filesystems such as XFS, ZFS, btrfs or Reiser 4, and it consists in delaying the allocation of blocks as much as possible, contrary to what traditionally filesystems (such as Ext3, reiser3, etc) do: allocate the blocks as soon as possible. For example, if a process write()s, the filesystem code will allocate immediately the blocks where the data will be placed - even if the data is not being written right now to the disk and it's going to be kept in the cache for some time. This approach has disadvantages. For example when a process is writing continually to a file that grows, successive write()s allocate blocks for the data, but they don't know if the file will keep growing. Delayed allocation, on the other hand, does not allocate the blocks immediately when the process write()s, rather, it delays the allocation of the blocks while the file is kept in cache, until it is really going to be written to the disk. This gives the block allocator the opportunity to optimize the allocation in situations where the old system couldn't. Delayed allocation plays very nicely with the two previous features mentioned, extents and multiblock allocation, because in many workloads when the file is written finally to the disk it will be allocated in extents whose block allocation is done with the mballoc allocator. The performance is much better, and the fragmentation is much improved in some workloads.

Source:

https://kernelnewbies.org/Ext4


TL;DR: Performance!
 
Back
Top