2022 Developer Survey is open! Take survey.

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]

Filter by
Sorted by
Tagged with
0 votes
3 answers
45 views

Manually telling EXT4 about bad sectors?

The drive is currently in NTFS. After running chkdsk for hours, I have found the locations of bad sectors (below). I want to reformat the disk in EXT4. I have heard that EXT4 has some sort of metadata ...
user avatar
0 votes
0 answers
32 views

commit argument in ext4 fs vs commit mount option in fstab

Target Improve the I/O performance of ext4 file system, specifically. Background I got to know about noatime and commit mount options for fstab, and also a warning that the former can be a breaking ...
user avatar
0 votes
1 answer
18 views

How does "Inodes per group" and "lazy_itable_init" flag relate to the "Inode count" value in an ext4 filesystem?

I am trying to root cause a customer case where 2 Identical drives, formatted with the same command, led to a difference of ~55GB in total disk space due to additional Inode overhead. I want to ...
user avatar
  • 19
1 vote
1 answer
69 views

Is it possible to use a file as Filesystem?

Here is the origin of my question: I'm running Linux containers with LXD snap version at Ubuntu 22.04 on a VPS. The root file system of the VPS is Ext4 and there is not additional storage attached. ...
user avatar
  • 121
0 votes
1 answer
55 views

Are commas and dots accepted in folder names? [duplicate]

I have a drive which is formatted EXT4 with GUID partition table. I was wondering if the commas and dots are accepted in directory and file names. I have several ebooks and I would like to store them ...
user avatar
1 vote
1 answer
39 views

Inserting a file without altering the folder's modification timestamp?

I have hundreds of folders with modification timestamps I'd like to preserve. Now I need to copy a single file into them. Aside from this way... timestamp=$(stat -c %y /foldername) cp /tmp/file.jpg /...
user avatar
  • 195
2 votes
1 answer
49 views

How can I stop my Linux virtual machine from writing data to empty disk blocks?

I've got an Ubuntu 20 virtual machine running in qemu that uses a qcow2 disk file with another qcow2 disk file as backing store. The VM was built from a recent Canonical-distributed cloud image with ...
user avatar
0 votes
0 answers
5 views

Recover files with TestDisk but ignore symlinks

I just lost a lot of files (they were deleted, the drives are intact), and I've been trying to recover what I can with TestDisk, but every time I try it eventually misreads a file as a symlink to the ...
user avatar
  • 1
1 vote
1 answer
39 views

Define Data Mode in mkfs.ext4 command

Is there an option to define the default data mode when using mkfs? The command mkfs -t ext4 /dev/sdc1 format a partition as ext4 with default journal mode data=ordered. I could set the data=journal ...
user avatar
  • 111
0 votes
0 answers
41 views

statvfs returns invalid information

My eMMC partition is ext4 formatted and has about 100MB. When I issue statvfs() on that partition, I get huge return value for f_blocks field of struct statvfs. struct statvfs { unsigned long ...
user avatar
2 votes
1 answer
194 views

Restore deleted contents of a text file

Due to this bug, the content of one of my source files was deleted. I searched a lot and found that I can read the raw data on the storage device with the dd command, and I can find the address of ...
user avatar
4 votes
1 answer
103 views

mv on ext4 is doing copy-and-remove instead of inode relocation

I am under the belief that if you mv a file from an ext4 partition to itself, this is done instantly in constant time by updating directory entries and keeping the inode the same. Instead, sometimes I ...
user avatar
  • 771
1 vote
1 answer
35 views

rsync from external vfat disk to local ext4 yields VASTLY different sizes [duplicate]

I found an older external hd I want to reuse for something else. I was doing an rsync of it to a NAS I run over the network but it was taking ages. So I decided to rsync to my local drive first (SSD) ...
user avatar
0 votes
1 answer
32 views

Creating Filesystem on File that has definied size

I know that when you make a new file and create a ext4 filesystem on it with mkfs, the filesystem will be smaller than the file because of the blocksize. However, when I want to have a filesystem that ...
user avatar
0 votes
1 answer
85 views

Migrate ext4 LVM2 in preparation to upgrade to btrfs

I'd like to convert my file system from ext4 with LVM partitions (Fedora style: swap, root, home) to btrfs, primarily for the backup/snapshot feature. I read that it's beneficial to not use a LVM when ...
user avatar
  • 159
0 votes
2 answers
33 views

how to add to current fs ext4

So I deleted my windows partition and now I'm trying to add to the currant partition but it's not letting me either through GParted or KDE part.. any suggestions? :caspah@debian:~$ sudo lsblk NAME ...
user avatar
  • 1
0 votes
2 answers
163 views

How do I resize root partition with UEFI

Yesterday, a message poped up in Debian, saying that my root partition is full (0 MB free) after I copied a new software under /opt. So I moved the folder back to another partition to temporarily fix ...
user avatar
0 votes
0 answers
46 views

can't mount ext4 partition on ubuntu mate 16.04

Recently I can't mount a 8TB hard drive formatting as ext4 on ubuntu mate 16.04 on odroid. It shows the error: Error mounting drive exit status 32: mount: wrong fs type, bad option, bad superblock on /...
user avatar
  • 1
2 votes
1 answer
72 views

Why is it necessary to run fsck regularly?

Some systems run fsck on every boot, after so many days, or after so many mounts. For example, in How often should I reboot Linux servers? - Server Fault they discuss a variety of strategies for doing ...
user avatar
1 vote
2 answers
186 views

What are common causes of ext4 file system corruption?

I'm dealing with regular corruption of an ext4 non-root filesystem holding a data cache. The cache is specifically of images cut into pieces for easier processing later. The error in the application ...
user avatar
0 votes
1 answer
139 views

fsck.ext4 consumes all memory and gets killed

I have a probably corrupted external hard disc that I need to check for errors and fix them. I can't create any new directory on it and get the following errors: 2216505.217508] EXT4-fs (sda1): ...
user avatar
  • 170
0 votes
1 answer
35 views

how does ext4 filesystem respond a retrieve file request under the hood?

Imagine I have mounted a hard drive to the location /var/data/ of my Linux server, and I would like to print the content of a file. cat /var/data/foo.txt Ext4 is composed of several sections, for ...
user avatar
  • 125
3 votes
2 answers
175 views

Is it safe to use sudo tune2fs -m 1 /dev/sda1?

My external 5 TB backup drive is almost full. When I formatted it as Ext4 and created just one partition to it using Raspberry Buster, it reserved 10 % of space so available space was just 4.5 TB. If ...
user avatar
0 votes
0 answers
14 views

Testdisk results inaccurate

Looking at the deleted directories shown in testdisk, they are old: Many files and folders that have been (re)moved months ago were shown to have been deleted today, while none of the just-deleted ...
user avatar
  • 395
0 votes
1 answer
64 views

Why can I not `rsync` certain files between 2 SSD drives?

I've recently been migrating the contents from 1 SSD to another via rsync and 2 Linux servers: Ubuntu 20.0.4.3 LTS running on Raspberry Pi 4 (RPi4) Debian 10 running on x864_64 AMD Ryzen 5 2600X Six-...
user avatar
  • 345k
0 votes
1 answer
168 views

Why can mkfs.ext4 not create a 2048 block size file system on 650 MB image file?

The commands I invoke are the following Create image file dd if=/dev/zero of=benj.luks bs=1k count=666000 Set up LUKS container cryptsetup luksFormat benj.luks Set up loop device and open the ...
user avatar
  • 123
14 votes
6 answers
1k views

Reset ext4 filesystem without changing the filesystem UUID

I have a filesystem with many small files that I erase regularly (the files are a cache that can easily be regenerated). It's much faster to simply create a new filesystem rather than run rm -rf or ...
user avatar
2 votes
1 answer
379 views

How to enable journaled quota on Debian 11

I'm trying to enable journaled usrquota on Debian 11 Kernel 5.10. All information I find uses external files which leads to the following deprecation warning: quotaon: Your kernel probably supports ...
user avatar
  • 141
0 votes
0 answers
28 views

How to restore files created by dump(8) to a new directory?

I needed to transfer many (!) small files from an ext4 filesystem to another. So I've used dump(8), which performed way better than rsync, cpio or tar. I've used it like this: dump -0 -f - files/ | pv ...
user avatar
0 votes
0 answers
23 views

md RAID5 array performance loss with drive swap

I have had, for a very long time, an md RAID5 array in a little server I keep at home for general storage. The current incarnation has two SSDs in RAID1 for boot/root purposes and 10 drives on two ...
user avatar
  • 111
0 votes
1 answer
22 views

Changing rights and owner in one command to safe resources

I have a backup script with the following function: function change_rights() { chown -R ${OWNER}:${GROUP} ${DIR} find ${DIR} -type f -exec chmod 0640 {} \; find ${DIR} -type d -exec chmod ...
user avatar
  • 2,281
0 votes
1 answer
29 views

How to tell the integrity of a recovered file, specifically if pixel data of recovered image is corrupted

I delete a file from disk, then do some write operations on the same disk, and then run a recovery program to recover the said file. Is there any way to check the integrity of the file? Let the ...
user avatar
3 votes
1 answer
294 views

Do files in an ext4 filesystem allow constant time seeking?

I'm working with Tensorflow's TFRecords format, which serializes a bunch of data points into a single big file. Typical values here would be 10KB per data point, 10,000 data points per big file, and a ...
user avatar
  • 133
5 votes
1 answer
313 views

View file names in hex?

I have some files with special characters like accented letters. They are valid names, but for some reason when they are copied across the network to a drive, maybe in another format, the name still ...
user avatar
  • 435
1 vote
1 answer
70 views

Why fcntl() range lock (some offset to length) is slower as compared to fcntl full file lock (0 offset to EOF)? [closed]

I am trying to write on 1 GB file from 8 different processes (every process will start writing from 0th offset till EOF) simultaneously; while following two different approaches. Before writing every ...
user avatar
  • 67
1 vote
1 answer
96 views

How do we clear the read only flag on ext4 partition

I have an android system.img I want to remove the read-only flag so that I can mount and edit it I once saw it somewhere but I can't seem to find the article. maybe it has to do with removing ...
user avatar
0 votes
1 answer
60 views

Change the file system of a partition without deleting its content

I have a 2tb hard drive containing gpt and a single 2tb partition with ext4 file system. The partition has one 1.5tb file inside it. I want to change the type of file system of this partition from ...
user avatar
  • 193
1 vote
1 answer
107 views

Cannot write to usb after formatting to ext4

I am running galliumOs on a chromebook and wanted to put steam games on a separate usb drive so I bought a 128Gb USB and tried formatting to ext4 using GParted as well as the command sudo mkfs.ext4 -L ...
user avatar
0 votes
1 answer
721 views

tune2fs: Bad magic number in super-block while trying to open /dev/sda1

I have a healthy file system, but I cannot run tune2fs on it: # tune2fs -l /dev/sda1 tune2fs 1.42.9 (28-Dec-2013) tune2fs: Bad magic number in super-block while trying to open /dev/sda1 Couldn't find ...
user avatar
  • 1,370
1 vote
1 answer
89 views

What‘s different between inode->i_rwsem and i_flctx?

When I trace the function graph when calling write(), I find that within function ext4_file_write_iter() it locks the inode->i_rwsem by calling inode_lock(inode) at the beginning. After that call ...
user avatar
1 vote
0 answers
81 views

Grub not booting when large_dir flag is set for an ext4 system partition

After setting large_dir flag with tune2fs for my ext4 filesystem on mdadm RAID1, Linux (Ubuntu 18) is no longer able to boot, showing "error: unknown filesystem". The lack of support is ...
user avatar
  • 11
0 votes
1 answer
45 views

How can a disk without a partition be "partitioned" on Windows without losing data?

I have a 1TB portable hard drive that I use for backups. The entire drive (/dev/sdb) has been formatted as an ext4 filesystem. But I am now on Windows and I need to get back those files... I tried ...
user avatar
2 votes
1 answer
57 views

Listing directory takes forever on a folder that used to have millions of files [duplicate]

The filesystem is ext4, the machine hasn't been rebooted in years and we don't want to do that now either. We used to have a folder with millions of small (2-3kb of size) files. This almost broke the ...
user avatar
  • 123
4 votes
1 answer
581 views

Ext4 fast_commit feature

Since 5.10 kernel there is a new feature called fast_commit. In arch wiki https://wiki.archlinux.org/title/ext4 you can read that it can be enabled in existing filesystem with: tune2fs -O fast_commit /...
user avatar
  • 280
0 votes
0 answers
221 views

Ext4 Superblock Corrupted After Fsck

An ext4 filesystem was damaged. So I ran fsck against that partition. However, after fsck was completed, I still couldn't mount the filesystem. And now it's reporting superblock corrupted. [root@os1 ~]...
user avatar
  • 260
0 votes
0 answers
48 views

mount device and md5sum is changed

If mount sdc2 partition using mount -t ext4 -o ro /dev/sdc2 /mnt/bob2 then try to write file tihi 1.txt with command (of course unsuccessfully): touch /mnt/bob2/ tihi 1.txt When I do md5sum /dev/sdc2/...
user avatar
0 votes
2 answers
86 views

Are distribution installers harming SSDs?

According to Intel, it is important that blocks not be discarded when creating a Linux filesystem on a solid state drive. The document states that the default behaviour (of mke2fs, in March 2015) is ...
user avatar
  • 3,321
2 votes
1 answer
137 views

"will not make a filesystem here!"

Trying to format this LV /dev/mapper/nvmeVg-var which is not mounted. See findmnt below. mkfs.ext3 /dev/mapper/nvmeVg-var mke2fs 1.45.6 (20-Mar-2020) /dev/mapper/nvmeVg-var contains a ext4 file ...
user avatar
2 votes
1 answer
59 views

Can't make an ext4-partition on a specific raid

I have a hardware raid-1 on two WDC-SSDs with 500GB on each SSD. The raid controller is a Marvell-88SE9128 via two GSATA connections (the controller is directly on the motherboard and not an ePCI ...
user avatar
0 votes
1 answer
41 views

Does LVM make data recovery easier or harder?

Does LVM make data recovery on ext 4 easier or harder? I have to consider the risk of hdd failure. Thanks. I am going to install some Linux distribution (e.g. NixOS) on a laptop. It is already ...
user avatar
  • 81

1
2 3 4 5
18