Operating System - HP-UX
1833788 Members
2800 Online
110063 Solutions
New Discussion

Extracting/replacing files from a compressed Ignite image

 
SOLVED
Go to solution
Mark DeBoer
Occasional Contributor

Extracting/replacing files from a compressed Ignite image

Ignite uses pax to create a compressed archive(i.e. system.gz or system.Z) file. How do you extract or replace a file/directory within that image.

1. How would I extract the /tmp directory from system.gz or system.Z and restore it to the current working directory using pax?

2. How would I replace the /etc/passwd file in the image with a current /etc/passwd file?
1 REPLY 1
Michael Roberts_3
Honored Contributor
Solution

Re: Extracting/replacing files from a compressed Ignite image

1) To extract /tmp from system.gz overwriting the current /tmp:

cd /tmp
/usr/contrib/bin/gzcat system.gz | pax -rvf - tmp

(BTW gzcat will handle .Z files too)

2) You can append to the archive so that the new version of a file overwrites the older one in the same archive, but that I know of you can't easily "delete" a file from the archive without extracting the entire archive, removing the file/dir and re-archiving.
To append to system.gz:

cd /bigdir #3x the size of compressed file

cp system.gz /bigdir
/usr/contrib/bin/gunzip system.gz

cp to /bigdir files/dirs to be appended

pax -af system files/dirs
NB. don't put a leading / or ./ on the files/dirs specified on the command line, they should be relative to the directory that you are in.

gzcat -9 system
etouq ot hguone revelc ton m'i