A cpio archive consists of one or more concatenated member files. Each member file contains a header optionally followed by file contents as indicated in the header. The end of the archive is indicated by another header describing an (empty) file named TRAILER.
A cpio archive stores each entry as a fixed-size header followed by a variable-length filename and variable-length data. Unlike tar, cpio does only minimal padding of the header or file data. There are a variety of cpio formats, which differ primarily in how they store the initial header: some store the values as octal or hexadecimal numbers in ASCII, others as binary values of varying byte order and length.
This format used 32-bit binary values for file size and mtime, and 16-bit binary values for the other fields.
This format stores the header contents as octal values in ASCII. It is standard, portable, and immune from byte- order confusion. File sizes and mtime are limited to 33 bits (8GB file size), other fields are limited to 18 bits.
The SVR4 format uses eight-digit hexadecimal values for all header fields. This limits file size to 4GB, and also limits the mtime and other fields to 32 bits. The SVR4 format can optionally include a CRC of the file contents.
Cpio first appeared in PWB/UNIX 1.0, which was released within AT&T in 1977. PWB/UNIX 1.0 formed the basis of System III Unix, released outside of AT&T in 1981. This makes cpio older than tar, although cpio was not included in Version 7 AT&T Unix. As a result, the tar command became much better known in universities and research groups that used Version 7. The combination of the find and cpio utilities provided very precise control over file selection. Unfortunately, the format has many limitations that make it unsuitable for widespread use. Only the POSIX format permits files over 4GB, and its 18-bit limit for most other fields makes it unsuitable for modern systems. In addition, cpio formats only store numeric UID/GID values (not usernames and group names), which can make it very difficult to correctly transfer archives across systems with dissimilar user numbering.
Create/Extract Cpio archive on Windows
WinTar introduction: http://www.miscosoftware.com/WinTar/wintar.htm
Download WinTar from http://www.miscosoftware.com/WinTar/store/WinTar.exe
WinTar is a simple and cute 32-bit Windows version tarball archiver - a powerful tool which allows you to create, manage and extract most popular Unix/Linux tarball and windows format archive files.
WinTar can create and read several different archive formats, including most popular tar variants, several cpio formats, and both BSD and GNU ar variants. It can also write shar archives and read ISO9660 CDROM images, Windows CAB and ZIP archives.
When WinTar is running, it displays a list of files and folders in the current folder. Navigate to the folder that you want to add files and folders to the archive. After you select the files and folders and then do the following:
- » Select menu File New archive and then select the archive file format from the popup menu, e.g. CPIO file. or
- » Click the main toolbar button New popup tag. When the popup menu displayed, select the CPIO archive file format.
These two methods will display the New Achive dialog. Navigate the folder you want to save the archive file, enter the archive file name in the File Name text box. At this point, you also have a chance to select the target archive format at the next Save File Type and Archive Format combo boxes. You may select the compression method from the Compression combo Box, e.g. gzip,bzip2 or leave it as Using global options. Select None method, the archive will perform but do not apply compression, including Zip and CAB archive.
After click the OK button at the New Archive dialog, If you have selected files and/or folders on the first step, the Archive File Option dialog will display (the Globle Options controls this behavior). After select some archive options and click OK button, the archive process starts.
Extract Cpion archive file
In order to extract files using WinTar you must first open the required archive or select the archive file in File List pane window. This may be achieved in one of several ways:
- » Target the archive file in the file list pane and select the archive file.
- » Double-click or press Enter on the archive name in Windows shell (Explorer or Desktop). If WinTar was associated with archives, an archive will be opened in WinTar. You may associate WinTar with archives after installation using File Association dialog;
- » Double-click or press Enter on the archive name in WinTar window;
- » Run WinTar from the command line with a single parameter - the archive name. If an archive is opened in WinTar, its contents are displayed.
Select files and folders, which should be extracted. You may do this using Shift + arrow keys or Shift + left mouse button as in Windows Explorer and other Windows programs. Having selected one or more files, select File Extract Archive menu or click Extract button at the main toolbar, or press Alt+E , enter the destination folder in the dialog box and click on OK. This dialog box also offers a few advanced options for archive extraction.
During the extraction process, a window will be displayed showing operation statistics. If you wish to break the extraction process, click on the Cancel button in the command window.
Extracting files from ISO image file