Questions tagged [ext4]

Ext 4 is a linux filesystem.

Ext4 is a filesystem mostly used under linux. Other versions are ext, ext2 and ext3.

See Wikipedia for details on ext and ext4.

316 questions
4
votes
0 answers

Performance penalty for sparse files?

Sparse files can significantly reduce the storage requirements for a file that has large "empty" portions. But does the increased bookkeeping for these sparse regions materially impact access performance? This will, of course, depend on the file…
Tony the Pony
  • 40,327
  • 71
  • 187
  • 281
4
votes
2 answers

Are there any persistence guarantees when using memory mapped files or plain Stream.Write

I have lots of data which I would like to save to disk in binary form and I would like to get as close to having ACID properties as possible. Since I have lots of data and cannot keep it all in memory, I understand I have two basic approaches: Have…
Lou
  • 4,244
  • 3
  • 33
  • 72
4
votes
0 answers

Why does a 1-byte size file occupies 8 blocks in hard drive in ext4 filesystem?

I've ran into a scenario where I've created a simple plain text file with just one ASCII letter: a. I checked the file size with stat and here's what I got: $ stat file File: 'file' Size: 1 Blocks: 8 IO Block: 4096 regular…
GIZ
  • 4,409
  • 1
  • 24
  • 43
4
votes
2 answers

touch timestamp accuracy on EXT4

Update: Turns out I was being very stupid. I was checking the modification time when I should be checking the access time. The reason it was not reproducible was that the test files were made with dd if=/dev/urandom of="$target" bs='1K' count=1 ||…
l0b0
  • 55,365
  • 30
  • 138
  • 223
4
votes
1 answer

Intel NVMe drive Performance degradation with xfs filesystem with sector size other than 4096

I am working with NVMe card on linux(Ubuntu 14.04). I am finding some performance degradation for Intel NVMe card when formatted with xfs file system with its default sector size(512). or any other sector size less than 4096. In the experiment I …
Christina Jacob
  • 665
  • 5
  • 17
4
votes
0 answers

Java ext4 slow file reading on big folder

I have folder with two million of images 1-2KB. I try to read for (File f : tmpDir.listFiles()) { long t1 = System.currentTimeMillis(); image = ImageIO.read(f); long time = System.currentTimeMillis() - t1; } first 20,000 files time = 0 or…
user1367713
  • 286
  • 2
  • 4
  • 11
4
votes
1 answer

why system call unlink so slow?

#include #include void dump_log(int size){ char cmd[1024]; snprintf(cmd, sizeof(cmd)/sizeof(cmd[0]), "dd if=/dev/zero of=from.bin bs=1024 count=%d", size); int ret = system(cmd); if (ret<0){ …
zzn
  • 2,376
  • 16
  • 30
4
votes
0 answers

Read/write data using mmap for encrypted file system

I am working on an encrypted filesystem that encrypts data just before writing it to disk and decrypts it right after reading from disk. Any file in disk is useless if not decrypted first. so far I changed standard read and write methods that…
Amir H
  • 482
  • 4
  • 10
4
votes
2 answers

Schrödinger's file

I am puzzled by the following sequence of commands. sh-4.2$ pwd /home/willard sh-4.2$ ls -l f -rwxr-xr-x 1 willard users 59116 Jan 23 14:54 f sh-4.2$ file f f: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared…
willardthor
  • 281
  • 2
  • 6
4
votes
1 answer

open file on a specific block in Linux

For debugging purposes, I want to open a file on a specific predefined block. For instance, if I suspect a specific block is damaged, I want to write and read from it, and I'd rather do that in user mode, while the partition is mounted. Is there a…
mikebloch
  • 1,577
  • 11
  • 21
3
votes
1 answer

configure default mount options in yocto

I have a yocto meta layer which build a complete Linux distribution for an embedded system. It is based on 'dunfell' (3.1.11) branch of yocto and using the linux mainline kernel 5.10.57. The file system which I use is ext4 and the /etc/fstab file…
moudi
  • 478
  • 4
  • 17
3
votes
0 answers

Question about differences using fscrypt on ubifs compared with ext4

I am working on an embedded Linux project that can run on multiple platforms. One uses e.MMC for storage and another NAND flash. I want to encrypt all the filesystems (mainly to protect against someone unsoldering the flash chips and putting them in…
Ivan Barr
  • 31
  • 2
3
votes
1 answer

How is filename lookup done in ext4?

Env: Linux Kernel 5.3; FS: ext4 When requesting stat(const char *pathname, struct stat *statbuf) how is the const char *pathname is checked for existence? It is necessary since in case there is no such path stat returns -1 (ENOENT). Here is the…
Some Name
  • 8,555
  • 5
  • 27
  • 77
3
votes
1 answer

File timestamps precision - ext3 with nanoseconds, ext4 with milliseconds

It is said that ext3 supports file timestamp precision up to seconds and ext4 up to nanoseconds... What happens is that my old VPS running Ubuntu 12.04 with a ext3 filesystem always (as far as I can remember) supported nanoseconds very nicely, like…
Ricardo
  • 31
  • 2
3
votes
0 answers

How to use Data Blocks for building an Extent Tree?

I am building an extent-based File System for a school project. I wanted to use an ext4-like design with its Extent Trees, but I don't understand how exactly the Extent Trees are built. As far as I understood, there is one inode per one file and…
nataliamo
  • 66
  • 6