|
Home | Switchboard | Unix Administration | Red Hat | TCP/IP Networks | Neoliberalism | Toxic Managers |
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and bastardization of classic Unix |
|
There are two types of snapshots available in AIX:
|
Both are documented extremely poorly. I hope that this page and a companion page about chfs command will help to use this feature more widely.
File system snapshots are available from AIX 5L v5.2 in JFS2 file systems. Snapshots had to be created in a separate logical volume (in mirrored drive pair). This is called “JFS2 External Snapshot”. External snapshots are created with chfs command
After creation the snapshot remains static and it retains all the information form the original file system (called the snappedFS) including security permissions. You can create a JFS2 snapshot without unmounting or quiescing the file system. You can use a JFS2 snapshot to use as an online backup of the file system, to access the files or directories as they existed when the snapshot was taken, or to back up to removable media.
Note the following about JFS2 snapshots:
Starting from AIX V6.1 IBM offers the ability to create snapshots with
the file system (internal snapshots). 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
Technote (FAQ)Question
This document is a quick guide to using snapshots of JFS2 filesystems
Answer
The JFS2 snapshot command will create an image of a filesystem at a point in time, allowing the user to back up data from the snapshot rather than from the original filesystem. This allows backing up data without having to stop using it first.
The concept used in the snapped filesystem is "copy on write". During creation of the snapshot filesystem the source filesystem is quiesced while the copy is made, to insure a proper copy. Then only the filesystem structure is created. When any modification is done to the source system, such as a write of data or delete, the original data is copied into the snapped filesystem.Usually a snapshot filesystem will only need to be 2-6% of the size of the original filesystem, due to this copy-on-write feature.
* Creating a snapshot:
Find out the size of the filesystem:# lsfs -q /origfs
Name Nodename Mount Pt VFS Size Options Auto
Accounting
/dev/fslv02 -- /origfs jfs2 4194304 rw,cio no
no
(lv size: 4194304, fs size: 4194304, block size: 4096, sparse files: yes, inline log: no, inline log size: 0, reserved: 0, reserved: 0, DMAPI: no, VIX: yes)In the lsfs -q output the size is reported in 512-byte blocks. So in the above example the filesystem and logical volume are 2Gb in size. We'll make the snapshot filesystem 204Mb (10% of the original).
# snapshot -o snapfrom=/origfs -o size=419430
Snapshot for file system /origfs created on /dev/fslv05* Mounting a snapshot:
# mount -v jfs2 -o snapshot /dev/fslv05 /mysnap* Finding out if a fs has a snapshot already:
# snapshot -q /origfsSnapshots for /origfs
Current Location 512-blocks Free Time
* /dev/fslv05 419430 418662 Fri Apr 21 08:30:36 PDT 2006* Deleting a snapshot:
# snapshot -d /dev/fslv05
rmlv: Logical volume fslv05 is removedFor further information see the man page for the snapshot command.
You can make an point-in-time image of a JFS file system or of a JFS2 file system (AIX® 5.2 and later), which you can then use for backup purposes. There are differences, however, in the requirements and behavior of this image for each file system type.
For a JFS file system, you can split off a read-only static copy of a mirrored copy of the file system. Typically, a mirrored copy is updated whenever the original file system is updated, but this point-in-time copy does not change. It remains a stable image of the point in time at which the copy was made. When this image is used for backing up, any modifications that begin after you begin the procedure to create the image might not be present in the backup copy. Therefore, it is recommended that file system activity be minimal while the split is taking place. Any changes that occur after the split is made will not be present in the backup copy.
For a JFS2 file system, the point-in-time image is called a snapshot. The snapshot remains static and it retains the same security permissions as the original file system (called the snappedFS) had when the snapshot was made. Also, you can create a JFS2 snapshot without unmounting or quiescing the file system. You can use a JFS2 snapshot to use as an online backup of the file system, to access the files or directories as they existed when the snapshot was taken, or to back up to removable media. Note the following about JFS2 snapshots:
- A snapshot image of the root (/) or /usr file system is overwritten when the system is rebooted. Snapshots of other file systems can be preserved by unmounting the file system before rebooting. Snapshots created in AIX 5.2 with 5200-01 are recoverable. When fsck or logredo runs on a JFS2 filesystem with a snapshot created on AIX 5.2 with 5200-01, the snapshot will be preserved. A cleanly unmounted filesystem with an AIX 5.2-created snapshot will also be recoverable once it is mounted on an AIX 5.2 with 5200-01 system.
- Running the defragfs command against a file system with snapshots is not recommended. Every block that is moved during defragmentation must also be copied to the snapshot, which is both time consuming and a waste of space in the snapshot logical volume.
- If a snapshot runs out of space, all snapshots for that snappedFS are deleted. This failure writes an entry to the error log.
- If a write to a snapshot fails, all snapshots for that snappedFS are deleted. This failure writes an entry to the error log.
- A snapshot that is created or accessed on a AIX 5.2 with 5200-01 system cannot be accessed on an AIX 5.2 system. These snapshots must be deleted before the filesystem can be mounted.
- A JFS2 file system that has a snapshot on AIX 5.3 cannot be accessed on any releases prior to AIX 5.2 with 5200-01. If the system is to be moved back, the snapshots must be deleted first to allow file system access.
You can make a point-in-time image of a JFS2 file system that you can then use for backup purposes.
The point-in-time image for a JFS2 file system is called a snapshot. The snapshot remains static and retains the same security permissions that the original file system (called the snappedFS) had when the snapshot was made. Also, you can create a JFS2 snapshot without unmounting the file system, or quiescing the file system. You can use a JFS2 snapshot to:
- Access the files or directories as they existed when the snapshot was taken.
- Backup to removable media.
There are two types of JFS2 snapshots: internal and external. A JFS2 external snapshot is created in a separate logical volume from the file system. The external snapshot can be mounted separately from the file system at its own unique mount point.
A JFS2 internal snapshot is created in the same logical volume as the file system and allocates blocks from the file system. An internal snapshot is accessible from the invisible .snapshot directory in the root of the JFS2 file system with the snapshot. A JFS2 file system must be enabled to support internal snapshots at the time the file system is created.
JFS2 snapshots do not support checking of file system quotas. You cannot use the repquota command on the snapshot to determine the state of the quota. The point-in-time quota information is preserved if you roll back the file system image to the snapshot image. Note the following considerations specific to JFS2 external snapshots and JFS2 internal snapshots:
- An external snapshot that is created or accessed on an AIX® 5.2 with 5200-01 system cannot be accessed on an AIX 5.2 system. These snapshots must be deleted before the file system can be mounted.
- A JFS2 file system that has a snapshot on AIX 5.3 cannot be accessed on any releases prior to AIX 5.2 with 5200-01. If the system is to be moved back, the snapshots must be deleted first to allow file system access.
- Running the defragfs command against a JFS2 file system with external snapshots is not recommended because every block that is moved during defragmentation must also be copied to the snapshot, which is both time consuming and a waste of space in the snapshot logical volume.
- If an external snapshot runs out of space, or if an external snapshot fails, all external snapshots for that snappedFS are marked invalid. Further access to the snapshot will fail. These failures write an entry to the error log.
Internal JFS2 snapshot considerations:
- Internal snapshots are preserved when the logredo command runs on a JFS2 file system with an internal snapshot.
- Internal snapshots are removed if the fsck command has to modify a JFS2 file system to repair it.
- If an internal snapshot runs out of space, or if a write to an internal snapshot fails, all internal snapshots for that snappedFS are marked invalid. Further access to the internal snapshots will fail. These failures write an entry to the error log.
- Internal snapshots are not separately mountable. You can access internal snapshots in the .snapshot directory of the root of the file system immediately after they are created. Consequently, you can access internal snapshots through an NFS server without having to export a separate mount point for the snapshot.
- Internal snapshots are not compatible with AIX releases prior to AIX 6.1. A JFS2 file system created to support internal snapshots cannot be modified on an earlier release of AIX.
- A JFS2 file system created to support internal snapshots is also enabled to support Extended Attributes Version 2.
- A JFS2 file system with internal snapshots cannot be used with a Data Management Application Programming Interface (DMAPI).
- You cannot use the defragfs command against a JFS2 file system with internal snapshots.
- The .snapshot directory is not returned from the readdir() system call. This prevents unintended visiting of the snapshots. Any system calls or commands that depend on the readdir() system call fail with the .snapshot directory (for example, the /bin/pwd command and the getcwd() system call of the .snapshot directory cannot find the parent directory).
"System Management Guide:
Operating Systemand Devices
Make an Online Backup of a Mounted JFS or JFS2
Making an online backup of a mounted journaled file system (JFS or enhanced journaled file system (JFS2) creates a static image of the logical volume that contains the file system Th following procedures describe how to make an online backup=2 Which procedure you choose depends on whether the file system i a JFS or JFS2
Make an Online Backup of a JFS
To make an online backup of a mounted JFS, the logical volum that the file system resides on and the logical volume that it log resides on must be mirrored
Note:
Because the file writes are asynchronous, the split off cop might not contain all data that was written immediately befor the split Any modifications that begin after the split begin might not be present in the backup copy Therefore, it i recommended that file system activity be minimal while the spli is taking place
To split off a mirrored copy of the /home/xyz file system to new mount point named /jfsstaticcopy, type the following:
chfs -a splitcopy&H3D/jfsstaticcopy /home/xyz
You can control which mirrored copy is used as the backup b using the copy attribute The second mirrored copy is th default if a copy is not specified by the user For example:
chfs -a splitcopy&H3D/jfsstaticcopy -a copy&H3D1 /home/xyz
At this point, a read-only copy of the file system is availabl in /jfsstaticcopy Any changes made to the original file syste after the copy is split off are not reflected in the backu copy
To reintegrate the JFS split image as a mirrored copy at th /testcopy mount point, use the following command:
rmfs /testcopy
The rmfs command removes the file system copy from its split-of state and allows it to be reintegrated as a mirrored copy
Make and Back Up a Snapshot of a JFS2
Beginning with AIX 5 2, you can make a snapshot of a mounted JFS that establishes a consistent block-level image of the fil system at a point in time The snapshot image remains stabl even as the file system that was used to create the snapshot called the snappedFS, continues to change The snapshot retain the same security permissions as the snappedFS had when th snapshot was made
In the following scenario, you create a snapshot and back up th snapshot to removable media without unmounting or quiescing th file system, all with one command: backsnap You can also us the snapshot for other purposes, such as accessing the files o directories as they existed when the snapshot was taken You ca do the various snapshot procedures using Web-based Syste Manager, SMIT, or the backsnap and snapshot commands
To create a snapshot of the /home/abc/test file system and bac it up (by name) to the tape device /dev/rmt0, use the followin command:
backsnap -m /tmp/snapshot -s size&H3D16M -i f/dev/rmt /home/abc/test
This command creates a logical volume of 16 megabytes for th snapshot of the JFS2 file system (/home/abc/test) The snapsho is mounted on /tmp/snapshot and then a backup by name of th snapshot is made to the tape device After the backup completes the snapshot remains mounted Use the -R flag with the backsna command if you want the snapshot removed when the backu completes
"Syntax of backnap command:
backsnap&H09Creates and backs up a JFS2 snapshot
backsnap -m /tmp/snapshot/data -s size&H3D16M -i -f /dev/rmt0 /dat : creates a 16 MB LV, creates a snapshot for the /data fil system on the created LV, mounts the snapshot o /tmp/snapshot/data and backups the files and directories in tha file system by name to /dev/rmt0So, you can create a point in time copy of any given open Fil System of JFS2 type and move to a tape device You can als leave the copy in the snapshot file and the using a script wit cdcreate you can move the contens to a CD or DVD
Do you want to copy RDBMS files ??
Related White Papers and Webcasts
The simplest tasks you might need when maintaining file systems are grouped within this table.
Task | SMIT Fast Path | Command or File |
---|---|---|
Backup by name files or directories | smit backfile | backup Note 1 |
Create and back up a JFS2 snapshot image | smit backsnap | backsnap Note 1 |
List all file systems on a disk | smit lsmntdsk | |
List file systems on a removable disk | smit lsmntdsk | |
List mounted file systems | smit fs | |
Mount a group of file systemsNote 5 | smit mountg | mount -t GroupName |
Mount a JFS or JFS2Note 3 | smit mountfs | mount |
Mount a JFS2 snapshot | smit mntsnap | mount -v jfs2 -o snapshot Device MountPoint |
Remove a JFS or JFS2 | smit rmfs | |
Remove a JFS2 snapshot | smit rmsnap | snapshot -d SnapshotDevice |
Revert a JFS2 file system to a point-in-time snapshot | smit rollbacksnap | rollback [-s] [-v] [-c] snappedFS snapshotObject |
Unmount a file systemNote 4 | smit umountfs | |
Unmount a file system on a removable diskNote 4 | smit umntdsk | |
Unmount a group of file systemsNote 5 | smit umountg | umount -t GroupName |
Manage Enhanced Journaled File Systems quotas | smit j2fsquotas | |
Enable or disable quota management | smit j2enablequotas | |
Stop/restart quota limits enforcement | smit j2enforcequotas | quotaon|off -v |
List quota usage | smit j2repquota | repquota -v |
Recalculate current disk block and file usage statistics | smit j2quotacheck | quotacheck -v |
Add a limits class | smit j2addlimit | j2edlimit -e |
Change/show characteristics of a limits class | smit j2changelimit | |
Make a limits class the default limits for a file system | smit j2defaultlimit | |
Assign a user or group to a limits class | smit j2assignlimit | |
List limits classes for a file system | smit j2listlimits | j2edlimit -l '-u' |
Remove a limits class | smit j2removelimit |
Still not clear on why the instructions from the IBM documentation listed below don't work. I know that particular document is from the "AIX 5.3" manual section, but it also states specifically in there that it is valid for AIX 5.2. Maybe that's just an error in that document.
Thanks,
-s-
On Apr 18, 2007, at 6:52 AM, Rick Saylor wrote:
I ran into the same situation a couple of years ago. I worked with IBM support and they determined that with JFS2 file systems you have to the snapshot command, at least on AIX 5.2. I used the filesystem and volume group names from your email and incorporated them into the example below. It should work but I haven't tested it. You may have to change the number of logical partitions on the mklv command. I used 256 but you might have different needs.To create your snapshot try:
1. mklv -y snaplv -t jfs2 emcvg 256
2. snapshot -o snapfrom=/s /dev/snaplv
3. mkdir /s_copy
4. mount -o snapshot /dev/snaplv /s_copyTo remove the snapshot:
1. umount /s_copy
2. snapshot -d /dev/snaplv
3. rmdir /s_copyAgain, please try this on a test system first.
I hope this helps,
RickAt 04:55 PM 4/17/2007, you wrote:
I'm trying to split off a mirrored copy of a logical volume and mount
it as a separate (read-only ) filesystem, as described on the page:<http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp? topic=/com.ibm.aix.baseadmn/doc/baseadmndita/ HT_baseadmn_snapshotjfs.htm>
... but it isn't working. That page says it should work on AIX 5.2,
but here's what I've got:#> df /s
Filesystem 512-blocks Free %Used Iused %Iused Mounted on
/dev/lv21 209715200 65659248 69% 343096 5% /s#> lsfs -q /s
Name Nodename Mount Pt VFS Size
Options Auto Accounting
/dev/lv21 -- /s jfs2 209715200
rw yes no
(lv size: 209715200, fs size: 209715200, block size: 4096, sparse
files: yes, inline log: yes, inline log size: 400, reserved: 0,
reserved: 0, DMAPI: no, VIX: no)#> lslv lv21
LOGICAL VOLUME: lv21 VOLUME GROUP: emcvg
LV IDENTIFIER: 0001dcba00004c00000001047c9fe1c4.5
PERMISSION: read/write
VG STATE: active/complete LV STATE: opened/ syncd
TYPE: jfs2 WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 512
megabyte(s)
COPIES: 2 SCHED POLICY: parallel
LPs: 200 PPs: 400
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 128
MOUNT POINT: /s LABEL: /s
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: no
Serialize IO ?: NO#> lsvg -l emcvg | grep lv21
lv21 jfs2 200 400 2 open/syncd /s
#> mkdir /s_copy#> df /s_copy
Filesystem 512-blocks Free %Used Iused %Iused Mounted on
/dev/hd4 2621440 1475112 44% 3852 1% /
#> chfs -a splitcopy=/s_copy /s#> echo $?
0#> df /s_copy
Filesystem 512-blocks Free %Used Iused %Iused Mounted on
/dev/hd4 2621440 1475112 44% 3852 1% /
Note that the "chfs" command returns no error, and exits "0". The
split never happens though. Am I missing some crucial but non- obvious step here? This system is at:#> oslevel -s
5200-09-04... so I'm fairly up to date. Thanks in advance for the help ...
I've never done this before!-s-
---------------------------------------------------------------------- ------
Rick Saylor Austin Community College Voice: (512) 223-1182
Director of System Services 9101 Tuscany Way Fax: (512) 223-1211
Information Technology Austin, Texas 78754
Making an online backup of a mounted journaled file system (JFS) or enhanced journaled file system (JFS2) creates a static image of the logical volume that contains the file system.
To make an online backup of a mounted JFS, the logical volume that the file system resides on and the logical volume that its log resides on must be mirrored.
Note: Because the file writes are asynchronous, the split-off copy might not contain all data that was written immediately before the split. Any modifications that begin after the split begins might not be present in the backup copy. Therefore, it is recommended that file system activity be minimal while the split is taking place.
The information in this how-to scenario was tested using specific versions of AIX®. The results you obtain might vary significantly depending on your version and level of AIX. To split off a mirrored copy of the /home/xyz file system to a new mount point named /jfsstaticcopy, type the following:
chfs -a splitcopy=/jfsstaticcopy /home/xyzYou can control which mirrored copy is used as the backup by using the copy attribute. The second mirrored copy is the default if a copy is not specified by the user. For example:chfs -a splitcopy=/jfsstaticcopy -a copy=1 /home/xyzAt this point, a read-only copy of the file system is available in /jfsstaticcopy. Any changes made to the original file system after the copy is split off are not reflected in the backup copy.
To reintegrate the JFS split image as a mirrored copy at the /testcopy mount point, use the following command:rmfs /testcopyThe rmfs command removes the file system copy from its split-off state and allows it to be reintegrated as a mirrored copy.
Parent topic: Storage management (Logical Volume Manager)
Watching this technical demo by Nigel Griffiths got me thinking. I like taking snapshots and flash copies on my external SAN devices. What if I want to take a snapshot of a file system on my AIX machine that isn't connected to a SAN?
Read more about these capabilities here.
From the document:
"You can make a point-in-time image of a JFS2 file system that you can then use for backup purposes. The point-in-time image for a JFS2 file system is called a snapshot. The snapshot remains static and retains the same security permissions that the original file system (called the snappedFS) had when the snapshot was made. Also, you can create a JFS2 snapshot without unmounting the file system, or quiescing the file system. You can use a JFS2 snapshot to:
* Access the files or directories as they existed when the snapshot was taken.
* Backup to removable media."There are two types of JFS2 snapshots: internal and external. A JFS2 external snapshot is created in a separate logical volume from the file system. The external snapshot can be mounted separately from the file system at its own unique mount point."
So how do I do it? I'll duplicate what Nigel did in his video demo using my test machine that runs AIX 6.1.
First, I use the following command to create a file system in rootvg that's 500MB in size:
crfs -v jfs2 –g rootvg -a size=500M –m /snaptest -a isnapshot=yes
Then I mount the file system:
mount /snaptest
Then run two commands:
touch hello this is a test
echo "this is a test" > test.out
Finally, I run:
ls -la
drwxr-xr-x 3 root system 256 Oct 23 14:42 .
drwxr-xr-x 22 root system 4096 Oct 23 14:37 ..
-rw-r--r-- 1 root system 0 Oct 23 14:38 a
-rw-r--r-- 1 root system 0 Oct 23 14:38 hello
-rw-r--r-- 1 root system 0 Oct 23 14:38 is
drwxr-xr-x 2 root system 256 Oct 23 14:37 lost+found
-rw-r--r-- 1 root system 0 Oct 23 14:38 test
-rw-r--r-- 1 root system 15 Oct 23 14:42 test.out
-rw-r--r-- 1 root system 0 Oct 23 14:38 thisTo see the available menu options, go here:
smitty > system storage management > file systems > add change show delete filesystems > enhanced journaled filesystems
The menu options are:
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 SnapshotIn our case we want to create a snapshot. This can also be done from the command line:
snapshot -o snapfrom=/snaptest –n testsnap
Running ls –la reveals no additions in the file system, but if you cd to .snapshot, you'll find the files you just created.
I cd into /snaptest/.snapshot/testsnap and run ls to find all of the files that were in my file system when I took the snapshot.
Creating a snapshot allows you to easily recover files should someone delete them, without having to resort to restoring from a TSM machine or some other backup mechanism.
Reply from cdelgadop
on 4/15/2006 10:49 AMHi
You can use snapshots for many things including taking backups=2 From the IBM Documentation:
"System Management Guide:
Operating System and DevicesMake an Online Backup of a Mounted JFS or JFS2
Making an online backup of a mounted journaled file system (JFS or enhanced journaled file system (JFS2) creates a static image of the logical volume that contains the file system.
Th following procedures describe how to make an online backup=2 Which procedure you choose depends on whether the file system i a JFS or JFS2
Make an Online Backup of a JFSTo make an online backup of a mounted JFS, the logical volume that the file system resides on and the logical volume that it log resides on must be mirrored
Note:
Because the file writes are asynchronous, the split off cop might not contain all data that was written immediately befor the split Any modifications that begin after the split begin might not be present in the backup copy Therefore, it i recommended that file system activity be minimal while the spli is taking place
To split off a mirrored copy of the /home/xyz file system to new mount point named /jfsstaticcopy, type the following:
chfs -a splitcopy&H3D/jfsstaticcopy /home/xyz
You can control which mirrored copy is used as the backup b using the copy attribute The second mirrored copy is th default if a copy is not specified by the user For example:
chfs -a splitcopy&H3D/jfsstaticcopy -a copy&H3D1 /home/xyz
At this point, a read-only copy of the file system is availabl in /jfsstaticcopy Any changes made to the original file syste after the copy is split off are not reflected in the backu copy
To reintegrate the JFS split image as a mirrored copy at th /testcopy mount point, use the following command:
rmfs /testcopy
The rmfs command removes the file system copy from its split-of state and allows it to be reintegrated as a mirrored copy
Make and Back Up a Snapshot of a JFS2
Beginning with AIX 52, you can make a snapshot of a mounted JFS that establishes a consistent block-level image of the fil system at a point in time The snapshot image remains stabl even as the file system that was used to create the snapshot called the snappedFS, continues to change The snapshot retain the same security permissions as the snappedFS had when th snapshot was made
In the following scenario, you create a snapshot and back up th snapshot to removable media without unmounting or quiescing th file system, all with one command: backsnap You can also us the snapshot for other purposes, such as accessing the files o directories as they existed when the snapshot was taken You ca do the various snapshot procedures using Web-based Syste Manager, SMIT, or the backsnap and snapshot commands
To create a snapshot of the /home/abc/test file system and bac it up (by name) to the tape device /dev/rmt0, use the followin command:
backsnap -m /tmp/snapshot -s size&H3D16M -i f/dev/rmt /home/abc/test
This command creates a logical volume of 16 megabytes for th snapshot of the JFS2 file system (/home/abc/test) The snapsho is mounted on /tmp/snapshot and then a backup by name of th snapshot is made to the tape device After the backup completes the snapshot remains mounted Use the -R flag with the backsna command if you want the snapshot removed when the backu completes
"Syntax of backnap command:
backsnap&H09Creates and backs up a JFS2 snapshot
backsnap -m /tmp/snapshot/data -s size&H3D16M -i -f /dev/rmt0 /dat : creates a 16 MB LV, creates a snapshot for the /data fil system on the created LV, mounts the snapshot o /tmp/snapshot/data and backups the files and directories in tha file system by name to /dev/rmt0So, you can create a point in time copy of any given open Fil System of JFS2 type and move to a tape device You can als leave the copy in the snapshot file and the using a script wit cdcreate you can move the contens to a CD or DVD
Do you want to copy RDBMS files ??
Vendors Mentioned
IBM Operating Systems, IBM Security,
Beginning with AIX 5.2, you can make a snapshot of a mounted JFS2 that establishes a consistent block-level image of the file system at a point in time. The snapshot image remains stable even as the file system that was used to create the snapshot, called the snappedFS, continues to change. The snapshot retains the same security permissions as the snappedFS had when the snapshot was made.
In the following scenario, you create a snapshot and back up the snapshot to removable media without unmounting or quiescing the file system, all with one command: backsnap. You can also use the snapshot for other purposes, such as accessing the files or directories as they existed when the snapshot was taken. You can do the various snapshot procedures using Web-based System Manager, SMIT, or the backsnap and snapshot commands.
To create a snapshot of the /home/abc/test file system and back it up (by name) to the tape device /dev/rmt0, use the following command:
backsnap -m /tmp/snapshot -s size=16M -i f/dev/rmt0 /home/abc/test
This command creates a logical volume of 16 megabytes for the snapshot of the JFS2 file system (/home/abc/test). The snapshot is mounted on /tmp/snapshot and then a backup by name of the snapshot is made to the tape device. After the backup completes, the snapshot remains mounted. Use the -R flag with the backsnap command if you want the snapshot removed when the backup completes.
Another way to do the same:
snapshot Modifies, creates or queries properties a JFS2 snapshot (a consistent block level image of a file system). The bos.rte.file fileset must be installed.
snapshot -o snapfrom=/data /dev/snapsb : creates a snapshot for the /data file system on the exisiting /dev/snapsb LV.
snapshot -d /dev/snapsb : deletes the snapshot and the LV containing the snapshot.Uses:
Split mirror copy.
backup or snapshot backups in a given point of time performed by the S, not by the application.
In a given Geografical Mirror enviroment you can use snapshots to copy data between the remote nodes.
Hi
I'm trying for several days to use jfs2 snapshot but i
just don't manage to do :(
Here what I have to do (automatic everynight in
crontab) :stop database
snapshot /db/data (jfs2 fs in datavg)
snapshot /db/data/files (jfs2 fs in datavg)
snapshot /db/data/files/index (jfs2 fs in datavg)
start database
mount snapshot fs
backup snapshot fs with networkerI'm using AIX 5.2 ML03.
I have a specific disk (hdisk5) which belong to datavg
and I want to use it for snapshots.Please can you help? I just can't find how to do.
Thank you very much
kat
AIX Ulagam - AIX World - Monde d'AIX File System Snapshot
Society
Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers : Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism : The Iron Law of Oligarchy : Libertarian Philosophy
Quotes
War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda : SE quotes : Language Design and Programming Quotes : Random IT-related quotes : Somerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose Bierce : Bernard Shaw : Mark Twain Quotes
Bulletin:
Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 : Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law
History:
Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds : Larry Wall : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOS : Programming Languages History : PL/1 : Simula 67 : C : History of GCC development : Scripting Languages : Perl history : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history
Classic books:
The Peter Principle : Parkinson Law : 1984 : The Mythical Man-Month : How to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite
Most popular humor pages:
Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor
The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D
Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.
This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...
|
You can use PayPal to to buy a cup of coffee for authors of this site |
Disclaimer:
The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.
Last modified: March 12, 2019