04-15-2010
to
Verdepollo
Take a look at the sources. For example here is the sources from FreeBSD at /usr/src/sys/ufs/ufs
Here is /usr/src/sys/ufs/ufs/inode.h
Code :
/*
* The inode is used to describe each active (or recently active) file in the
* UFS filesystem. It is composed of two types of information. The first part
* is the information that is needed only while the file is active (such as
* the identity of the file and linkage to speed its lookup). The second part
* is the permanent meta-data associated with the file which is read in
* from the permanent dinode from long term storage when the file becomes
* active, and is put back when the file is no longer being used.
*
* An inode may only be changed while holding either the exclusive
* vnode lock or the shared vnode lock and the vnode interlock. We use
* the latter only for "read" and "get" operations that require
* changing i_flag, or a timestamp. This locking protocol allows executing
* those operations without having to upgrade the vnode lock from shared to
* exclusive.
*/
struct inode {
TAILQ_ENTRY(inode) i_nextsnap; /* snapshot file list. */
struct vnode *i_vnode;/* Vnode associated with this inode. */
struct ufsmount *i_ump;/* Ufsmount point associated with this inode. */
u_int32_t i_flag; /* flags, see below */
struct cdev *i_dev; /* Device associated with the inode. */
ino_t i_number; /* The identity of the inode. */
int i_effnlink; /* i_nlink when I/O completes */
struct fs *i_fs; /* Associated filesystem superblock. */
struct dquot *i_dquot[MAXQUOTAS]; /* Dquot structures. */
/*
* Side effects; used during directory lookup.
*/
int32_t i_count; /* Size of free slot in directory. */
doff_t i_endoff; /* End of useful stuff in directory. */
doff_t i_diroff; /* Offset in dir, where we found last entry. */
doff_t i_offset; /* Offset of free space in directory. */
union {
struct dirhash *dirhash; /* Hashing for large directories. */
daddr_t *snapblklist; /* Collect expunged snapshot blocks. */
} i_un;
/*
* Data for extended attribute modification.
*/
u_char *i_ea_area; /* Pointer to malloced copy of EA area */
unsigned i_ea_len; /* Length of i_ea_area */
int i_ea_error; /* First errno in transaction */
int i_ea_refs; /* Number of users of EA area */
/*
* Copies from the on-disk dinode itself.
*/
u_int16_t i_mode; /* IFMT, permissions; see below. */
int16_t i_nlink; /* File link count. */
u_int64_t i_size; /* File byte count. */
u_int32_t i_flags; /* Status flags (chflags). */
int64_t i_gen; /* Generation number. */
u_int32_t i_uid; /* File owner. */
u_int32_t i_gid; /* File group. */
/*
* The real copy of the on-disk inode.
*/
union {
struct ufs1_dinode *din1; /* UFS1 on-disk dinode. */
struct ufs2_dinode *din2; /* UFS2 on-disk dinode. */
} dinode_u;
};
And here is /usr/src/sys/ufs/ufs/dinode.h
Code :
/*
* A UFS1 dinode contains all the meta-data associated with a UFS1 file.
* This structure defines the on-disk format of a UFS1 dinode. Since
* this structure describes an on-disk structure, all its fields
* are defined by types with precise widths.
*/
struct ufs1_dinode {
u_int16_t di_mode; /* 0: IFMT, permissions; see below. */
int16_t di_nlink; /* 2: File link count. */
union {
u_int16_t oldids[2]; /* 4: Ffs: old user and group ids. */
} di_u;
u_int64_t di_size; /* 8: File byte count. */
int32_t di_atime; /* 16: Last access time. */
int32_t di_atimensec; /* 20: Last access time. */
int32_t di_mtime; /* 24: Last modified time. */
int32_t di_mtimensec; /* 28: Last modified time. */
int32_t di_ctime; /* 32: Last inode change time. */
int32_t di_ctimensec; /* 36: Last inode change time. */
ufs1_daddr_t di_db[NDADDR]; /* 40: Direct disk blocks. */
ufs1_daddr_t di_ib[NIADDR]; /* 88: Indirect disk blocks. */
u_int32_t di_flags; /* 100: Status flags (chflags). */
int32_t di_blocks; /* 104: Blocks actually held. */
int32_t di_gen; /* 108: Generation number. */
u_int32_t di_uid; /* 112: File owner. */
u_int32_t di_gid; /* 116: File group. */
u_int64_t di_modrev; /* 120: i_modrev for NFSv4 */
};
nbpi argument is not a sizeof inode.
Code :
nbpi=n
The number of bytes per inode, which specifies the
density of inodes in the file system. The number is
divided into the total size of the file system to
determine the number of inodes to create.
This value should reflect the expected average size
of files in the file system. If fewer inodes are
desired, a larger number should be used. To create
more inodes, a smaller number should be given. The
default is 2048.
The number of inodes can increase if the file system
is expanded with the growfs command.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to check ram size and currently free in sun solaris box (8 Replies)
Discussion started by: pmsuper
8 Replies
2. Solaris
Hi guys,
need your help on this since i dont know much about solaris.
the problem is i need to increase inodes space on /export/home/
root@BRF-DANCCM1 # /usr/ucb/df -i
Filesystem iused ifree %iused Mounted on
/dev/vx/dsk/bootdg/rootvol
53026 1162206 ... (7 Replies)
Discussion started by: ichiko
7 Replies
3. Solaris
What is the largest possible LUN size that can be presented to Solaris 10. I've been googling a lot about this. The new EFI lablels (an alternative to VTOC) supports LUNs greater than 2TB. I need to know the upper limit. please help me find it. (4 Replies)
Discussion started by: pingmeback
4 Replies
4. Filesystems, Disks and Memory
Can some one tell me what is difference in inode datastructure for 128 byte inode & 256 byte inode? (0 Replies)
Discussion started by: sach253
0 Replies
5. Solaris
Hi,
I would like to is it possible to repair inode table in solaris without running fsck? I am facing this issue in root file system, because to run fsck I have to bring system in single user mode with booting cdrom media.
I facing strange issue in /var/adm/messages it is showing inode table... (12 Replies)
Discussion started by: manoj.solaris
12 Replies
6. UNIX for Advanced & Expert Users
Hi,
How do I know the max. size for FIFO(named pipe) on my system.
I'm using solaris 10 OS. Is there any comparison chart between message queues and named pipes.
Thanks in advance. (4 Replies)
Discussion started by: axes
4 Replies
7. Solaris
hi,
let me know how to increase file size in solaris 10 OS (4 Replies)
Discussion started by: meet2muneer
4 Replies
8. Solaris
Dear,
How can i check inode information in my Solaris box?
With Regards,
Mjoshi (4 Replies)
Discussion started by: mjoshi87
4 Replies
9. Solaris
Dear all,
yesterday I had a big problem on Solaris 9. I cannot write anymore on /var. I checked the inode usage, and I see that for /var was at 100% with ifree = 0.
I deleted some unused files (like old log on /var/tmp and /var/log), now I have ifree=19641 and 99% iused:
root@ciy01 # df -F ufs... (12 Replies)
Discussion started by: Lord Spectre
12 Replies
10. Red Hat
Hi,
inode size reached its 100% in /var
Due to this i'am getting the error No space left on device
my crond process is stopped and when i want to restart it
it is showing the below error
Starting crond: crond: can't open or create /var/run/crond.pid: No space left on device
df -i o/p
... (3 Replies)
Discussion started by: Mohamed Thamim
3 Replies