inode

Inode Data Structure Differences Between 128-byte Ext2 and 256-byte Ext3

Curious as to the inode data structure differences between 128-byte ext2 and 256-byte ext3 file-systems. I have been using this reference for ext2, 128-byte inodes: http://www.nongnu.org/ext2-doc/ext2.html#INODE-TABLE. I have been unable to find a similar resource for ext3, 256-byte inodes. I have cursorily checked /usr/include/linux/...

How can UNIX access control create compromise problems?

My system administrators advice me to be careful when setting access control to files and directories. He gave me an example and I got confused, here it is: a file with protection mode 644 (octal) contained in a directory with protection mode 730. so it means: File: 110 100 100 (owner, group, other: rw- r-- r--) Directory: 111 011 00...

file descriptors and open files

Hello, I have two quick questions: When do two file descriptors point to the same open file ? When do two open files point to the same inode ? Also, if you happen to have some good documentation with graphs explaining this, i'll be very grateful if you show me the link to it :) Thanks! ...

How do you determine using stat() whether a file is a symbolic link?

I basically have to write a clone of the UNIX ls command for a class, and I've got almost everything working. One thing I can't seem to figure out how to do is check whether a file is a symbolic link or not. From the man page for stat(), I see that there is a mode_t value defined, S_IFLNK. This is how I'm trying to check whether a file ...

Out of Core Implementation of a Quadtree

Hi, I am trying to build a Quadtree data structure(or let's just say a tree) on the secondary memory(Hard Disk). I have a C++ program to do so and I use fopen to create the files. Also, I am using tesseral coding to store each cell in a file named with its corresponding code to store it on the disk in one directory. The problem is tha...

Maximum file size given a particular inode structure?

Suppose a UNIX file system has some constraints--say, 2 KB blocks and 8B disk addresses. What is the maximum file size if inodes contain 13 direct entries, and one single, double, and triple indirect entry each? ...

Understanding the concept of Inodes

I am referring to the link: http://www.tux4u.nl/freedocs/unix/draw/inode.pdf I am confused on parts: 12 direct block pointers 1 single indirect block pointer 1 double indirect block pointer 1 triple indirect block pointer Now the diagram says that each pointer is 32/64 bits. [Query]: Why and how are these values inferred? I mean w...

how to read I-node bitmap of a minix fs bit by bit in c

Hi, I wanted to know how can I read and check(1 or 0) the bits of the the I-node bit map of a minix fs bit by bit in c programming language. This way I want check the free and occupied I-nodes. And also if possible to set and unset the bits manually. Please help. Thank you this is the layout of the minix file system ----------------...

directory inode

I know that in inodes that represent files, the name it's not in the inode struct. All files are identified in the UFS by its inode-number. I know how it works an inode struct in a file... it has all the info plus some pointers to HD blocks that contains the file data. But I don't know much about how directories are represented as inod...

how to change symlink target while preserving inode

Normally to change a symlink target one will first unlink the file and then re-creating the symlink with the new target path. However it will be assigned a new inode number. Maybe there is a private Mac api with an update_target_for_symlink() function, so the inode can stay the same? In case you wonder what I need it for.. a file mana...

Best approach to detecting a move or rename to a file in Linux?

Some solution could probably be applicable to Windows, however I am not familiar with the Windows OS, so this will be Linux focused. As far as I understand, Unix file system all have the concept of inodes, which is where the file system metadata and the "file" is stored. Thus I am wondering if it is possible to use the inode number wit...

How many bytes per inodes?

HI, I need to create a very high number of files which are not very large (like 4kb,8kb). It's not possible on my computer cause it takes all inodes up to 100% and I cannot create more files : -bash-4.0$ df -i /dev/sda5 Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sda5 54362112 36381206 17980906 67% /...

Inserting pages into large mmap() files without copying data

I'm wondering if there is a way to insert blank pages near the beginning of a large (multi-GB) file that I have open with mmap(). Obviously it would be possible to add a page or two to the end, and move everything forward with memcpy(), but this would dirty every page and require an awful long time when eventually flushed to disk. I'm ...