Restoring a file system from a snapshot
Use the mmrestorefs command to restore user data and attribute files in an active file system from a snapshot.
Prior to issuing the mmrestorefs command, ensure that the file system is mounted. When restoring from an independent fileset snapshot, ensure that the fileset is in linked state.
Existing snapshots, including the one being used in the restore, are not modified by the mmrestorefs command. To obtain a snapshot of the restored file system, you must issue the mmcrsnapshot command to capture it before issuing the mmrestorefs command again.
As an example, suppose that you have a directory structure
similar to the following:
/fs1/file1
/fs1/userA/file2
/fs1/userA/file3
/fs1/.snapshots/snap1/file1
/fs1/.snapshots/snap1/userA/file2
/fs1/.snapshots/snap1/userA/file3
If the directory userA is
then deleted, the structure becomes similar to this:
/fs1/file1
/fs1/.snapshots/snap1/file1
/fs1/.snapshots/snap1/userA/file2
/fs1/.snapshots/snap1/userA/file3
The directory userB is
then created using the inode originally assigned to userA,
and another snapshot is taken:
mmcrsnapshot fs1 snap2
The
output is similar to this:
Writing dirty data to disk.
Quiescing all file system operations.
Writing dirty data to disk again.
Snapshot snap2 created with id 2.
The resulting
directory structure is similar to the following:
/fs1/file1
/fs1/userB/file2b
/fs1/userB/file3b
/fs1/.snapshots/snap1/file1
/fs1/.snapshots/snap1/userA/file2
/fs1/.snapshots/snap1/userA/file3
/fs1/.snapshots/snap2/file1
/fs1/.snapshots/snap2/userB/file2b
/fs1/.snapshots/snap2/userB/file3b
The file system is then restored from snap1:
mmrestorefs fs1 snap1
The
resulting directory structure is similar to the following:
/fs1/file1
/fs1/userA/file2
/fs1/userA/file3
/fs1/.snapshots/snap1/file1
/fs1/.snapshots/snap1/userA/file2
/fs1/.snapshots/snap1/userA/file3
/fs1/.snapshots/snap2/file1
/fs1/.snapshots/snap2/userB/file2b
/fs1/.snapshots/snap2/userB/file3b
For complete usage information, see mmrestorefs command.