How can I read a cpio archive with absolute pathnames?

itkin at cup.portal.com itkin at cup.portal.com
Tue Mar 22 15:31:33 AEST 1988


>     Customers are always dumping cpio archives to floppy with
>
>	find / -print | cpio ...
>
>and it drives us crazy when we need to restore something and they
>have used full pathnames.  Are there methods short of either the
>interactive rename mechanism or making a silly chroot environment
>for it?  Wouldn't it be really helpful if cpio had an option that
>could edit the start of the path to (say) prepend "." or strip off
>parts?
>-- 
>Steve Friedl, KA8CMY     ARPA/UUNET/CSNet: friedl at vsi.com       *Hi Mom*
>{kentvax, uunet, attmail, {ucbvax, ihnp4, sun}!amdcad!uport}}!vsi!friedl

This is one of those rare uses for the CHROOT command.  The steps are:

	chroot /sparedir cpio...

I'd read the manual very carefully, and try it with something not too
destructive.  Once done, the files will have been retrieved RELATIVE TO
/sparedir AS THOUGH IT WERE THE ROOT.  You can then move them or whatever
you want to do with them.



More information about the Comp.unix.questions mailing list