Questions tagged [ext2]

ext2 is a Linux filesystem.

ext2 is a filesystem mostly used under linux.

Other versions are ext, ext3 and ext4.

See Wikipedia for details on ext and ext2.

106 questions
0
votes
1 answer

Linux C ext2fs_write_inode_full failing to write

after successfully reading the file inode with this: retval = ext2fs_read_inode_full(current_fs, inode, inode_buf, EXT2_INODE_SIZE(current_fs->super)); if (retval) { fprintf(stderr, "Failed to read inode\n"); free(fs); free(inode_buf); …
WallyZ
  • 326
  • 2
  • 17
0
votes
1 answer

Space needed for reserved blocks on a partition

By default, the ext2/3/4 fs reserves 5% of its capacity to be able to keep running when diskspace is getting low. I also believe it has something to do with allowing "fragmentation between files" or something like this (I haven't been able to find…
Yozamu
  • 31
  • 1
  • 5
0
votes
1 answer

Is there a way to create an iterator style function for i_block in C?

I am working on some ext2 filesystem stuff for a school project (implement ls, mkdir, that kind of thing) and have found that I am generating a lot of redundant code for tasks where I need to traverse an inode's i_block. I have functions to count…
Ace.C
  • 1,201
  • 12
  • 22
0
votes
1 answer

ext2 "image" files vs real ext2 devices

I'm tasked with writing a reader program for windows that is able read an ext2 partition. For my testing I'm using a drive I formatted to ext2 and a file I created using mkfs (a file that does mount and work well under linux) For some reason when I…
user407487
  • 83
  • 2
  • 8
0
votes
1 answer

libext2fs code not working

I just tried to access my superblock information using the code as shown here:- http://paste.pocoo.org/show/340724/ However, I get the error as shown here:- http://paste.pocoo.org/show/340723/ My kernel version is 2.6.31-22-generic and I have not…
user277465
0
votes
1 answer

how to print the s_uuid of ext2 superblock in C

I create a variable to store the value of superblock's s_uuid. But I get trouble into how to print this variable like xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx in this form. I tried to use printf in %x and %s to print my variable, but it doesn't work. I…
xiekuan
  • 3
  • 1
0
votes
1 answer

What does the FS_REQUIRES_DEV flag do in Linux filesystems?

I was reading the source for ext2fs where the filesystem is registered with the FS_REQUIRES_DEV flag in fs/ext2/super.c. Both fs.h and the kernel documentation don't say anything else about this flag. I also tried to look up how the VFS uses of this…
0
votes
0 answers

How to modify/patch and rebuild e2fsprogs? Build is failing on adding a single printf

I'm trying to patch and rebuild e2fsprog. Re-build is failing as test cases started failing post patching. I have just added a printf comment so not sure why this will lead to test case failure. Steps I'm following. a) make packages --> get source…
Satpal Parmar
  • 361
  • 3
  • 12
0
votes
1 answer

How removing a file in ext2 file system work

I am learning the EXT2 file system. I am confused about how the removal of a file works for EXT2. My understanding is that, upon deletion, it doesn't actually deletes the inode, instead it marks some metadata as unused. My question is that, what…
samuel
  • 43
  • 4
0
votes
1 answer

C, Storing a string with length <=60 in the space for an array of unsigned ints of size 15

This question has totally confused me- I have an array(fixed size): unsigned int i_block[15]; I have a string(length <= 60): "path/to/bla/is/bla" How would I go about storing the characters of the string in the space for the array? I was thinking…
user126885
  • 157
  • 1
  • 2
  • 10
0
votes
1 answer

Mounting ext4 mounts as ext2 in linux 4.4.0 [RHEL]

commands I executed mkfs .ext4 -F /dev/xxx0 mke2fs 1.42.9 (28-Dec-2013) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 524288 inodes, 2097152 blocks 104857 blocks (5.00%)…
Himanshu Sourav
  • 700
  • 1
  • 10
  • 35
0
votes
1 answer

access to superblock in vdi, ext2

I am trying to access the superblock in the opening and reading in of a ext2 filesystem from a vdi file. I want to use the struct ext2_super_block that exists in the ext2.h file (see line 415 of http://lxr.free-electrons.com/source/fs/ext2/ext2.h).…
minusila
  • 41
  • 1
  • 6
0
votes
1 answer

How to open a file on an ext2 file system?

How can I open a file in an ext2 file system. For example, lets say I want to open the file: /a/b/c.txt I'm looking at the functions here: http://www.nongnu.org/ext2-doc/ext2.html
User
  • 23,729
  • 38
  • 124
  • 207
0
votes
1 answer

c - How to find the inode of a directory in an ext2 virtual image (.img) given an absolute path?

In c, how would I find a directory in a virtual disk? I can easily recurse the absolute path and tun that into just the name of the directory I am looking for (i.e. turning /x/y/z into just z). I know that the root is inode 2, and I know how to get…
Jeffrey
  • 13
  • 3
0
votes
0 answers

Ext2 utility "e2cp" alternative for OS X

In my linux machines, I use the command line utility e2cp to copy files from and to ext2 disk images. Unfortunately, OS X does not provide any ext2fs utility out of the box. Is there a version of e2cp that is compatible to OS X, or a similar…
fsestini
  • 121
  • 6