Online Backups and Recovery in a Snap
The ability to perform a JFS2 file system backup online means minimal downtime—and that’s a good thing in any system admin’s book. Using AIX snapshots on JFS2 file systems, you can do just that—create an online backup. With this process, three kinds of file system backups are made at a point in time. And because the data file blocks are copied using the copy-on-write method, the resulting snapshot doesn’t require much space. The different types of snapshots are internal, external and backsnap. Here, we’ll focus on external snapshots and backsnaps.
Why use snapshot instead of the tar or copy utilities? With snapshot, the file system is frozen, ensuring you get a full copy, and avoid “open file,” “running process” or “file not found” issues. Also, there’s generally no need to shut down an application, though I typically go for a quiesce on an application prior to doing a snapshot; then un-quiesce afterwards.
You can have up to 15 continuous external snapshots of a JFS2 file system. When upgrading applications within a test environment, it’s quite common to take a snapshot after each refresh of that environment contained in the file system.
Doing a JFS2 online backup is all well and good, but one also needs the ability to restore in case events go wrong. Using the rollback utility, external snapshots can be rolled back to the point when a snapshot was taken by specifying the device the snapshot resides on. It doesn’t get much better than that. For the backsnap rollback, use the restore command.
Which method is used to create the snapshots will depend on what you’re most comfortable with. So let’s go over the different types:
- Are created on any existing JFS2 file system
- Their space exists on a different logical volume
- Can be mounted as a separate file system
- Have a read-only data area
- Is primarily an interface for the snapshot command
- Does all the snapshot work for you
- Holds the resulting backup of the file system in an archived file or on tape
If a snapshot runs out of space, all snapshots for that file system will become invalid—in other words, unusable. In my own work, I prefer external snapshots, mainly because they can be mounted, if required, giving them a more visual presence.