80
votes
Accepted
What happens if the limit of 4 billion files was exceeded in an ext4 partition?
Presumably, you'll be seeing some flavor of "No space left on device" error:
# truncate -s 100M foobar.img
# mkfs.ext4 foobar.img
Creating filesystem with 102400 1k blocks and 25688 inodes
---> ...
80
votes
Accepted
Filesystem copied to new server is 60% bigger - why
I can think of two things offhand:
you didn't use -H, so hardlinks are lost.
you didn't use -S, so sparse files may have been expanded
63
votes
Accepted
Why does "ls" take extremely long in a small directory that used to be big? How to fix this?
A directory that used to be huge may still have a lot of blocks allocated for directory entries (= names and inode numbers of files and sub-directories in that directory), although almost all of them ...
52
votes
What happens if the limit of 4 billion files was exceeded in an ext4 partition?
Once the limit is reached, subsequent attempts to create files will fail with ENOSPC, indicating that the target file system has no room for new files.
In the scenario you describe, this will ...
52
votes
Accepted
When is ext5 coming or when will ext4 be updated to support large (huge) SSDs?
64-bit ext4 file systems can be up to 64ZiB in size with 4KiB blocks, and up to 1YiB in size with 64KiB blocks, no need for an ext5 to handle large volumes. 1 YiB, one yobibyte, is 10248 bytes.
There ...
46
votes
Why does "ls" take extremely long in a small directory that used to be big? How to fix this?
Out of curiosity, let's try to reproduce this:
$ mkdir test
$ cd test
$ time ls # Check initial speed of ls
real 0m0,002s
$ stat . # Check initial size of directory
File: .
Size: 4096 ...
45
votes
Accepted
How to make an ext4 formatted usb drive with full RW permissions for any linux machine?
Like any unix-style filesystem, ext4 includes standard Unix file ownership and permission conventions. That is, the user is identified by an UID number, and each user will belong to one or more groups,...
38
votes
Accepted
inode extent tree "could be shorter" message during fsck: what does it mean?
They mean that e2fsck determined that an extent tree (a data structure used to point to data in the file system) could be restructured to have less depth (presumably because it tracked extents in the ...
35
votes
Birth is empty on ext4
The xstat function never got merged into mainline. However, a new statx call was proposed later on, and was merged in Linux 4.11. The new statx(2) system call does include a creation time in its ...
32
votes
fsck won't fsck (unable to set superblock flags)
I just ran into this same problem. After debugging the issue with the e2fsck maintainer, we realised that the SD card was broken. It was accepting writes without error, but it wasn't actually ...
28
votes
Accepted
mount ext4 disk: cannot mount /dev/sdc read-only
I had a similar problem with a USB thumb drive which was down to the ext4 journal recovery not working. dmesg confirmed this:
[1455125.992721] EXT4-fs (sdh1): INFO: recovery required on readonly ...
27
votes
How to create a hard link to an inode (ext4)?
AFAIK, not with the kernel API. If such an interface existed, it would have to be limited to the super-user as otherwise that would let anyone access files in directories they don't have search access ...
26
votes
Accepted
What happens when I kill 'cp'? Is it safe and does it have any consequences?
This is safe to do, but naturally you may not have finished the copy.
When the cp command is run, it makes syscalls that instruct the kernel to make copies of the file. A syscall, or system call, is a ...
25
votes
Accepted
Actual content of a symlink file
You didn't provide additional details, so this explanation is for the moment centered on the EXT file systems common in Linux.
If you look at the "size" of a symlink as provided by e.g. ls -...
24
votes
When is ext5 coming or when will ext4 be updated to support large (huge) SSDs?
The 64bit ext4 filesystem feature removes the 232 block limit. If this feature was not enabled when your filesystem was created, you can add it to the superblock using tune2fs(8):
tune2fs -O 64bit /...
23
votes
Accepted
What should I do to force the root filesystem check (and optionally a fix) at boot?
ext4 filesystem check during boot
Tested on OS: Linux Mint 18.x in a Virtual Machine
Basic information
/etc/fstab has the fsck order as the last (6th) column, for instance:
<file system> &...
23
votes
What happens when I kill 'cp'? Is it safe and does it have any consequences?
Since cp is a userspace command, this does not affect filesystem integrity.
You of course need to be prepared that at least one file will not have been copied completely if you kill a runnning cp ...
23
votes
Accepted
Should I answer yes to "Clone multiply-claimed blocks<y>?" when running e2fsck?
Multiply-claimed blocks are blocks which are used by multiple files, when they shouldn’t be. One consequence of that is that changes to one of those files, in one of the affected blocks, will also ...
22
votes
Does any file system implement Copy on Write mechanism for CP?
From cp man page:
When --reflink[=always] is specified, perform a lightweight copy, where the data blocks are copied only when modified. If this is not possible the copy fails, or if --reflink=auto ...
22
votes
How do I determine the block size for ext4 and btrfs filesystems?
You could use stat -f to get an answer of any filesystem, eg.:
% stat -f /home
File: "/home"
ID: 5013a37be3cd6a47 Namelen: 255 Type: ext2/ext3
Block size: 4096 Fundamental ...
22
votes
Accepted
Reset ext4 filesystem without changing the filesystem UUID
Since you're using ext4 you could format the filesystem and the set the UUID to a known value afterwards.
man tune2fs writes,
-U UUID Set the universally unique identifier (UUID) of the filesystem to ...
21
votes
Accepted
Why directory with large amounts of entries does not shrink in size after entries are removed?
Quoting a developer (in a linux kernel thread ext3/ext4 directories don't shrink after deleting lots of files):
On Thu, May 14, 2009 at 08:45:38PM -0400, Timo Sirainen wrote:
>
> I was rather ...
20
votes
Accepted
Why do I have "errors=remount-ro" option in my ext4 partition in my Linux?
It is perfectly valid for ext4, and is defined in the ext4 manpage:
errors={continue|remount-ro|panic}
Define the behavior when an error is encountered. (Either
ignore errors ...
20
votes
Accepted
Minimalistic ext4 filesystem without journal and other advanced features
Or you could simply use ext2
For ext4:
mke2fs -t ext4 -O ^has_journal,^uninit_bg,^ext_attr,^huge_file,^64bit [/dev/device or /path/to/file]
man ext4 contains a whole lot of features you can disable (...
19
votes
Minimalistic ext4 filesystem without journal and other advanced features
Forgive me for challenging your requirements, but what are you trying to achieve by switching these features off? Space on disk? Performance? ...?
I’m struggling to understand why you'd want a ...
18
votes
Millions of (small) text files in a folder
This is perilously close to an opinion-based question/answer but I'll try to provide some facts with my opinions.
If you have a very large number of files in a folder, any shell-based operation that ...
18
votes
Accepted
How much disk space is occupied by a filesystem's metadata?
Looks like the filesystem reserves some space to store something like inodes and journal (what else?)
I encourage people to consider "inode" an implementation detail, leaked to something ...
17
votes
Accepted
How do I determine the block size for ext4 and btrfs filesystems?
You'll want to look at the data block allocation size, which is the minimum block that any file can allocate. Large files consist of multiple blocks. And there's always some "waste" at the ...
17
votes
How to get transparent drive or folder compression for Ext4 partition used by Debian, Ubuntu and Linux Mint?
ext4 doesn't support compression, for that you need to use either Btrfs or ZFS (available in Ubuntu since 19.10 but it's still experimental).
Compression can be also configured on block device level ...
17
votes
Reset ext4 filesystem without changing the filesystem UUID
You can use -U with mkfs.ext4 to specify your own UUID so when re-creating the filesystem you can simply reuse the previous UUID.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
ext4 × 1016filesystems × 345
linux × 207
data-recovery × 93
partition × 81
mount × 67
debian × 60
inode × 56
ubuntu × 53
fsck × 53
hard-disk × 45
ext3 × 44
lvm × 36
ntfs × 35
files × 32
btrfs × 30
disk-usage × 29
disk × 27
luks × 27
corruption × 27
permissions × 26
ssd × 26
xfs × 26
superblock × 26
journaling × 26