Monday, December 15, 2008

File System Snapshot

File system snapshots are available from AIX 5L v5.2 in JFS2 file systems. Snapshots had to be created into separate logical volumes. This is called “JFS2 External Snapshot”.

Starting from AIX V6.1 IBM offers the ability to create snapshots with the file system. This is called as “JFS2 Internal Snapshot”. These internal snapshots are stored under /fsmountpoint/.snapshot/snapshotname.

Both the internal and the external snapshots keep track of the changes to the snapped file system by saving the modified or deleted file blocks. Snapshots provide point-in-time (PIT) images of the source file system. Basically snapshots are used for taking PIT images (backup) of a file system during production runtime.

Advantages of Internal Snapshot:

a) No super user permissions are necessary to access data from a snapshot, since no initial mount operation is required.
b) No additional file system or logical volume needs to be maintained and monitored.
c) Snapshots are easily NFS exported, since they are in held in the same filesystem.

Management of Internal snapshots:

A JFS2 file system must be created with the new -a isnapshot=yes option. Existing file systems created without the isnapshot option cannot be used for internal snapshots. They have to be recreated or have to use external snapshots.

To create an internal snapshot:

# snapshot -o snapfrom=/oracle -n snap10
Snapshot "snap10" for file system /oracle created.

To create an external snapshot:
# snapshot -o snapfrom=/oralce /dev/snaporacle
This command creates a snapshot for the /oracle file system on the /dev/snaporacle logical volume, which already exists.

To list all snapshots for a file system:

# snapshot –q /oracle
Snapshots for /oracle
Current Name Time
* snap10 Mon Dec 15 09:17:51 CDT 2008

Files under this snapshot “snap10” are available under /oracle/.snapshot/snap10 directory. These files are read only; no modifications are allowed.

To delete an internal snapshot:

# snapshot –d –n snap10 /oracle


SMIT Screens:

To access smitty menu items, following the below steps

smitty> system storage management> file systems> add change show delete filesystems> enhanced journaled filesystems

shows the below options

List Snapshots for an Enhanced Journaled File System
Create Snapshot for an Enhanced Journaled File System
Mount Snapshot for an Enhanced Journaled File System
Remove Snapshot for an Enhanced Journaled File System
Unmount Snapshot for an Enhanced Journaled File System
Change Snapshot for an Enhanced Journaled File System
Rollback an Enhanced Journaled File System to a Snapshot

Some points on Internal snapshots:

1. A snapped file system can be mounted read only on previous AIX 5L versions. The snapshot itself cannot be accessed. The file system must be in a clean state; run the fsck command to ensure that this is true.

2. A file system created with the ability for internal snapshots can still have external snapshots.

3. Once a file system has been enabled to use internal snapshots, this cannot be undone.

4. If the fsck command has to modify the file system, any internal snapshots for the file system will be deleted by fsck.

5. Snapped file systems cannot be shrunk.

6. The defragfs command cannot be run on a file system with internal snapshots.


Some points on Internal and External snapshots:

1. A file system can use exclusively one type of snapshot at the same time.

2. External snapshots are persistent across a system reboot.

3. Typically, a snapshot will need two to six percent of the space needed for the snapped file system. For a highly active file system, 15 percent is estimated.

4. During the creation of a snapshots, only read access to the snapped file system is allowed.

5. There is reduced performance for write operations to a snapped file system. Read operations are not affected.

6. Snapshots are not replacement for backups. A snapshot depends always on the snapped file system, while backups have no dependencies on the source.

7. Neither the mksysb nor alt_disk_install commands will preserve snapshots.

8. A file system with snapshots cannot be managed by DMAPI. A file system being managed by DMAPI cannot create a snapshot.

No comments: