Sponsored Content
Operating Systems AIX Need help in scripting to check if rootvg is mirrored or not Post 302765485 by zaxxon on Saturday 2nd of February 2013 01:23:30 PM
Old 02-02-2013
Xray didn't know it - will send him a PM to be a tad more sensible next time. But you are absolutely right Bakunin. That's the way to go.

Last edited by zaxxon; 02-02-2013 at 02:31 PM.. Reason: spelling
 

10 More Discussions You Might Find Interesting

1. Solaris

How to check the file existence using shell scripting in Solaris-10

Hi, I have a script which will check the fiel existence, the lines are as below if !(test -d ./data) then mkdir data fi In the first line error occurs as below generatelicense.sh: syntax error at line 2: `!' unexpected Where as this script works fine in linux OS. How to solve... (2 Replies)
Discussion started by: krevathi1912
2 Replies

2. UNIX for Dummies Questions & Answers

SQL Connection check though Scripting

Hi Guys, I wanted to check the sql connection through scripting if it is avilable then proceed else stop the process I was trying sqlplus -L username/passwd@sid if this is not sucess it gives non-zero. but if it is success it is going into the sqlplus prompt. So how could i get out... (2 Replies)
Discussion started by: Swapna173
2 Replies

3. Shell Programming and Scripting

New to Shell scripting: Can you check it?

I am trying to write a script to get all the html files under a source directory and and for each html file, run a program with html file as an argument. This program generates an output which I need to save as htmlfilename.txt ( right now i was trying to print it on the command line) ... (11 Replies)
Discussion started by: sapient
11 Replies

4. Shell Programming and Scripting

Scripting to check the size of file and it's existance.

Hi, I am totaly new to create a script . Please help. I have file name retrived from SAP table into a internal table . Like :- /home/td_8d02_int_data_IPCL/ILLUSTRATIONS/CGM/l_pc_112138_01_0_01_00.cgm /home/td_8d02_int_data_IPC-L/ILLUSTRATIONS/CMP/l_pc_112138_01_0_01_00.cmp Objective... (1 Reply)
Discussion started by: amitkumar.b2
1 Replies

5. Shell Programming and Scripting

Help scripting to start, check, and restart processes

Here it goes from my unexperienced point of view. I am using CentOS 5.6. I have a Java based server that needs to be running 24/7/365. To begin from the machine the server is on rebooting; I SSH in to a shell, cd to the server dir, screen -S server1, and execute ./exec (listed below) in the screen.... (12 Replies)
Discussion started by: MacG32
12 Replies

6. Shell Programming and Scripting

C shell scripting, check if link exists on remote servers

Hi, I'm new to C Shell programming. I'm trying to check if a sym link exists on remote server if not send email. I'm not having much luck. Can anyone help? Here is what I have written but it doesn't work. It tells me that my variable was not defined. Here is part of the script, the second... (0 Replies)
Discussion started by: CDi
0 Replies

7. AIX

rootvg mirrored

I want to increase the size of /tmp by 1GB I know that the command is chfs -a size=+1G /tmp But the rootvg is mirrored and when I do a lsvg -p rootvg, I could see 2 disks. Will there be any impact if I increase the size of /tmp when the rootvg is mirrored ? Please advise. (1 Reply)
Discussion started by: newtoaixos
1 Replies

8. Programming

To check the file permissions using python scripting

Hi, For a particular set of files, am trying to check if they are writable. i.e., checking whether they are having permissions greater than 755. Am able to check this using the statement: "if (os.path.isfile(FILE_PATH) and (os.stat(FILE_PATH).st_mode & 0777) == 0777):" But the problem here... (0 Replies)
Discussion started by: arjun_arippa
0 Replies

9. Shell Programming and Scripting

To check the file permissions using python scripting

Hi, For a particular set of files, am trying to check if they are writable. i.e., checking whether they are having permissions greater than 755. Am able to check this using the statement: "if (os.path.isfile(FILE_PATH) and (os.stat(FILE_PATH).st_mode & 0777) == 0777):" But the problem... (1 Reply)
Discussion started by: arjun_arippa
1 Replies

10. Shell Programming and Scripting

How to check the datatypes of the columns are same through shell scripting?

Hi, We have a requirement like, to check the datatypes of columns against database. After loading the sample data in to one of the database, need to compare the datatypes of the columns are matching with the provided files. Is there a way that we can achieve through shell scripting. We... (7 Replies)
Discussion started by: Samah
7 Replies
Commands Reference, Volume 3, i - m

mksysb_Command

  Purpose

   Creates  an	installable image of the root volume group either
in a file or
   onto a bootable tape.

  Syntax

   mksysb [ -a ] [ -A ] [ -b Number ] [ -e ] [ -F filename ] [
   -i ] [ -m ] [ -p ] [ -t argument ] [ -v ] [ -V ] [
   -X ] Device | File

  Description

   Attention: Running the mkszfile or mksysb  commands	with  the
LC_All
   environment	variable  set  (especially  to a non-C value) can
cause
   unexpected system bahavior such as a mixture of character sets
in outputs.
   To  resolve the problem, unset the LC_ALL variable and restart
the program.

   The mksysb command creates a backup of  the	operating  system
(that is, the
   root  volume  group).  You  can use this backup to reinstall a
system to its
   original state after it has been corrupted. If you create  the
backup on
   tape,  the tape is bootable and includes the installation pro-
grams needed
   to install from the backup.

   The file-system image is in backup-file format. The tape  for-
mat includes a
   boot image, a bosinstall image, and an empty table of contents
followed by
   the system backup (root volume group) image. The  root  volume
group image
   is  in  backup-file	format,  starting with the data files and
then any
   optional map files.

   When a bootable backup of a root volume group is created,  the
boot image
   reflects  the  currently running kernel. If the current kernel
is the 64-bit
   kernel, the backup's boot image is also 64-bit,  and  it  only
boots 64-bit
   systems.  If  the current kernel is a 32-bit kernel, the back-
up's boot image
   is 32-bit, and it can boot both 32-bit and 64-bit systems.

   One of the data files mksysb uses is the  /bosinst.data  file.
If a
   /bosinst.data file doesn't exist, /var/adm/ras/bosinst.data is
copied to /
   (root). In AIX 4.3.3 and later versions, mksysb always updates
the
   target_disk_data  stanzas  in  bosinst.data to match the disks
currently in
   the root volume group of the system where the  mksysb  command
is running.

   If  you  are  using a customized /bosinst.data file and do not
want the
   target_disk_data stanzas updated, you must create the file
   /save_bosinst.data_file. The mksysb command	does  not  update
/bosinst.data
   if the /save_bosinst.data_file exists.

   Notes:

    1. The image the mksysb command creates does not include data
on raw
       devices or in user-defined paging spaces.
    2. If you are using a system with a remote-mounted /usr  file
system, you
       cannot reinstall your system from a backup image.
    3.	The  mksysb command may not restore all device configura-
tions for
       special features, such as  /dev/netbios	and  some  device
drivers not
       shipped with the product.
    4.	Some rspc systems for AIX^(R) 5.1 and earlier do not sup-
port booting
       from tape. When you make a bootable  mksysb  image  on  an
rspc system for
       AIX  5.1  and  earlier  that does not support booting from
tape, the
       mksysb command issues a warning indicating that	the  tape
will not be
       bootable.  You  can  install  a mksysb image from a system
that does not
       support booting from tape by booting from a CD and  enter-
ing
       maintenance  mode. In maintenance mode you will be able to
install the
       system backup from tape.
    5. The mksysb command uses the backup command to  create  its
archive
       image. The mksysb command will also save the EA format for
any JFS2
       filesystems being backed up. It uses the /usr/bin/mkvgdata
shell
       script to save this information.

   To create a backup of the operating system to CD, please refer
to the mkcd
   command.

  Flags

   -a	       Does not backup extended attributes or NFS4 ACLs.
   -A	       Backs up DMAPI file system files.
	       Specifies the number of 512-byte blocks	to  write
in a single
	       output  operation.  When the backup command writes
to tape
	       devices, the default is 100 for backups by name.

   -b Number   The write size is the number of blocks  multiplied
by the block
	       size.  The  default write size for the backup com-
mand writing to
	       tape devices is 51200 (100 * 512) for  backups  by
name. The
	       write  size must be an even multiple of the tape's
physical
	       block size.
	       Excludes files listed in  the  /etc/exclude.rootvg
file from
	       being  backed  up.  The rules for exclusion follow
the pattern
	       matching rules of the grep command.

	       If you want to  exclude	certain  files	from  the
backup, create
	       the  /etc/exclude.rootvg  file, with an ASCII edi-
tor, and enter
	       the patterns of file names that you  do	not  want
included in
	       your  system  backup  image.  The patterns in this
file are input
	       to the pattern matching conventions  of	the  grep
command to
	       determine  which  files	will be excluded from the
backup. If you
	       want to	exclude  files	listed	in  the  /etc/ex-
clude.rootvg file,
	       select  the  Exclude Files field and press the Tab
key once to
	       change the default value to yes.

	       For example, to exclude all the	contents  of  the
directory
	       called  scratch,  edit the exclude file to read as
follows:

		    /scratch/
   -e
	       For example, to exclude the contents of the direc-
tory called
	       /tmp,  and  avoid  excluding any other directories
that have /tmp
	       in the pathname, edit the exclude file to read  as
follows:

		    ^./tmp/

	       All  files  are	backed	up relative to . (current
working
	       directory). To exclude any file or  directory  for
which it is
	       important  to  have the search match the string at
the beginning
	       of the line, use ^ (caret character) as the  first
character in
	       the  search string, followed by . (dot character),
followed by
	       the filename or directory to be excluded.

	       If the filename or directory being excluded  is	a
substring of
	       another filename or directory, use ^. (caret char-
acter
	       followed by dot character) to  indicate	that  the
search should
	       begin  at  the  beginning of the line and/or use $
(dollar sign
	       character) to indicate that the search should  end
at the end
	       of the line.
	       Specifies  a  previously created mksysb image from
which a
   -F filename backup tape will be created. An	attempt  will  be
made to make
	       the  backup tape bootable. Additionally, this flag
must be used
	       in conjunction with a tape device.
	       Calls the mkszfile command,  which  generates  the
/image.data
	       file. The /image.data file contains information on
volume
	       groups,	logical  volumes,  file  systems,  paging
space, and
	       physical  volumes. This information is included in
the backup
	       for future use by the installation process.
	       Note:
	       Before running the mkszfile command,  ensure  that
enough space
	       is  available in the /tmp file to store a boot im-
age. This
   -i	       space is needed during both backup  and	installa-
tion. To
	       determine  the  amount of space needed in the /tmp
file, issue
	       the following command:

	       bosboot -q -a -d device

	       If you use the -X flag with  the  mksysb  command,
you do not
	       need  to  run the bosboot command to determine the
amount of
	       space needed in the /tmp file.
	       Calls the mkszfile command, with the  -m  flag  to
generate map
	       files.
   -m	       Note:
	       The use of the -m flag causes the functions of the
-i flag to
	       be executed also.
	       Disables software packing of the files as they are
backed up.
   -p	       Some tape drives use their own packing or compres-
sion
	       algorithms.
	       Specifies the path to the directory or file system
used to
	       create a boot image from the mksysb file specified
by the -F
   -t argument flag. If the -t flag is not used with the -F flag,
the boot
	       image  is created in the /tmp file by default. Ap-
proximately
	       100 MB of free space is required. After	the  boot
image is
	       created, this space is freed.
   -v	       Verbose mode. Lists files as they are backed up.
	       Verifies a tape backup. This flag causes mksysb to
verify the
   -V	       file header of each file on the	backup	tape  and
report any
	       read errors as they occur.
	       Specifies  to  automatically  expand the /tmp file
system if
   -X	       necessary. The /tmp file system may need to be ex-
tended to
	       make  room  for	the  boot  image  when creating a
bootable backup
	       to tape.

  Parameters

   Device | File	   Specifies the name of  the  device  or
file.

  Examples

    1. To generate a system backup and create an /image.data file
(generated
       by the mkszfile command) to a tape device named /dev/rmt0,
type:

	 mksysb -i /dev/rmt0

    2. To generate a system backup and create an /image.data file
with map
       files (generated by the mkszfile command) to a tape device
named
       /dev/rmt1, type:

	 mksysb -m /dev/rmt1

    3.	To  generate a system backup with a new /image.data file,
but exclude
       the files in directory /home/user1/tmp, create the file
       /etc/exclude.rootvg containing the line	/home/user1/tmp/,
and type:

	 mksysb -i -e /dev/rmt1

       This command will backup the /home/user1/tmp directory but
not the
       files it contains.

    4.	To  generate  a  system  backup  file  named  /mksysb_im-
ages/node1 and a new
       /image.data file for that image, type:

	 mksysb -i /mksysb_images/node1"

       Note:
       This  file  will not be bootable and can only be installed
using Network
       Installation Management (NIM).
    5. To generate a system backup on the tape in /dev/rmt0,  and
then verify
       the readability of file headers, enter:

	 mksysb  /dev/rmt0 -V

  Files

   /usr/bin/mksysb		  Contains the mksysb command.

  Related Information

   The backup command, bosboot command, mkcd command,
   mkszfile command.

   The /image.data file.

   A  procedure  to  verify the mksysb backup can be found in the
article
   Creating system backups in the Installation and migration.

________________________________________________________________________________

		      Commands Reference, Volume 3, i - m

mksysb_Command

  Purpose

   Creates  an	installable image of the root volume group either
in a file or
   onto a bootable tape.

  Syntax

   mksysb [ -a ] [ -A ] [ -b Number ] [ -e ] [ -F filename ] [
   -i ] [ -m ] [ -p ] [ -t argument ] [ -v ] [ -V ] [
   -X ] Device | File

  Description

   Attention: Running the mkszfile or mksysb  commands	with  the
LC_All
   environment	variable  set  (especially  to a non-C value) can
cause
   unexpected system bahavior such as a mixture of character sets
in outputs.
   To  resolve the problem, unset the LC_ALL variable and restart
the program.

   The mksysb command creates a backup of  the	operating  system
(that is, the
   root  volume  group).  You  can use this backup to reinstall a
system to its
   original state after it has been corrupted. If you create  the
backup on
   tape,  the tape is bootable and includes the installation pro-
grams needed
   to install from the backup.

   The file-system image is in backup-file format. The tape  for-
mat includes a
   boot image, a bosinstall image, and an empty table of contents
followed by
   the system backup (root volume group) image. The  root  volume
group image
   is  in  backup-file	format,  starting with the data files and
then any
   optional map files.

   When a bootable backup of a root volume group is created,  the
boot image
   reflects  the  currently running kernel. If the current kernel
is the 64-bit
   kernel, the backup's boot image is also 64-bit,  and  it  only
boots 64-bit
   systems.  If  the current kernel is a 32-bit kernel, the back-
up's boot image
   is 32-bit, and it can boot both 32-bit and 64-bit systems.

   One of the data files mksysb uses is the  /bosinst.data  file.
If a
   /bosinst.data file doesn't exist, /var/adm/ras/bosinst.data is
copied to /
   (root). In AIX 4.3.3 and later versions, mksysb always updates
the
   target_disk_data  stanzas  in  bosinst.data to match the disks
currently in
   the root volume group of the system where the  mksysb  command
is running.

   If  you  are  using a customized /bosinst.data file and do not
want the
   target_disk_data stanzas updated, you must create the file
   /save_bosinst.data_file. The mksysb command	does  not  update
/bosinst.data
   if the /save_bosinst.data_file exists.

   Notes:

    1. The image the mksysb command creates does not include data
on raw
       devices or in user-defined paging spaces.
    2. If you are using a system with a remote-mounted /usr  file
system, you
       cannot reinstall your system from a backup image.
    3.	The  mksysb command may not restore all device configura-
tions for
       special features, such as  /dev/netbios	and  some  device
drivers not
       shipped with the product.
    4.	Some rspc systems for AIX^(R) 5.1 and earlier do not sup-
port booting
       from tape. When you make a bootable  mksysb  image  on  an
rspc system for
       AIX  5.1  and  earlier  that does not support booting from
tape, the
       mksysb command issues a warning indicating that	the  tape
will not be
       bootable.  You  can  install  a mksysb image from a system
that does not
       support booting from tape by booting from a CD and  enter-
ing
       maintenance  mode. In maintenance mode you will be able to
install the
       system backup from tape.
    5. The mksysb command uses the backup command to  create  its
archive
       image. The mksysb command will also save the EA format for
any JFS2
       filesystems being backed up. It uses the /usr/bin/mkvgdata
shell
       script to save this information.

   To create a backup of the operating system to CD, please refer
to the mkcd
   command.

  Flags

   -a	       Does not backup extended attributes or NFS4 ACLs.
   -A	       Backs up DMAPI file system files.
	       Specifies the number of 512-byte blocks	to  write
in a single
	       output  operation.  When the backup command writes
to tape
	       devices, the default is 100 for backups by name.

   -b Number   The write size is the number of blocks  multiplied
by the block
	       size.  The  default write size for the backup com-
mand writing to
	       tape devices is 51200 (100 * 512) for  backups  by
name. The
	       write  size must be an even multiple of the tape's
physical
	       block size.
	       Excludes files listed in  the  /etc/exclude.rootvg
file from
	       being  backed  up.  The rules for exclusion follow
the pattern
	       matching rules of the grep command.

	       If you want to  exclude	certain  files	from  the
backup, create
	       the  /etc/exclude.rootvg  file, with an ASCII edi-
tor, and enter
	       the patterns of file names that you  do	not  want
included in
	       your  system  backup  image.  The patterns in this
file are input
	       to the pattern matching conventions  of	the  grep
command to
	       determine  which  files	will be excluded from the
backup. If you
	       want to	exclude  files	listed	in  the  /etc/ex-
clude.rootvg file,
	       select  the  Exclude Files field and press the Tab
key once to
	       change the default value to yes.

	       For example, to exclude all the	contents  of  the
directory
	       called  scratch,  edit the exclude file to read as
follows:

		    /scratch/
   -e
	       For example, to exclude the contents of the direc-
tory called
	       /tmp,  and  avoid  excluding any other directories
that have /tmp
	       in the pathname, edit the exclude file to read  as
follows:

		    ^./tmp/

	       All  files  are	backed	up relative to . (current
working
	       directory). To exclude any file or  directory  for
which it is
	       important  to  have the search match the string at
the beginning
	       of the line, use ^ (caret character) as the  first
character in
	       the  search string, followed by . (dot character),
followed by
	       the filename or directory to be excluded.

	       If the filename or directory being excluded  is	a
substring of
	       another filename or directory, use ^. (caret char-
acter
	       followed by dot character) to  indicate	that  the
search should
	       begin  at  the  beginning of the line and/or use $
(dollar sign
	       character) to indicate that the search should  end
at the end
	       of the line.
	       Specifies  a  previously created mksysb image from
which a
   -F filename backup tape will be created. An	attempt  will  be
made to make
	       the  backup tape bootable. Additionally, this flag
must be used
	       in conjunction with a tape device.
	       Calls the mkszfile command,  which  generates  the
/image.data
	       file. The /image.data file contains information on
volume
	       groups,	logical  volumes,  file  systems,  paging
space, and
	       physical  volumes. This information is included in
the backup
	       for future use by the installation process.
	       Note:
	       Before running the mkszfile command,  ensure  that
enough space
	       is  available in the /tmp file to store a boot im-
age. This
   -i	       space is needed during both backup  and	installa-
tion. To
	       determine  the  amount of space needed in the /tmp
file, issue
	       the following command:

	       bosboot -q -a -d device

	       If you use the -X flag with  the  mksysb  command,
you do not
	       need  to  run the bosboot command to determine the
amount of
	       space needed in the /tmp file.
	       Calls the mkszfile command, with the  -m  flag  to
generate map
	       files.
   -m	       Note:
	       The use of the -m flag causes the functions of the
-i flag to
	       be executed also.
	       Disables software packing of the files as they are
backed up.
   -p	       Some tape drives use their own packing or compres-
sion
	       algorithms.
	       Specifies the path to the directory or file system
used to
	       create a boot image from the mksysb file specified
by the -F
   -t argument flag. If the -t flag is not used with the -F flag,
the boot
	       image  is created in the /tmp file by default. Ap-
proximately
	       100 MB of free space is required. After	the  boot
image is
	       created, this space is freed.
   -v	       Verbose mode. Lists files as they are backed up.
	       Verifies a tape backup. This flag causes mksysb to
verify the
   -V	       file header of each file on the	backup	tape  and
report any
	       read errors as they occur.
	       Specifies  to  automatically  expand the /tmp file
system if
   -X	       necessary. The /tmp file system may need to be ex-
tended to
	       make  room  for	the  boot  image  when creating a
bootable backup
	       to tape.

  Parameters

   Device | File	   Specifies the name of  the  device  or
file.

  Examples

    1. To generate a system backup and create an /image.data file
(generated
       by the mkszfile command) to a tape device named /dev/rmt0,
type:

	 mksysb -i /dev/rmt0

    2. To generate a system backup and create an /image.data file
with map
       files (generated by the mkszfile command) to a tape device
named
       /dev/rmt1, type:

	 mksysb -m /dev/rmt1

    3.	To  generate a system backup with a new /image.data file,
but exclude
       the files in directory /home/user1/tmp, create the file
       /etc/exclude.rootvg containing the line	/home/user1/tmp/,
and type:

	 mksysb -i -e /dev/rmt1

       This command will backup the /home/user1/tmp directory but
not the
       files it contains.

    4.	To  generate  a  system  backup  file  named  /mksysb_im-
ages/node1 and a new
       /image.data file for that image, type:

	 mksysb -i /mksysb_images/node1"

       Note:
       This  file  will not be bootable and can only be installed
using Network
       Installation Management (NIM).
    5. To generate a system backup on the tape in /dev/rmt0,  and
then verify
       the readability of file headers, enter:

	 mksysb  /dev/rmt0 -V

  Files

   /usr/bin/mksysb		  Contains the mksysb command.

  Related Information

   The backup command, bosboot command, mkcd command,
   mkszfile command.

   The /image.data file.

   A  procedure  to  verify the mksysb backup can be found in the
article
   Creating system backups in the Installation and migration.
All times are GMT -4. The time now is 05:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy