Saidar – an ncurses tool for viewing system statistics

saidar is a curses-based tool for viewing the system statistics available through libstatgrab. As libstatgrab provides an abstraction layer for retrieving information, saidar can be use on multiple OS (Solaris 2.x, GNU/Linux, FreeBSD, NetBSD, OpenBSD, HP-UX).

Statistics include CPU, processes, load, memory, swap, network I/O, disk I/O and file system information. For launching saidar simply type it name:

# saidar

The refresh delay is 3 seconds by default and can be changed using the -d parameter. You can also add color to the output using the -c option.

Bad magic number in super-block

Sometime things goes wrong and filesystem finish in a corrupted state.
That were tools like fsck come to the rescue:

fsck /dev/sda5
fsck 1.41.4 (27-Jan-2009)
e2fsck 1.41.4 (27-Jan-2009)
fsck.ext4: Group descriptors look bad... trying backup blocks...
fsck.ext4: Bad magic number in super-block while trying to open /dev/sda5
 
The superblock could not be read or does not describe a correct ext4
filesystem.  If the device is valid and it really contains an ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

Oups. The error “Bad magic number in super-block” clearly indicate that the superblock of the partition /dev/sda5 is in bad shape. But you can use superblock backup to restore the filesystem in a functional state.

First lets find where your superblock backups are kept:

mke2fs -n /dev/xxx
...
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Then restore the superblock from one of its backup:

e2fsck -b 2654208 /dev/sda5