Archive for January, 2010

SBDavid

ssh debugging tips

The OpenSSH SSH client supports SSH protocols 1 and 2. Protocol 2 is the default, with ssh falling back to protocol 1 if it detects protocol 2 is unsupported. These settings may be altered using the Protocol option in ssh_config(5)

-v Verbose mode. Causes ssh to print debugging messages about its progress. This is helpful in debugging connection, authentication, and configuration problems.

Multiple -v options increase the verbosity. The maximum is 3.

Example:

jyothis@dell:~$ ssh root@192.168.1.1 -v
OpenSSH_4.7p1 Debian-8, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.1.1 [192.168.1.1] port 22.
debug1: Connection established.
debug1: identity file /home/jyothis/.ssh/identity type -1
debug1: identity file /home/jyothis/.ssh/id_rsa type 1
debug1: identity file /home/jyothis/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5ubuntu1
debug1: match: OpenSSH_5.1p1 Debian-5ubuntu1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0

How To Identify Major and Minor Number For Block Devices

How to identify major and minor device number?

Now, if you want to know the major and minor number of these devices, cd to /dev directory and do ls -l as shown below, which will show both major and minor number

$ cd /dev

/dev$ ls -l sda2
brw-rw—- 1 root disk 8, 2 Jan 7 22:11 sda2

[Note: Major for /dev/sda1 is 8 and minor is 2]

The major numbers for SCSI and IDE doesn’t change and has the following hard-coded value.

* SCSI (/dev/sd?) Major Number is 8
* IDE (/dev/hd?) Major Number is 3
SBDavid

Metadata

Metadata is data about data. Data is basically the same thing as information, although it is often in a form that is easier for humans and/or computers to use and manipulate.

Major functions of computer filesystems are the storing of metadata about files and facilitating the locating and manipulation of files. The metadata about a file on a Unix-like operating system includes its file type (e.g., data file, directory, link), name, timestamps (i.e., dates of creation, last access and modification), location on the filesystem, size (in bytes), its physical location (i.e., the addresses of the blocks of storage containing the file’s data on a disk), ownership (usually the same as its creator), access permissions (i.e., which users are permitted to read, write and/or execute the file) and file type.

An inode is a data structure on a Unix-like operating system that stores all the metadata about a file except its name(s); the name(s) and the actual data of the file are stored elsewhere. A data structure is a way of storing information in a computer so that it can be used efficiently.

SBDavid

Inode

An inode is a data structure on a file-system on Linux and other Unix-like operating systems that stores all the information about a file except its name and its actual data.

Inode is a structure contains the information necessary for a process to access a file. Exist in a static form on disk and the kernel reads them into an in-core inode consists of:

- file owner identifier.
- file type.
- file access permissions.
- file access times.
- number of links to the file.
- table of contents for the disk address of data in a file.
- file size.

Inode Contains all the details about a file like owner, permission, type etc. But it doesn’t Contain the “Filename” for the particular file.

A data structure is a way of storing data so that it can be used efficiently. Different types of data structures are suited to different types of applications, and some are highly specialized for specific types of tasks.

SBDavid

Superblock

Superblock

The superblock is a structure that represents a file system. It includes the necessary information to manage the file system during operation. It includes the file system name (such as ext2), the size of the file system and its state, a reference to the block device, and metadata information (such as free lists and so on). The superblock is typically stored on the storage medium but can be created in real time if one doesn’t exist.

Finding out the backup superblock.

root@dell:~# dumpe2fs /dev/sda2 |grep -i superblock
dumpe2fs 1.41.2 (02-Oct-2008)
Primary superblock at 0, Group descriptors at 1-3
Backup superblock at 32768, Group descriptors at 32769-32771
Backup superblock at 98304, Group descriptors at 98305-98307
Backup superblock at 163840, Group descriptors at 163841-163843
Backup superblock at 229376, Group descriptors at 229377-229379
Backup superblock at 294912, Group descriptors at 294913-294915
Backup superblock at 819200, Group descriptors at 819201-819203
Backup superblock at 884736, Group descriptors at 884737-884739
Backup superblock at 1605632, Group descriptors at 1605633-1605635
Backup superblock at 2654208, Group descriptors at 2654209-2654211
Backup superblock at 4096000, Group descriptors at 4096001-4096003
Backup superblock at 7962624, Group descriptors at 7962625-7962627

« Prev - Next »