o2image copies the OCFS2 file system meta-data from the device to the specified image-file. This image file contains the file system skeleton that includes the inodes, directory names and file names. It does not include any file data.
This image file can be useful to debug certain problems that are not reproducible otherwise. Like on-disk corruptions. It could also be used to analyse the file system layout in an aging file system with an eye towards improving performance.
As the image-file contains a copy of all the meta-data blocks, it can be a large file. By default, it is created in a packed format, in which all meta-data blocks are written back-to-back. With the -r option, the user could choose to have the file in the raw (or sparse) format, in which the blocks are written to the same offset as they are on the device.
debugfs.ocfs2 understands both formats.
o2image also has the option, -I, to restore the meta-data from the image file onto the device. This option will rarely be useful to end-users and has been written specifically for developers and testers.
|[root@node1 ~]# o2image /dev/sda1 sda1.out|
|Copies metadata blocks from /dev/sda1 device to sda1.out file|
|[root@node1 ~] o2image -I /dev/sda1 sda1.out|
|Use with CAUTION. Copies meta-data blocks from sda1.out onto the|