RFSTool Usage

Autodetecting partitions

To detect which partitions-as-windows-sees-them are ReiserFS partitions, just execute

c:\> rfstool autodetect

You can also try the more verbose version,

c:\> rfstool info

Listing files

Once the partition is selected, you can just execute rfstool:

c:\> rfstool

This will list all files in "/". Note that the list is unsorted (see limitations above). To list all files in "/etc", you can do

c:\> rfstool /etc

and so on for all directories you like. For example, the installed truetype fonts can be listed by using

c:\> rfstool /usr/X11R6/lib/X11/fonts/truetype

Copying files

To retrieve a file from the partition, use the following syntax:

c:\> rfstool cp <reiserfs filename> <local filename>

Note that the local filename is just that - a FILENAME, not a directory (i.e. not "."). Here is an example that retrieves the lilo boot configuration and the system log:

c:\> rfstool cp /etc/lilo.conf lilo.txt
c:\> rfstool cp /var/log/messages messages.txt

Copying directories

Starting with version 0.7, you can copy directories recursively. All you need is to specify the command line option -r for "recurse subdirectories". Example:

c:\> rfstool cp /etc e:\linux\backup\etc

will copy all files in /etc and all subdirectories to the local directory e:\linux\backup\etc. All local directories will be created as needed.

Metadata backup

Note: Please read the "Metadata Warnings" section below.

The ReiserFS metadata contains information about all files on a harddisk at any given point. rfstool allows you to extract and backup this information. At a later time, you can use that backup to restore files otherwise lost. You could do a cron-job on Linux to save the metadata every day.

Scenario 1: Some hostile pal logs in as root and does a "rm -r /". This means only that the metadata has been lost, not that the actual file data has been lost. You can use rfstool to attempt to recover.

Scenario 2: You have a disk error, and ReiserFS refuses to mount. You can try to restore as many files as possible from that partition using the previously saved metadata.

To use this feature, you have to backup the metadata. This is done using the following syntax:

c:\> rfstool backup <name-of-backup-file>

This will actually create two files, <name-of-backup-file> and <name-of-backup-file.index>. You must save both, or the metadata will become useless.

Note: The backup file can become quite large, for my main 60G partition I have 420 mb of Metadata backup.

Metadata restore

You can ask rfstool to not read the metadata from disk, but instead from the backup file. For example, to list all files in "/" as they are saved in the metadata, do something like this:

c:\> rfstool -x<name-of-backup-file> /

Similarily, to retrieve a single file, for example /etc/fstab, do

c:\> rfstool -x<name-of-backup-file> /etc/fstab fstab.txt

And to retrieve all files from a partition, use something like this:

c:\> rfstool -r -x<name-of-backup-file> / e:\restored

Note: The target files should never reside on the partition that is being restored, or you will definitely mess up the files.

Metadata warnings

I feel I should point out some warnings about metadata backup & restore.