Monthly Archives: October 2013

linux – get list superbocks from ext partition

mke2fs -n /dev/sda2

Filesystem label=

OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
91037696 inodes, 364121856 blocks
18206092 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
11113 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848

linux – run e2fsck on a partition (fsck)

e2fsck is used to check the ext2/ext3/ext4 family of file systems.
sudo e2fsck -C0 -p -f -v /dev/sdb1
if errors:
sudo e2fsck -f -y -v /dev/sdb1

-C0 This option causes e2fsck to write completion information to the specified file descriptor
-p Automatically repair (“preen”) the file system.
-f Force checking even if the file system seems clean.
-v Verbose mode.

linux align command output

Sometimes some commands can give you not aligned output like this:

procs ———–memory———- —swap– —–io—- –system– —–cpu—–
r b swpd free buff cache si so bi bo in cs us sy id wa st
12 0 7406848 361600 215560 7777776 0 0 38 83 0 0 20 7 65 8 0
25 0 7406848 366428 215560 7778240 0 0 24 28 9946 6872 52 19 28 1 0
24 0 7406848 371024 215568 7778736 0 0 36 396 10088 5820 65 19 15 0 0
37 0 7406844 374752 215568 7779248 0 0 0 88 10317 6669 59 15 25 0 0
29 2 7406844 377488 215568 7779804 0 0 152 712 10984 6304 59 18 21 1 0

what to do?
Percona can suggest some perl based tools:

wget percona.com/get/pt-align && chmod +x  pt-align &&  \cp ./pt-align /usr/bin/al

Now:

vmstat 1 5 | al

linux dentry

A dentry is the glue that holds inodes and files together by relating inode numbers to file names. Dentries also play a role in directory caching which, ideally, keeps the most frequently used files on-hand for faster access. File system traversal is another aspect of the dentry as it maintains a relationship between directories and their files.

The differences between dentry and inode are that dentry is used to facilitate directory-specific operations, inode is just a collection of metadata about files and directories. Superblock is the abstraction of filesystem.