Questions tagged [ext4]
ext4 (fourth extended filesystem) is a journalling file system for Linux, developed as the successor to ext3. Use this tag for question that are ext4 specific, generic file system related questions should use tag [filesystem]
1,020 questions
9
votes
2
answers
541
views
How to resize ext4 without adding more inodes?
On this filesystem, there are enough inodes already, I only need more filesystem size:
# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/mapper/spinning-backup ...
1
vote
1
answer
44
views
How to dump the lost+found content from an ext4 img file that cannot be mounted using debugfs in linux and keep the folder hierarchy?
How to dump the lost+found content from an ext4 img file that cannot be mounted using debugfs in linux and keep the folder hierarchy?
My ext4 disk was failing. I made a disk image.
I tried e2fsck and ...
9
votes
2
answers
2k
views
Which Linux file system should I use for compatibility with Windows programs?
I'm new to Linux, yet am now committing to Linux, probably formatting HDDs to run the ext4 file-system, for (almost) all work. I need to keep one Windows machine running an NTFS file-system for a few ...
1
vote
0
answers
34
views
How to add user to group in docker bind?
I have a docker container with a bind to a the local fs.
../htdocs:/var/www/html
The docker container creates folders and files in /var/www/html with apparent userid 33 and groupid 33. Both do not ...
0
votes
0
answers
37
views
Does ext4 allow partial update of unwritten to written extents in O_DIRECT case
O_DIRECT allows writes on a file to proceed with i_rwsem in read mode.
Let's say I have allocated 100 fs blocks(4K) for a file with posix_fallocate(). This now becomes an unwritten extent for the file....
6
votes
2
answers
1k
views
How to quickly wipe ext4 superblocks on a NVMe SSD? Secure erase?
Based on this question: How to erase/wipe all ext4 metadata, not just the filesystem signature 53 ef?
My SSD is under warranty and I shall hand it over today, so excuse me for the hurry now.
It ...
2
votes
1
answer
127
views
Is it possible to recover deleted files from a qcow2 disk in Proxmox using extundelete or ext4magic?
I’m running a Proxmox VM with a qcow2 disk (Ubuntu guest, ext4 filesystem). I tried to recover a recently deleted file using extundelete and ext4magic, but both tools failed to find the file, even ...
4
votes
2
answers
1k
views
How much disk space is occupied by a filesystem's metadata?
My disk is partitioned like this:
# fdisk -l /dev/nvme0n1
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 411647 409600 200M EFI System
/dev/nvme0n1p2 ...
1
vote
2
answers
180
views
Does badblock "fix" blocks on an SD card?
I have an old 16GB SD card that started giving I/O errors, known it's gone bad, I dumped all the content to an image file to see what I could restore, and the Disk manager alerted me that 16.1MB were ...
3
votes
1
answer
118
views
Is it a good idea to have inode size of 2048 bytes + inline_data on an ext4 filesystem?
I only recently "discovered" the inline_data feature of ext4, although it seems to have been around for 10+ years.
I ran a few statistics on various of my systems (desktop/notebook + server),...
0
votes
1
answer
118
views
ext4 block allocation
I'm trying to understand how ext4 does some things. I have a small ext4 partition with block size 1024 (not the default 4096). I create a directory there and delete lost+found, just to get it out of ...
2
votes
1
answer
411
views
“Bad magic number in super-block” after a dd of Mobian (Debian) image
General overview
I try to install the Mobian OS on my Pinephone thought the dd’s method as described in the official Debian documentation. Basically, I have to make a dd from an image to a partition ...
-5
votes
1
answer
82
views
Why does the Use% shown by the df command not reflect the correct value? [closed]
On our RHEL 7.9 systems, we have noticed some strange behavior.
Each machine has 4 disks, each with an 8TB capacity, but we are only using about 1.9TB on a partition.
What doesn’t make sense is that ...
1
vote
2
answers
162
views
Files that end with a period are inaccessible on an exFAT drive
I have a backup that was copied from Linux (ext4) to an exFAT filesystem.
File and directory names that end with a period are inaccessible.
I can (partly) list them, but ls behaves strangely.
It ...
0
votes
0
answers
89
views
Not able to modify inode metadata
I am working on a ext4 file-system tool that aims to delete files such that they are not recoverable later on. My goal is to clear the inode metadata of a deleted file, but despite my efforts, the ...
3
votes
3
answers
948
views
How to determine, with certainty, the filesystem type of a partition from the outputs of the Linux "file -s" command?
My problem is to decode the output of the command file -s /dev/sdX on my system (where /dev/sdX is the device file associated to a USB key).
Below I'll show the output of the command file -s /dev/sdX ...
0
votes
1
answer
316
views
Journaling block device (jbd2) hammering my SSD
Ubuntu MATE 24.04 LTS
System monitor in panel shows something like all day long. Hovering the mouse over the image shows disk usage hitting 83.3% at those peaks.
When I run sudo iotop, an item that ...
0
votes
0
answers
31
views
U-Boot dub-2017.03: ext4fs_devread read outside partition 1068475736 Error loading firmware file to RAM
I'm trying to update the recovery image from sdcard to recovery partition using Uboot command below
update recovery mmc 1 fat recovery.ext2
Update is successful when the image size is 479MB and fails ...
2
votes
1
answer
127
views
Why does inode usage go from 1% to 100% on a single file creation?
Inode usage go from 1 to 100% on a single file creation in a raid array on Debian.
First, clean boot, then:
sudo cryptsetup luksOpen /dev/RaidVG/LVMVol CVol
sudo mount /dev/mapper/CVol /mnt/raid/
...
0
votes
0
answers
54
views
ubuntu system freeze while diff reading, SysRq REISUB not working
I've experienced total system freeze while checking if files where copied correctly by
diff -rq [INTERNAL HDD] [USB HDD]
This happened twice, always while running the diff. On the second occasion I ...
1
vote
1
answer
83
views
How to calculate the checksum of a ext4 (eg. superblock or inode)
I have an image-file of an ext4 file system (filesystem.img). I am extracting sections sections of the filsystem. Is there a way to manually calculate the the checksum of the sections just with a ...
0
votes
1
answer
98
views
Why is it necessary when expanding an ext4 filesystem over space before it to copy the data?
I had a dual-boot setup on my laptop, with the Windows partition first, then Linux. I decided to delete Windows, so I removed its partition and expanded the Linux partition into its space using ...
0
votes
0
answers
51
views
How many Group Descriptor is there in GDT of Ext4?
GDT = Group Descriptor Table ; GD = Group Descriptor. I'm trying to figure out how many bytes I need to read after the superblock to extract the entire GDT, because it's needed for a program I'm ...
0
votes
1
answer
82
views
LUKS2 + EXT4 on HDD doing random read after mount for ~3 minutes
Steps to reproduce:
Use a single USB HDD with LUKSv2 and formatted with ext4 defaults (except 10 reserved blocks only, not 5%);
Use Ubuntu or Debian with Gnome which allows to unlock the HDD;
Trying ...
0
votes
0
answers
51
views
Does nautilus warn before starting copy/move of files into ext4 partition which is too small?
As a user with non root privileges, when copy/moving a bounch of folders and files, in one batch, from some device into another different partition which is ext4 and too small (space allocated to user)...
1
vote
1
answer
431
views
procedure for mdadm in-place RAID5 to RAID6 upgrade
I have a debian host configured as a NAS using 6 disks in a RAID 5 setup. The current configuration is as follows:
# mdadm -D /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Fri Mar ...
2
votes
1
answer
614
views
How do I actually fix a badly corrupted (but with hardware OK) ext4 system?
While creating an install USB disk, I made the trivial error of indicating the wrong device, and ended up overwriting the initial few hundred megabytes of a 230 GB disk.
The data was not extremely ...
1
vote
0
answers
83
views
rsync keeps changing two directories
I am trying to synchronise a directory from a local ext4 filesystem to three FreeBSD ufs filesystems using rsync. Here is my setup:
Local machine running GNU/Linux, ext4 filesystem mounted at /mnt
...
1
vote
1
answer
84
views
Recover mis-gzipped folder / directory & files
I needed to compress/archive a folder, so I ran the following command:
gzip -v --rsyncable --fast -r myFolder/ -c > myFolderArchive.gz
...foolishly thinking this was going to do just what I ...
0
votes
0
answers
20
views
`du` reports wildly different sizes for the same folder depending on arguments [duplicate]
While working on a Seafile server migration, I noticed my rsync of the data took quite a bit longer than I calculated it should. I ended up noticing that some of the directories were already bigger on ...
1
vote
1
answer
280
views
Linux extract .zip and preserve all original files timestamps (created/modified/accessed)
It's possible to restore original file timestamps during extraction on linux? I'm tested .zip extraction using 7z, unzip, unar, but only modification date is restored.
Environment:
Linux Mint 22
...
1
vote
1
answer
322
views
Is there a way to change the block size of a disk partition without reformatting it?
I tried copying some browser cache files to a separate disk and although the free space was enough the disk run out of space because each small file used took up the minimum disk allocation space.
Is ...
1
vote
0
answers
235
views
Ext4 formatted External HDD is corrupt, need to find backup superblocks
I have an external HDD drive formatted as Ext4 connected to my Raspberry Pi server. The server has been crashing lately and as a consequence the HDD is corrupt. When I plug to my computer and run sudo ...
3
votes
1
answer
175
views
has the default value for bytes-per-inode changed
I was surprised to run out of inodes on a filesystem that was formatted relatively recently. When I compared it to another filesystem that was formatted on an older version of Debian (unfortunately I ...
0
votes
1
answer
86
views
How do I empty the Kernel Keyring Buffer withouta restart?
I'm planning on using the Ext4 file encryption ability. Everything works fine, but there is one problem left. After removing the PASSWORD via keyctl, i still can see the content of the encrypted ...
1
vote
0
answers
89
views
Power failure while appending to ext4 file results in spurious zeros
I have an embedded device which appends data to an ext4 file in data = ordered mode until its power is cut off. To my surprise, I've noticed that this occasionally results in zeros being appended to ...
0
votes
1
answer
249
views
Determine bytes per inode ratio of existing ext4 filesystem
I created a filesystem following this guide: https://wiki.archlinux.org/title/Ext4#Create_a_new_ext4_filesystem
However it looks like I made a mistake because the ratio for /dev/sdc doesn't add up:
...
1
vote
1
answer
191
views
How does the combination of SPARSE_SUPER and FLEX_BG features impact the location of backup super blocks in EXT4?
Edit: I've posted an answer to the following below, but not accepted yet, in the hopes that someone will kindly provide me with a generic calculation for determining whether block group n will have a ...
2
votes
2
answers
582
views
How is it possible to create >65000 entries in an ext4 directory despite the large_dir flag not being present?
So, I'm trying to understand FileSystem feature flags a little bit better.
For what I could find, according to man ext4 a single directory in a ext4 FS can host up to 64,998 subdirectories.
Normally, ...
0
votes
1
answer
117
views
EXT4 Partion Access Increasingly Taking Longer
My home directory lives on an EXT4 partition. A while back, accessing this partition started to be delayed (disk sleep) to the point now where it has become painful
It would appear to have something ...
2
votes
1
answer
343
views
Should I care about ext4 free block/inode/orphan count being wrong?
I have my system to fsck all fs at all reboots. And forced fsck just now. Yet I still get:
$ sudo fsck -vn /dev/lvmroot/root
fsck from util-linux 2.40.2
e2fsck 1.47.1 (20-May-2024)
Warning! /dev/...
1
vote
1
answer
80
views
Accidentally Partially Removed RAID 1 Mount Point. Is My RAID Okay?
I accidentally ran sudo rm -r on my RAID 1 mount point. I immediately realized my error, panicked, and hit CTRL+C to cancel. Some damage was already done. The lost+found directory and some of my data ...
6
votes
2
answers
2k
views
Is ext4 and xfs only for usage with internal file systems?
I am attempting to store some large files and I thought an encrypted ext4 partition would be excellent. However the GNOME Disk Utility appears to state ext4 as for internal disks and xfs only for ...
4
votes
0
answers
134
views
Accidentally ran mkswap on ext4 fs
I accidentally used mkswap on a unmounted 2 TB data partition of a hard drive (not an SSD), while I was on a live USB session. I did not run swapon as I immediately realized what I had just done.
I ...
0
votes
1
answer
189
views
ext4 and chattr ( change attributes ) 's - undo ( u ) option
This is an microsd ext4 card on a rooted Android, where I want to use
busybox chattr -R +u /mypath
I know what +u means but does anyone have an idea about how the undo option is implemented for ext4 ...
6
votes
1
answer
803
views
Hard links on CIFS network mount (ext4) silently falls back to copy operation
I have a CIFS network mount (ext4 on Synology NAS share), and I can't work out why I can't make hard links on that volume – the command is successful and results in a new file, but the new file has ...
0
votes
0
answers
77
views
Very large discrepancy between du and df
OS is Debian. I have a few systems that seem to not be freeing disk space correctly.
On a normal system:
du --max-depth 1 / --exclude=/proc -h -x
Seems to almost exactly agree with:
df -h /
ie, ~800 ...
0
votes
1
answer
227
views
How are EXT4 metadata checksums within group descriptors calculated?
I'm looking at parsing raw EXT4-formatted block devices, just using Python, primarily as a learning exercise, but am having trouble manually generating the expected Group Descriptor checksums - there ...
-1
votes
3
answers
289
views
ext4 filesystem on RHEL 7
I have a RHEL 7 ext4 type filesystem and because of the lack of funding and no backups available I am trying to see if I can import ext4 filesystem from RHEL 7 into RHEL 8.
I have a RHEL 7 with 2 ...
1
vote
2
answers
1k
views
Bad magic number in super-block on external HD after multiple power outages—still OK to use?
I have a computer at home that I use as a file server, using Nextcloud. Every computer at home is Ubuntu/etx4. I've had multiple outages recently in the neighborhood, and I think the sudden shutdowns ...