Linux ReiserFS File System Data Recovery

Data Recovery for ReiserFS : File System for Linux

The ReiserFS is a general-purpose computer file system designed and implemented by a team at Namesys. The design objectives were to increase performance over the ext2 file system, offer a space efficient file system, and to improve handling of large directories compared to existing file systems. Reiserfs uses balanced trees to store files and directories and it also offers journaling.

ReiserFS is quite stable and is very fast, depending on a balanced tree structure instead of the traditional blocks. It was the first journaling filesystem available for Linux, and its latest version is Raiser4.

It is currently supported for Linux only. It was the first journaling file system introduced with the standard Linux Kernel version 2.4.1. ReiserFS is the default filesystem on the Slackware, SuSE, Xandros, Yoper, Linspire, Kurumin Linux, FTOSX and Libranet Linux distributions.

Reiser4 features

  • Reiser4 is the fastest filesystem.
  • Reiser4 is an atomic file system, which means that your file system operations either entirely occur, or they entirely don't, and they don't corrupt data due to half occurring. This is done without significant performance losses, because algorithms were invented to do it without copying the data twice, which reduces the chance of data corruption in this file system.
  • It is capable of handling very large directories with hundreds of millions of files.
  • Efficient support of small files, in terms of disk space and speed. Reiser4 uses dancing trees, which obsolete the balanced tree algorithms used in databases.
  • Reiser4 is more space efficient than other file systems because it squishes small files together rather than wasting space due to block alignment like they do. It also means that Reiser4 scales better than any other filesystem.
  • Reiser4 is based on plugins, which means that it will attract many outside contributors, and you'll be able to upgrade to their innovations without reformatting your disk. If you like to code, you'll really like plugins. This is great feature in this type of filesystem.

ReiserFS Blocks:
The reiserfs partition is divided into fixed size blocks. The blocks are numbered sequentially starting with block 0. There is a maximum number of 2^32 possible blocks in one partition.

The partition starts with the first 64k unused so that there is enough room for partition labels or boot loaders and then follows the superblock. The superblock contains important information about the partition such as the block size and the block numbers of the root and journal nodes. The default block size for reiserfs under Linux is 4096 bytes. There is only one instance of the superblock for the entire partition.

Directly following the superblock is a block containing a bitmap of free blocks. The number of blocks mapped in the bitmap depends directly on the block size.

Bitmap Blocks:
The bitmap blocks are simple bitmaps, where every bit stands for a block number. One bitmap block can address (8 * block size) number of blocks. Byte 0 of the bitmap maps to the first eight blocks, the second byte to the next eight, and so on. Within a byte, the low order bits map to the lower number blocks. Bit 0 maps to the first block, bit 1 to the second, etc. A set bit indicates that the block is in use, a zero bit indicates that the block is free.

Storage:
Blocks of 4096 bytes are the smallest individually accessible portion of the disk. Files smaller than one block (i.e. whose size is less than 4K) can be packed together inside a block.

  • You can store a maximum of 4,294,967,296 files in a reiserfs partition.
  • You can put no more than 2,147,483,648 files in a directory.
  • The maximum number of subdirectories inside a directory is 64.536.
  • The maximum file-size is 17.6 terabytes on 32 bit architectures.
  • You can have as much as 4,294,967,296 links to a file.
  • Finally your file system overall maximum size will be 4,294,967,296 x 4K blocks, i.e., 17.6 terabytes.

The File System Tree

The Reiser file system is made up of a balanced tree (B+ or S+ tree as it is called in the reiserfs documentation). The tree is composed of internal nodes and leaf nodes. Each node is a disk block. Each object (called an item) in reiserfs (file, directory, or stat item) is assigned a unique key, which can be compared to an inode node number in other file systems. The internal nodes are mainly composed of keys and pointers to their child nodes. There is always one more pointer than there are keys.

Block Headers:
Each disk block that belongs to an internal or leaf node starts with a block header. Only unformatted blocks don't have a block header. A block header is always 24 bytes long.

Keys:
Keys are used in the Reiser file system to uniquely identify items, but also to locate them in the tree and achieve local groupings of items that belong together. A key consists of four objects: the directory id, the object id, the offset within the object, and a type.

  • Note that the actual object identifier is only one part of the key.
  • The directory id is present so that files that belong into the same directory are grouped together and for the most part are located in the same subtree(s).
  • The offset is present because an indirect item can at most contain (blocksize-48)/4 pointers to unformatted blocks. For a block size of 4096 bytes this would result in a maximum file size of 4048KB. To be able to handle larger files, multiple keys are used to reference the file. All fields of the key are the same, except for the offset, which denotes the offset in bytes of the file, which a particular key references.

Internal Nodes:
An internal node block consists of the block header, keys, and pointers to child nodes.

Leaf Nodes: Leaf nodes are found at the lowest level of the tree. Except for indirect items all the data is contained within the leaf nodes. Leaf nodes are made up of the block header, item headers, and items.

Item Headers: The item header describes the item it refers to. It contains the key for the item as well as the item's location and size within the leaf node. The type of the item is determined by its key.

The Journal

The journal in reiserfs is a continuous set of disk blocks and it describes transactions made to the file system. Each time the file system is modified in any way, instead of performing the changes directly in the file system, the transactions that belong together are written into the journal first. At a later point the transactions in the journal will be flushed and, if everything was successful.

Transactions:
Transactions describe changes in the file system. Instead of directly modifying blocks in the file system tree, new or changed blocks are first written into the journal and mapped to their real location in the file system.
A transaction consists of a transaction description block, a list of blocks, and a commit block at the end. All those blocks are contiguous within the journal.

Description Block:
The description block contains the transaction and mount IDs, the number of blocks in the transaction, a magic number, and the first possible half of mappings.

Commit Block:
The commit block terminates a transaction. It contains a copy of the transaction ID and the transaction length.

Data Recovery with ReiserFS

ReiserFS has utility reiserfsck to repair the whole disk partition. ReiserFS is very good in file undeleting as it gives the concept of file transactions, but even though if u have ever lost your critical files and you don't know much about data recovery, don't try any general steps to recover data.

Data Recovery info image For data recovery, visit www.optimumrecovery.com

Top of current page image Up

 

About Us  |   Data Recovery Services   |  Data Security  |  Privacy Policy  |   Partners  |  Testimonials  |  Contact Us  |  Site Map
Data Recovery UK | Data Recovery US
Copyright 2006 © Optimum Data Recovery, Inc.