Skip to main content
added 293 characters in body
Source Link
Stéphane Chazelas
  • 586.4k
  • 96
  • 1.1k
  • 1.7k

That's because the discard option in mke2fsmke2fs is on by default. In newer kernels, doing a BLK_DISCARDBLKDISCARD on a loop device causes a hole to be punched on the underlying file, so that that file becomes sparse.

On an ATA drive, the BLKDISCARD would translate to a TRIM, the idea being that mke2fs tells the layer underneath that the data is unallocated so it can do optimisations based on that information (unallocate the space in the file for loop devices, recycle flash cells for SSDs...).

If you want to disable that, just do:

mkfs.ext2 -E nodiscard /dev/loop0p1 

That's because the discard option in mke2fs is on by default. In newer kernels, doing a BLK_DISCARD on a loop device causes a hole to be punched on the underlying file, so that that file becomes sparse.

If you want to disable that, just do:

mkfs.ext2 -E nodiscard /dev/loop0p1 

That's because the discard option in mke2fs is on by default. In newer kernels, doing a BLKDISCARD on a loop device causes a hole to be punched on the underlying file, so that that file becomes sparse.

On an ATA drive, the BLKDISCARD would translate to a TRIM, the idea being that mke2fs tells the layer underneath that the data is unallocated so it can do optimisations based on that information (unallocate the space in the file for loop devices, recycle flash cells for SSDs...).

If you want to disable that, just do:

mkfs.ext2 -E nodiscard /dev/loop0p1 
Source Link
Stéphane Chazelas
  • 586.4k
  • 96
  • 1.1k
  • 1.7k

That's because the discard option in mke2fs is on by default. In newer kernels, doing a BLK_DISCARD on a loop device causes a hole to be punched on the underlying file, so that that file becomes sparse.

If you want to disable that, just do:

mkfs.ext2 -E nodiscard /dev/loop0p1