lsmksysb Command
Purpose
Lists or restores the contents of a volume group backup on a specified media.
Syntax
lsmksysb [ -b blocks ] [ -f device ] [ -a ] [ -c ] [ -l ] [ -n ] [ -r ] [ -s ] [ -d path ] [ -B ] [ -D ] [ -L ] [ -V ] [ file_list ]
Description
The lsmksysb command lists the contents of a volume group backup from tape, file, CD-ROM, or other source and can be used to restore files from a valid backup source. The lsmksysb command also works for multi-volume backups such as multiple CDs, DVDs, USB disks, or tapes.
The lsmksysb -r and restorevgfiles commands perform identical operations and must be considered interchangeable.
Flags
Item | Description |
---|---|
-a | Verifies the physical block size of the tape backup, as specified by the -b block flag. You might need to alter the block size if necessary to read the backup. The -a flag is valid only when a tape backup is used. |
-b blocks | Specifies the number of 512-byte blocks to read in a single input operation, as defined by the blocks parameter. If the blocks parameter is not specified, the number of blocks read defaults to 100. |
-B | Prints the volume group backup log to stdout. This
flag displays the past 256 backups (roughly). The log is in alog
format and is kept in /var/adm/ras/vgbackuplog. Each line
of the log is a semicolon-separated list of the file or device name,
the command that is used to make backup, date, shrink size, full size
of the backup, and recommended maintenance or technology level (if
any).
Note: The shrink size is the size of the data on all file systems.
The full size is total size of each file system (unused + data).
|
-c | Produces colon-separated output. This flag works only with the -l and -L flags. |
-d path | Specifies the directory path to which the files are restored, as defined by the path parameter. If the -d parameter is not used, the current working directory is used. This can be a problem if the current working directory is root. We recommend writing to a temporary folder instead of to root. |
-D | Produces debug output. |
-f device | Specifies the type of device containing the backup (file, tape, CD-ROM, or other source) as defined by the device parameter. When -f is not specified, device defaults to /dev/rmt0. |
-l | Displays useful information about a volume group backup. This flag requires the -f device flag. This flag causes lsmksysb to display information such as volume group, date and time backup was made, uname output from backed up system, oslevel, recommended maintenance or technology level, backup size in megabytes, and backup shrink size in megabytes. The shrink size is the size of the data on all file systems. The full size is the total size of each file system (unused + data). The -l flag also displays the logical volume and file system information of the backed up volume group, equivalent to running "lsvg -l vgname". |
-L | Displays lpp fileset information about a mksysb backup
only. This flag requires the -f device flag and displays the equivalent information to that produced by invoking "lslpp -l" on the running backed up system. This flag does not produce output about any volume group backup other than that produced by mksysb. |
-n | Does not restore ACLs, PCLs, or extended attributes |
-r | Specifies to restore the backup files, as defined by the file-list parameter. If the file-list parameter is not specified, then all files in the backup are restored. If the -r flag is not used, then executing the lsmksysb command lists only the files in the specified backup. |
-s | Specifies that the backup source is a user volume group and not rootvg. |
-V | Verifies a tape backup. This flag requires the -f device flag and works for tape devices only. The -V flag causes lsmksysb to verify the readability of the header of each file on the volume group backup and print any errors that occur to stderr. |
Parameters
Item | Description |
---|---|
file_list | Identifies the list of files to be restored. This parameter is used only when the -r flag is specified. The full path of the files relative to the current directory must be specified in the space-separated list. All files in the specified directory are restored unless otherwise directed. If you are restoring all files in a directory, we recommend writing to a temporary folder instead of to root. |
Examples
- To list the contents of the system backup that is on the default
device /dev/rmt0, enter the following command:
lsmksysb
- To list the contents of the system backup that is on device /dev/cd1,
enter the following command:
lsmksysb -f /dev/cd1
- To list the contents of the system backup that is on device /dev/cd1,
which is a user volume group that is not rootvg, enter the following
command:
lsmksysb -f /dev/cd1 -s
- To restore /etc/filesystems from the system backup that
is on device /dev/cd1, enter the following command:
lsmksysb -f /dev/cd1 -r ./etc/filesystems
- To restore all files in the /myfs/test directory of the
non-rootvg backup, which is on device /dev/cd1, and write the
restored files to /data/myfiles, enter the following command:
lsmksysb -f /dev/cd1 -r -s -d /data/myfiles ./myfs/test
- To display colon separated lpp information about a mksysb backup
tape that is on /dev/rmt0, enter the following command:
lsmksysb -Lc -f /dev/rmt0
- To display the backup log of the volume group to stdout,
enter the following command:
lsmksysb -B
- To list volume group and general backup data about a backup that
is on /tmp/mybackup, enter the following command:
lsmksysb -l -f /tmp/mybackup
- To verify the readability of each header on a volume group backup
tape in /dev/rmt0, enter the following command:
lsmksysb -V -f /dev/rmt0
- To list the contents of the system backup that is on device /dev/usbms0, enter
the following command:
lsmksysb –f /dev/usbms0
Files
Item | Description |
---|---|
/usr/bin/lsmksysb | Contains the lsmksysb command |