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.

289 questions
31
votes
2 answers

Storing & accessing up to 10 million files in Linux

I'm writing an app that needs to store lots of files up to approx 10 million. They are presently named with a UUID and are going to be around 4MB each but always the same size. Reading and writing from/to these files will always be sequential. 2…
hookenz
  • 30,814
  • 37
  • 149
  • 251
30
votes
3 answers

Is rename() without fsync() safe?

Is it safe to call rename(tmppath, path) without calling fsync(tmppath_fd) first? I want the path to always point to a complete file. I care mainly about Ext4. Is the rename() promised to be safe in all future Linux kernel versions? A usage example…
Ivo Danihelka
  • 3,274
  • 2
  • 29
  • 26
28
votes
3 answers

How many bytes per inodes?

I need to create a very high number of files which are not very large (like 4kb,8kb). It's not possible on my computer cause it takes all inodes up to 100% and I cannot create more files : $ df -i /dev/sda5 Filesystem Inodes IUsed …
oyo
  • 1,876
  • 2
  • 16
  • 22
26
votes
1 answer

How to store one billion files on ext4?

I only created about 8 million files, then there was no free inode in /dev/sdb1. [spider@localhost images]$ df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sdb1 8483456 8483456 0 100% /home Someone says…
redice
  • 7,225
  • 9
  • 29
  • 40
19
votes
4 answers

How to durably rename a file in POSIX?

What's the correct way to durably rename a file in a POSIX file system? Specifically wondering about fsyncs on the directories. (If this depends on the OS/FS, I'm asking about Linux and ext3/ext4). Note: there are other questions on StackOverflow…
Yang
  • 15,052
  • 13
  • 96
  • 137
19
votes
1 answer

Optimal number of files per directory vs number of directories for EXT4

I have a program that produces large number of small files (say, 10,000 files). After they are created, another script accesses them and processes one by one. Questions: does it matter, in terms of performance, how the files are organized (all in…
Jakub M.
  • 27,689
  • 38
  • 101
  • 164
17
votes
1 answer

What file system does Android use?

Which file system does Android use? I have read both ext4 and YAFFS2.
qyanqing
  • 263
  • 1
  • 4
  • 10
16
votes
3 answers

Linux AIO: Poor Scaling

I am writing a library that uses the Linux asynchronous I/O system calls, and would like to know why the io_submit function is exhibiting poor scaling on the ext4 file system. If possible, what can I do to get io_submit not to block for large IO…
void-pointer
  • 12,317
  • 11
  • 40
  • 60
14
votes
0 answers

Directories created by boost::filesystem::create_directories() not immediately accessible?

I am using boost::filesystem::create_directories() to create new directories. When I try to access these directories shortly after creation, I get an error saying: no such directory. But if I sleep for a while after creating directories everything…
polapts
  • 4,757
  • 8
  • 30
  • 44
14
votes
2 answers

what is the max files per directory in EXT4?

What is the limit of EXT4, what i found is only EXT3, and other links only suppositions and not a real number? Can you please provide me: max number per directory, max size?
Abdelouahab Pp
  • 3,506
  • 11
  • 35
  • 64
13
votes
2 answers

ext4/fsync situation unclear in Android (Java)

Tim Bray's article "Saving Data Safely" left me with open questions. Today, it's over a month old and I haven't seen any follow-up on it, so I decided to address the topic here. One point of the article is that FileDescriptor.sync() should be called…
Markus Junginger
  • 6,578
  • 29
  • 48
13
votes
2 answers

Can ext4 detect corrupted file contents?

Can the ext4 filesystem detect data corruption of file contents? If yes, is it enabled by default and how can I check for corrupted data? I have read that ext4 maintains checksums for file metadata and its journal, but I was unable to find any…
Lukas Boersma
  • 940
  • 5
  • 23
11
votes
1 answer

Why does Python give "OSError: [Errno 36] File name too long" for filename shorter than filesystem's limit?

The following code yields an unexpected exception: open("52bbe674cdc81d4140099b84fa69eea4249bcceee75bcbe4838d911ab076547cfdad3c1c5197752a98e5525fe76613dbe52dcdb1a9a397669babce0f101d010142cffa000000.csv", "w") OSError: [Errno 36] File name too long:…
Josh Hansen
  • 587
  • 1
  • 5
  • 16
11
votes
1 answer

What is the maximum number of subdirectories allowed in Ext4?

I am considering moving my ext3 partition to ext4 in order to overcome the 32000 subdirectory limit. I have seen two different numbers thrown around about the limits of ext4, both from reputable sources: Limit of 64,000: ext4.wiki.kernel.org SO…
meawoppl
  • 2,397
  • 21
  • 29
11
votes
1 answer

where are extended attributes stored?

This is a simple question but I've done some research and can't find any answers... So does anyone know if when we define extended attributes through xattr, those attributes are stored within - as a part of - the file'contents(in the biggining, in…
user2900870
  • 187
  • 2
  • 8
1
2 3
19 20