≡ Menu


Linux Find And Report On File Fragmentation

How do I find out badly fragmented a particular file might be under Linux operating systems?
[click to continue…]

Mac Os X: Mount NFS Share / Set an NFS Client

How do I access my enterprise NAS server by mounting NFS filesystem onto my Mac OS X based system using GUI and command line based tools?
[click to continue…]

Linux incrond inotify: Monitor Directories For Changes And Take Action

I want to copy (rsync to remote server) a directory tree whenever file uploaded or deleted in /var/www/html/upload/ directory under Linux operating systems for backup purpose and/or load balancing purpose without getting into complex file sharing setup such as NFS or GFS iscsi storage. How do I monitor /var/www/html/upload/ and its subdirectory for new files and executes rsync command to make copy back to www2.example.com:/var/www/html/upload/?
[click to continue…]

Linux RAM Disk: Creating A Filesystem In RAM

Software RAM disks use the normal RAM in main memory as if it were a partition on a hard drive rather than actually accessing the data bus normally used for secondary storage such as hard disk. How do I create and store a web cache on a RAM disk to improve the speed of loading pages under Linux operating systems?
[click to continue…]

Linux Disable Mounting of Uncommon Filesystem

How do I disable mounting of uncommon file systems such as hfs, udf, cramfs etc under Fedora or CentOS / RHEL / Redhat Enterprise Linux?
[click to continue…]

Solaris UNIX Configure Disk Quota For UFS File System

How do I configure file system quotas to control how much available storage space can be used on a given UFS file system (such as /export/home) under Solaris UNIX operating systems?
[click to continue…]

How To Use UUID To Mount Partitions / Volumes Under Ubuntu Linux

Q. Can you explain UUID concept related to Linux ext3 partitions and storage devices? How do I update /etc/fstab using UUID under Ubuntu Linux or any other Linux distro?
[click to continue…]

Linux: Recover Corrupted Partition From A Bad Superblock

Q. How can I Recover a bad superblock from a corrupted ext3 partition to get back my data? I'm getting following error:

/dev/sda2: Input/output error
mount: /dev/sda2: can't read superblock

How do I fix this error?
[click to continue…]

Linux Optimize Directories ( File Access Time ) in ext3 Filesystem

Q. I'm using CentOS Linux 5 server with ext3 on /disk2 (/dev/sdb1). How do I improve my file server performance. I've many large files in directories and how do I speed up access time?
[click to continue…]

How to: Find the inode size of an ext2 / ext3 filesystem

Q. I need to find out inode size of my ext3 file system for recovery purpose. How can I find the inode size of an ext2/ext3 filesystem?

A. You need to use tune2fs command, which allows the system administrator to adjust various tunable filesystem parameters on Linux ext2/ext3 filesystems.

Find the inode size of the filesystem

The -l option lists the inode size of the filesystem. Using the same option, other information of the filesystem superblock can also be seen. The superblock contains information about the filesystem, such as the number of free blocks available, and the number of mounts, that may be useful for tuning purposes.
# sudo tune2fs -l /dev/sda2

tune2fs 1.40.2 (12-Jul-2007)
Filesystem volume name:   
Last mounted on:          
Filesystem UUID:          8c2da865-13f4-47a2-9c92-2f31738469e8
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal resize_inode dir_index filetype needs_recovery sparse_super large_file
Filesystem flags:         signed directory hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              12222464
Block count:              24412775
Reserved block count:     1220638
Free blocks:              17464715
Free inodes:              12055081
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1018
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         16384
Inode blocks per group:   512
Filesystem created:       Sat Oct  6 04:51:23 2007
Last mount time:          Fri Nov  9 08:07:04 2007
Last write time:          Fri Nov  9 08:07:04 2007
Mount count:              12
Maximum mount count:      32
Last checked:             Mon Nov  5 13:33:36 2007
Check interval:           15552000 (6 months)
Next check after:         Sat May  3 13:33:36 2008
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               128
Journal inode:            8
First orphan inode:       1163400
Default directory hash:   tea
Directory Hash Seed:      bcaf359b-11c2-4c1a-8823-92be72c09ac4
Journal backup:           inode blocks

To find the inode size, enter:
# sudo tune2fs -l /dev/sda2 | grep Inode

Inode count:              12222464
Inodes per group:         16384
Inode blocks per group:   512
Inode size:               128