I'm making a Remote Filesystem Server for my university and I'm having some trouble with reading the root directory... Here's the thing:
I've read the root inode (inode 2) and it has consistent data, I mean that, for example, owner user Id field is…
In a project, the program must store references/identifiers of each child of a directory in its variables(say a stack). i.e the program must not perform pathlookup again for every child once a directory is read.
I am not very sure how to do that.…
I'm a more experienced Windows programmer than I am a Linux programmer. Apologies if I'm missing something obvious.
I need to read >10,000 small files (~2->10k) on a USB2 attached ext2 volume running Linux. The distro is a custom and runs…
For a OS project, I am creating a ext2 file system image and mounting it. This means that I am writing out a 1 MB file with block information and then using it as the mount target.
For example, assume there is a file called base.img:
fsck.ext2…
**the image has some files on it and I have been able to read the names but I couldn't get the content of all files at once , I have been able to find the root directory content with the inode number but what if the directory changed ?
NOTE: I am…
What happens after mounting filesystem from file?
Example:
I have rootfs.ext2 file which is located in data directory and mounted under /mnt directory
mount rootfs.ext2 /mnt
After removing rootfs.ext2 I still can use files under /mnt directory, cat…
I'm a newbie to kernel programming, and I'm stuck on something, so I'd appreciate some help. I appologize in advance if something similar was asked before, I did not find any relevant post, and could find explanations on the web which were simple…
So to pull super block in file system (i.e. if my sda storage is ext2 formatted) is easy. I just need to skip 1024 bytes to get the super block fro sda storage
lseek(fd, 1024, SEEK_SET);
read(fd, &super_block, sizeof(super_block));
and to pull the…
I am trying to read super block, group descriptor and inodes struct info of ext2 formatted disk image. So I like to know can I access these info_s with my userspace structures? So I like to create struct_s that maps to ext2 struct namely
these…
Using debugfs to check free inodes (list got from dumpe2fs), I observed that most of them have a bad type status, except for a few ones which are regular. I'd like to check them all to see how many and which of them have a different…
In the book Modern Operating System, the author explained that if the shell script has two commands, p1 and p2 and each takes turn writing into a file x, the position where p1 finishes will be remembered by p2, as they are using the same…
For one of my CS classes we are creating a mini EXT2 file system. In this program I have to make the functions mkdir and creat. In both these functions we call a function called iput which looks like this:
int iput(MINODE *mip)
{
// dispose of…
I have an EXT2 partition on my usb thumb drive and I can't get the C function open() to return anything other than -1.
Partition manager says that the partition is located at /dev/sdb2 and my code says
int fd = open("/dev/sdb2", O_RDONLY);
But…
So I am writing a C file which includes /extfs/ext2fs.h. I am trying to call the function ext2fs_open(). I can clearly see that the header file ext2fs.h has that particular function. In fact, if I pass in the incorrect number of arguments, it even…