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
5
votes
1 answer

Efficiently inserting blocks into the middle of a file

I'm looking for, essentially, the ext4 equivalent of mremap(). I have a big mmap()'d file that I'm allocating arrays in, and the arrays need to grow. So I want to make the first array larger at its current location, and budge all the other arrays…
interfect
  • 2,665
  • 1
  • 20
  • 35
5
votes
1 answer

How to write a file atomically and asynchronously in Linux using C

Question How can I update a file atomically without requiring my program to wait for slow physical media (such as with fsync)? My hope is that the OS could "buffer" the typical fsync and rename operations in RAM, and then write them to disk in the…
Peteman720
  • 51
  • 3
5
votes
1 answer

Setting Linux Capabilities in Yocto ext4 Image

I intend to set some capabilities on binaries included in a Yocto image using "setcap". For some reason the solutions mentioned here did not work for me: Linux capabilities with yocto . I have checked that by running "getcap" on my binary within the…
Rogue
  • 73
  • 1
  • 7
5
votes
1 answer

Why are these timestamps out of order with Perl Time::HiRes?

I'm seeing some strange behaviour with the timestamp reported by Perl's Time::HiRes module. I have a script that gets three timestamps: Get timestamp with Time::HiRes::time Create a new file, and get its modification time with Time::HiRes::stat Get…
ajwood
  • 18,227
  • 15
  • 61
  • 104
5
votes
2 answers

Is overwriting a small file atomic on ext4?

Assume we have a file of FILE_SIZE bytes, and: FILE_SIZE <= min(page_size, physical_block_size); file size never changes (i.e. truncate() or append write() are never performed); file is modified only by completly overwriting its contents…
gavv
  • 4,649
  • 1
  • 23
  • 40
5
votes
3 answers

How can I access file by inode on Linux

is there any userspace API or third-party kernel module that can help to access file by inode on Linux? I'm trying to implement something like: int read_file_by_ino(int ino, int pos, int size, char* buf); int write_file_by_ino(int ino, int pos, int…
zJay
  • 2,889
  • 3
  • 22
  • 19
5
votes
2 answers

PHP `require_once` includes wrong file

I have a development tree on a Linux Ubuntu 14.04-LTS machine like this, with three identical branches: main -+-- leonardo --- project --- htdocs -+- panel --- index.php | | | …
LSerni
  • 55,617
  • 10
  • 65
  • 107
5
votes
2 answers

Does fsync(fd) work on a file created by external program?

I have a SATA hard disk with write cache disabled: hdparm -W0 /dev/foo I am operating on an ext4 partition with these mount options (amongst others): data=ordered auto_da_alloc Linux kernel version is 2.6.32-5-686. Now, I have an external program…
STenyaK
  • 1,047
  • 1
  • 8
  • 15
5
votes
0 answers

UnionFS: How to persist changes in the overlay/upperdir into the base/lowerdir filesystem?

Suppose to have the following scenario, on a linux system: An ext4 data partition mounted as Read-Only: data_ro An overlay partition: data_overlay The two of them union-mounted using UnionFS: mount -t overlayfs -o…
feryllt
  • 66
  • 5
5
votes
1 answer

Ext4 FS: max file size

If I am not wrong, than with triple indirect addressing, the maximum file size for ext3 would be (4G+4M+4K). Likewise, what will be the the maximum file size for an ext4 FS using extents if we assume a 4KB disk block size?
user3228815
  • 119
  • 1
  • 2
  • 10
5
votes
1 answer

How to shrink an ext4 partition without formatting it?

Recently i installed Ubuntu 13.04 and allocated 20 GB for it. The system got installed space less than 10 GB. Now, can i shrink it to 10 GB without formatting it? Thats to say, i don't want to have large empty space in the partition.
5
votes
2 answers

Writing an EXT4 file system in C?

This may sound noobish, especially as I'm ( as you may have guessed ) trying to write an Operating System. At the moment I'm stuck on trying to make a file system. What I want is a similar file system as Linux Ubuntu which is EXT4 ( at least mine is…
user1114683
4
votes
3 answers

Is ext4 considered file storage or block storage?

I have been researching the differences between File, Block and Object storage. I've tried to relate the native Linux File System with one of these types of storing data, however, some doubts that come to my mind make me evidence that I have some…
roldanx
  • 179
  • 1
  • 1
  • 8
4
votes
2 answers

python: complexity of os.path.exists with a ext4 filesystem?

Does anyone know what the complexity of the os.path.exists function is in python with a ext4 filesystem?
user63899
4
votes
1 answer

How do I migrate an existing 20.04 ext4 installation to zfs root on different disk?

I have a 20.04 ext4 installation (successful upgrade from 19.10!) and am just wondering about the above. One caveat I can think of is /etc/fstab and some other things may be somewhat different for ZFS root and so should probably not be transferred…
jdrch
  • 70
  • 2
  • 6
1 2
3
21 22