Using restorevgfiles to restore entire directory from rootvg problems


 
Thread Tools Search this Thread
Operating Systems AIX Using restorevgfiles to restore entire directory from rootvg problems
# 1  
Old 09-23-2011
Using restorevgfiles to restore entire directory from rootvg problems

I am trying to restore a specific directory and all sub-directories therein using a rootvg tape. I am using the following command to make the backup:

Code:
mksysb -m -i -v /dev/rmt0

However, I am getting the following result:

Code:
tctl status
rmt0 Available 04-08-00-0,0 LVD SCSI 4mm Tape Drive
attribute     value  description                          user_settable

block_size    1024   BLOCK size (0=variable length)       True
compress      yes    Use data COMPRESSION                 True
density_set_1 71     DENSITY setting #1                   True
density_set_2 38     DENSITY setting #2                   True
extfm         yes,no Use EXTENDED file marks              True
mode          yes    Use DEVICE BUFFERS during writes     True
ret           no     RETENSION on tape change or reset    True
ret_error     no     RETURN error on tape change or reset True
size_in_mb    36000  Size in Megabytes                    False
# restorevgfiles -a -D -f /dev/rmt0 /d  -d /home/bds /home/bds
+ debug_switch
+ typeset +f
+ typeset -ft altertape
+ typeset -ft cleanup
+ typeset -ft compare_options
+ typeset -ft create_tmp_dir
+ typeset -ft debug_switch
+ typeset -ft determine_backup_type
+ typeset -ft determine_conflicting_options
+ typeset -ft get_stanza_data
+ typeset -ft get_vgdata
+ typeset -ft getoptions
+ typeset -ft ls_backup_lpp
+ typeset -ft ls_backup_properties
+ typeset -ft relative_to_absolute
+ typeset -ft restore_multivolumeCD
+ [[ no = yes ]]
+ [[ /dev/rmt0 = /dev/*[0-9] ]]
+ + /usr/bin/cut -d . -f1
+ /usr/bin/basename /dev/rmt0
BASE_DEV=rmt0
+ /usr/bin/wc -l
+ /usr/sbin/lsdev -C -c tape -l rmt0 -S available
+ [ 1 -eq 1 ]
+ TAPEBACKUP=yes
+ [[ no = yes ]]
+ [[ no = yes ]]
+ [ rvg = rvg ]
+ tctl -f /dev/rmt0 rewind
+ [[ /dev/rmt0 = /dev/rmt+([0-9]).[1357] ]]
+ DEVICE=/dev/rmt0.1
+ REWIND=1
+ TAPEFILE=-s 4
+ [ yes = yes ]
+ altertape
+ TAPEBLKSZ=tapeblksz
+ TMPDIR=/tmp/_mksysb.46702
+ create_tmp_dir /tmp/_mksysb.46702
+ dirname=/tmp/_mksysb.46702
+ umask 077
+ /usr/bin/mkdir /tmp/_mksysb.46702
+ RC=0
+ [[ 0 -ne 0 ]]
+ return 0
+ + pwd
olddir=/home/bds
+ cd /tmp/_mksysb.46702
+ /usr/bin/dspmsg -s 1 mksysb.cat 38 0512-048 Verifying block size for tape device.\n
0512-048 Verifying block size for tape device.
+ + /usr/bin/grep -v block_size
+ /usr/sbin/lsattr -E -O -a block_size -l rmt0
+ LC_MESSAGES=C
OLDBLOCKSZ=1024
+ [ rvg = rvg ]
+ [ 1024 -ne 512 ]
+ /usr/sbin/chdev -l rmt0 -a block_size=512
+ 1> /dev/null 2>& 1
+ TAPEFILE=-s 2
+ /usr/sbin/restore -s 2 -xqf /dev/rmt0.1 ./tapeblksz
+ 1> /dev/null
+ tctl -f /dev/rmt0.1 rewind
+ cat tapeblksz
+ set -- 1024 NONE
+ TBLOCKSZ=1024
+ [ 1024 -ne 512 ]
+ /usr/sbin/chdev -l rmt0 -a block_size=1024
+ 1> /dev/null 2>& 1
+ cd /home/bds
+ /bin/rm -rf /tmp/_mksysb.46702
+ 2> /dev/null
+ TMPDIR=
+ TAPEFILE=-s 4
+ cd /home/bds
+ olddir=
+ [[ no = yes ]]
+ [[ no = yes ]]
+ [[ yes = no ]]
+ TXFLAG=-xvdq
+ + pwd
olddir=/home/bds
+ [[ -n /home/bds ]]
+ cd /home/bds
+ [[ no = yes ]]
+ [[ yes = yes ]]
+ [[ no = no ]]
+ restore -xvdq -f /dev/rmt0.1 -s 4 /home/bds
New volume on /dev/rmt0.1:
Cluster size is 51200 bytes (100 blocks).
The volume number is 1.
The backup date is: Mon Aug  1 03:12:36 EDT 2011
Files are backed up by name.
The user is root.
The total size is 0 bytes.
The number of restored files is 0.
+ RC=0
+ [ 0 -ne 0 ]
+ cleanup 0
+ ec=0
+ error=
+ [ 0 -eq 1 ]
+ [ no = yes ]
+ [ 1 -eq 1 ]
+ /usr/bin/tctl -f /dev/rmt0.1 rewind
+ [[ yes = yes ]]
+ [ 1024 -ne 1024 ]
+ [ -d  ]
+ [ -d  ]
+ [ -n  ]
+ trap  1 2 15
+ exit 0
#

# 2  
Old 09-23-2011
A mksysb is not a normal savevg, but also a boot block and some other information. Since you use mksysbs to boot a machine and restore it there need to be more than just a file backup (which a savevg does, even if in an elaborated way).

The savevg part of a mksysb image is the fourth file on the tape, therefore to restore only some files from a mksysb tape use:

Code:
# (tctl fsf3 ; tar -xvf /dev/rmt0)

This will extract the savevg image which can be restored using restvg. In fact this is simply backup format.

I hope this helps.

bakunin
# 3  
Old 09-24-2011
That didn't work. I got the output:

Code:
# tctl fsf 3 ; tar -xvf /dev/rmt0 /home/bds                  
tar: 0511-193 An error occurred while reading from the media.
There is an input or output error.                           
#

FYI the write protect tab is set on the tape. It was only the tar that didn't work. Are you sure that will be a tar readable file? I also tried:

Code:
# tctl fsf 4

before doing the tar but that didn't work either. I read that the actual files are in the 4rth image on the tape?

Last edited by herot; 09-24-2011 at 12:44 AM..
# 4  
Old 10-03-2011
Any other suggestions on how to do this?
# 5  
Old 10-04-2011
Quote:
Originally Posted by herot
That didn't work. I got the output:

Code:
# tctl fsf 3 ; tar -xvf /dev/rmt0 /home/bds                  
tar: 0511-193 An error occurred while reading from the media.
There is an input or output error.                           
#

FYI the write protect tab is set on the tape. It was only the tar that didn't work. Are you sure that will be a tar readable file? I also tried:

Code:
# tctl fsf 4

before doing the tar but that didn't work either. I read that the actual files are in the 4rth image on the tape?
The problem is that the default tape device (rmt0) automatically rewinds on close so the basic tctl command does not work. Instead use the following:

Code:
tctl -f /dev/rmt0.1 fsf 3; tar -xvf /dev/rmt0 /home/bds

That should do it.
# 6  
Old 10-05-2011
Quote:
Originally Posted by johnf
The problem is that the default tape device (rmt0) automatically rewinds on close so the basic tctl command does not work. Instead use the following:

Code:
tctl -f /dev/rmt0.1 fsf 3; tar -xvf /dev/rmt0 /home/bds

That should do it.
I got this:

Code:
# tctl -f /dev/rmt0.1 fsf 3; tar -xvf /dev/rmt0 /home/bds               
tar: 0511-169 A directory checksum error on media; 0 not equal to 30782.


Last edited by herot; 10-07-2011 at 10:06 AM..
# 7  
Old 04-02-2012
I have tried the information on this page to try and accomplish this task:

Restoring A Single File From mksysb

Specifically the article talks about restoring just 1 file. I want to restore an entire directory.

I tried this

Code:
restore -xqd -s4 -f /dev/rmt0.1 ./home/herot

It seemed to work (after a looooong time) but the files aren't there... any ideas?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to find and get a file in an entire directory with an excluded directory specified?

How to get a file 'zlib.h' in an entire directory with an excluded directory specified lives under that starting directory by using find command, as it failed on: $ find . -name 'zlib.h' -a -ipath 'CHROME.TMP' -prune -o -print it'll just list entirely up (2 Replies)
Discussion started by: abdulbadii
2 Replies

2. AIX

AIX's restorevgfiles

Seek help from all experts, I understand that if I perform a savevg on a VG, and later perform a restvg to another hdisk, I will get back a exact same VG that I perform savevg earlier. It will be identical even on permission bit, owner and group. However, if I perform a restorevgfiles for a... (3 Replies)
Discussion started by: kwliew999
3 Replies

3. UNIX for Dummies Questions & Answers

Append two lines of text to php.ini in the entire directory tree.e

I am looking to write a script that will read the php.ini files on my web host. If the two lines do exist do nothing. If not append two lines to the end of it then move on to the next directory and open the next php.ini file. I have the beginning of one that was given to me on another web site but... (6 Replies)
Discussion started by: Larrykh465
6 Replies

4. Shell Programming and Scripting

Looping through entire directory and count unique values

Hello, I`m a complete newbie to coding, please help with this problem. I have multiple files in a directory, I have to loop through the contents of each file and extract number of unique isoforms in that file. Each file is tab delimited and only the line with the first parent (column 3)... (1 Reply)
Discussion started by: ritakadm
1 Replies

5. AIX

How to restore rootvg archive after AIX 6.1 crash

Hello, Few days ago I created both mksysb and savevg archives of rootvg. How can I restore this rootvg now because the AIX crashed during some software tests. There is no way to start from hdisk0 because most of the system files are deleted (this includes libc.a). I tough it will be trivial... (6 Replies)
Discussion started by: +Yan
6 Replies

6. AIX

Restore a directory from backup

Dear All: we are using backup command on AIX to take backup as below in this command we also add compress command ulimit unlimited cd /apps/oracle find orcldb orcldata arch |tee /apps/orabkp/ofgl.faysalbank.com-17Jun10Thu-ORCL-DB.bkp.gz.log | backup -ivqf - |gzip -c >... (0 Replies)
Discussion started by: lodhi1978
0 Replies

7. Shell Programming and Scripting

tar the entire directory except one directory

Hi All, I need to tar the entire directory except one directory inside that. I have used the below command tar -cvfX test.tar bin/perl bin/ I need to tar all the directories inside the bindirectory except the perl directory Please help me in solving this :b: Regards, Kalai (4 Replies)
Discussion started by: kalpeer
4 Replies

8. UNIX for Dummies Questions & Answers

how to zip the entire directory

my first question is how to zip the entire directory contents. second question is can we unzip the same file through windows environment. please help i need to complete it by EOD (3 Replies)
Discussion started by: bbc17484
3 Replies

9. Solaris

how to restore an entire system from a tar file?

Hi folks, I have an image backup of an entire file system (Solaris 9 on N240) on a tar file. How can I use this tar file to retore my system? Thanks, omd (1 Reply)
Discussion started by: omd
1 Replies

10. UNIX for Dummies Questions & Answers

Tape Restore Problems!!!

Hi. I have been having problems with restoring from a tape backup. I use the following cpio command: find / -print | cpio -ouvB > /dev/rStp0 After running this cpio command, the screen will display all files, but when I try to read or restore the tape I get the following error: Tape input... (1 Reply)
Discussion started by: cstovall
1 Replies
Login or Register to Ask a Question