Questions tagged [cpio]

A tool for creating and extracting archives as well as passing files to another directory tree.

Filter by
Sorted by
Tagged with
0 votes
0 answers
60 views

cpio archive with folder named . (only a single dot character)

I'm trying to make an install package for Mac OS from my Linux PC. For this purpose I need to pack my folders with data inside the (POSIX.1) portable format archive. This archive should have the ...
user avatar
  • 101
0 votes
1 answer
125 views

What are the advantages of cpio over tar, zip, etc? [closed]

With cpio, you need to direct a list of files into cpio's standard input, whereas with tools such as tar, zip, etc, it's possible to recursively archive a directory (or multiple directories). I ...
user avatar
0 votes
1 answer
399 views

How to extract a compressed tar using cpio to a particular directory location

I created the compressed tar file using the below command. find /app/jboss -not -name "*.err" -not -name "*.log" | cpio -o | gzip >/app/patchbkp/test/REDHAT_jboss-eap-7.2_18-Aug-...
user avatar
  • 307
1 vote
0 answers
18 views

creating a cpio archive ingnoring modification time of files [duplicate]

how can I create a cpio archive by ignoring the modification times of the files (or imposing them at a known value)? The context is as follows: in the build process of an embedded project some "...
user avatar
1 vote
1 answer
529 views

Problem extracting the "initrd" archive in kernel 5.4

I can see my initrd is occupied almost 90 MB of disk but after extracting it via cpio , it contains only a 30 KB microcode : $ cpio -it < initrd.img-5.4.0-18-generic . kernel kernel/x86 kernel/...
user avatar
2 votes
2 answers
473 views

Is there a practical way to make binary-reproducible CPIO (initramfs) archives?

I would like my initramfs to have the same hash no matter when or where I build it if the contents of the files are the same (and are owned by root and have same permissions). I don't see any options ...
user avatar
  • 383
0 votes
1 answer
451 views

Is there a backup utility to backup to LTO tape that's not TAR, PAX, or CPIO?

I'm using Solaris 11.3 and wish to occasionally backup a bunch of large VM's and disk images directly to a used LTO6 tape drive bought off Ebay but even though Solaris TAR has the "E" flag to allow ...
user avatar
-3 votes
1 answer
813 views

Extracting all cpio files in a directory

I'm using ssh to connect to a server which has a directory full of cpio files. I need to extract all the files in the directory, so I tried to write in the terminal: cpio -ivd But when I press enter ...
user avatar
0 votes
1 answer
926 views

cpio fails to extract files

In the following sequence of commands, why does cpio fails to extract the files previously archived? /home/pkara/Desktop/temp $ ls eBooks myfile.tar /home/pkara/Desktop/temp $ find . -depth -print | ...
user avatar
  • 2,225
0 votes
1 answer
428 views

Create absolute path in cpio archive

I build some archive for linux kernel it need an archive file with absolute path. File are under folder /data/ when I pack normally it keeps file path like this bin/ln bin/ls etc the command I used ...
user avatar
  • 113
-1 votes
2 answers
525 views

Archived rootfs: convert tar to cpio for initramfs

I have a Debian rootfs as a tar file. I would like to specify it as the initramfs source in Kconfig (using PetaLinux), but the source must be a cpio archive. How can I convert the .tar to .cpio, ...
user avatar
4 votes
1 answer
4k views

How to extract a single file from a cpio archive?

I have a cpio archive with lots of files and I need to extract only one file, not all. With tar I could just use tar -xf archive.tar path/to/file, but that does not work with cpio: cpio -i < ...
user avatar
  • 2,311
1 vote
1 answer
500 views

How to use 'find' and 'cpio' to exclude parent directories

I want to copy over all html files in a nested directory but I want to prevent the parent folders above it from being generated as well. That is if my source path is /project/ng1/src/templates/**, ...
user avatar
0 votes
1 answer
237 views

How to Copy Millions of Files from Remote Server to Local One [duplicate]

I have this problem, I have an Ubuntu server (SSH enabled on port 4444). Inside this server there's a directory called /folder/a/, this directory literally contains millions of small size text files. ...
user avatar
  • 121
0 votes
1 answer
573 views

Using cpio command to compress directory and move it

I want to make /lib/modules compress copy and move to /opt directory. using cpio I try this cpio /lib/modules > directory.cpio | mv directory.cpio /opt
user avatar
1 vote
2 answers
2k views

How to recursively copy a directory using cpio?

How do I copy recursively a directory within the list at my-files-to-copy.txt? cd my/source/dir cpio --create < my-files-to-copy.txt | (cd my/dest/dir && cpio --extract) my-files-to-copy....
user avatar
  • 859
0 votes
1 answer
794 views

Backing up Linux to a Windows file system for later restoration

I need to backup / copy the files of my Linux installation to an external drive, so that I can restore them onto the new, larger disk. The destination disk for the restoration is twice as large, and ...
user avatar
  • 3,270
1 vote
2 answers
180 views

Is there an archive file format supporting file-level concatenation?

It is a rather theoretical question but is there some (not too obscure) incremental archive format allowing to append to an existing archive using >> or to join several archives using a simple ...
user avatar
-1 votes
1 answer
105 views

How copy files from file-name list and unconditional keep existing file in destination?

How copy files from file-name list and unconditional keep existing file in destination? Note cpio is overwrite older existing files by default: $ dpkg -L libgcc1 libstdc++6 |grep -e '^/lib/' -e '^/...
user avatar
4 votes
2 answers
1k views

Why do we use `find -depth` with `cpio`

From the info cpio page: If you wanted to archive an entire directory tree, the find command can provide the file list to cpio: % find . -print -depth | cpio -ov > tree.cpio The '-...
user avatar
3 votes
3 answers
1k views

Transform tar into cpio without rooting?

I have a tarball containing many files with root:root owner and/or special device inodes. cpio only accepts paths existing in the file system when it is creating a cpio archive. And I don't want to ...
user avatar
  • 31
6 votes
1 answer
8k views

update-initramfs hangs on debian Stretch

using apt-get upgrade on Debian left me with the decision to update to kernel 4.9.0-6 but the installation never finishes. It always stalls at the following stage: Setting up linux-image-4.9.0-6-...
user avatar
  • 303
0 votes
1 answer
110 views

Use a directory from RPM as a parameter for different tool

I have a need to fetch a folder from an RPM package that contains number of .jar files. My idea was that maybe it would be possible to pass it in a stream to java -cp command as classpath for it? The ...
user avatar
  • 109
3 votes
1 answer
798 views

Relocating files while extracting RPM

I'm trying to extract files from relocatable RPMs and am facing the current problem: rpm2cpio my.rpm | cpio -ivd works very well but I get the full path of the files, including the default prefix ...
user avatar
  • 31
5 votes
1 answer
8k views

How to create ASCII cpio archive (SVR4 with no CRC)?

I have a file in /boot/initramfs.gz extract it using tar -xzvf initramfs.gz -C ./ I got a file initramfs. └──╼ $ file initramfs initramfs: ASCII cpio archive (SVR4 with no CRC) It can be open using ...
user avatar
  • 193
1 vote
2 answers
3k views

how to compress a folder without to leave the original folder and without to remove the original folder

under SQL directory we have only the tmp folder (tmp folder usage 59G) is it possible to compress the folder tmp without to leave the original tmp folder ? , so the compression will work on the ...
user avatar
  • 1,483
3 votes
2 answers
2k views

Extract files with cpio where one or more paths may contain spaces

We have a cpio archive that was created by generating a file that contains a list of absolute paths to be included in the archive. (one absolute path per line of a plain text file) The command to ...
user avatar
6 votes
4 answers
5k views

Extracting concatenated cpio archives

initramfs archives on Linux can consist of a series of concatenated, gzipped cpio files. Given such an archive, how can one extract all the embedded archives, as opposed to only the first one? The ...
user avatar
1 vote
2 answers
519 views

How to engage with Fedora 23 error message in dnf install error of dnspython?

I am not sure whether this constitutes a bug - so, I dare to try it here... When attempting to install (with dnf) versions of the package python-dns, I get the following error: unpacking of ...
user avatar
  • 1,435
0 votes
1 answer
33 views

Not able to see the backed up file in the backed up media

I used 2 commands cpio and tar to perform the same operation of backing up data to an external drive which is my 8Gb pen drive (sandisk brand). At the time of executing the commands, it outputs ...
user avatar
  • 3,513
10 votes
1 answer
8k views

Appending files to initramfs image - reliable?

I'm modifying a bunch of initramfs archives from different Linux distros in which normally only one file is being changed. I would like to automate the process without switching to root user to ...
user avatar
3 votes
0 answers
51 views

chroot and hyperos on ArchLinux?

hyperos is a fork of tinycorelinux Can I run hyperos in a chroot? How can I create an ISO image from files on repo? Is this possible? Which steps should I follow?
user avatar
2 votes
2 answers
540 views

Copy file and file structure and merge in new directory

I used the following command line find src -name '*.json' | cpio -pdm lib So it found the json file as in the sceenshot below But then it takes the whole directory structure and places it into the ...
user avatar
  • 123
3 votes
3 answers
1k views

Archiving to remote-machine with tar/cpio and ssh?

I'm renting a couple of VPS with Ubuntu, and I've managed to fill-up one of them. Here I've got several directories with lots of files I'd like to put into an archive. Unfortunately, I don't have ...
user avatar
2 votes
1 answer
886 views

Change CPIO format to newc without extraction

I am trying to create modify an u-boot filesystem image. At first I tried to extract, modify and then pack it again, but that didn't work, because extracting and repacking seems to mess up the ...
user avatar
  • 1,840
3 votes
2 answers
2k views

Create cpio file with different absolute directory

I am trying to modify a file system image packed with cpio. For that reason I first need to extract and later pack the image. As the image contains a whole file system all the files are given in ...
user avatar
  • 1,840
1 vote
1 answer
274 views

Extract tree from cpio archive

I have an RPM contaning files in ./var/lib which I need to extract onto my filesystem on a Debian machine. I'm trying to do this: rpm2cpio myrpm.rpm | cpio -ivd ./var/lib Nothis is extracted. If I ...
user avatar
  • 35.8k
0 votes
3 answers
299 views

what the best approach in order to compress directory with Hundreds of sub directories [closed]

Under /usr/cti/APP_sys, I have hundreds of directories and subdirectories and files, etc. I wonder what the best approach in order to compress the /usr/cti/APP_sys directory (get the best low ...
user avatar
  • 6,623
3 votes
1 answer
4k views

cpio VS tar - what the best archive solution in order to compress hundred of directories to one file

I have hundreds of directories under /var/Recording, and each directory there will have subdirectories, including files, hard links and soft links. I want to compress all directories under /var/...
user avatar
  • 6,623
45 votes
6 answers
17k views

Why is it that my initrd only has one directory, namely, 'kernel'?

I'm using debian live-build to work on a bootable system. By the end of the process i get the typical files used to boot a live system: a squashfs file, some GRUB modules and config files, and an ...
user avatar
2 votes
1 answer
1k views

Need to understand cpio -d and --make-directories

I am studying for the LPIC exam and the command cpio with options -d and --make-directories came up. Would someone be able to provide an example on how these work. cpio -d cpio --make-directories
user avatar
13 votes
3 answers
4k views

How to convince tar (etc.) to archive block device contents?

I have six Linux logical volumes that together back a virtual machine. The VM is currently shutdown, so its easy to take consistent images of them. I'd like to pack all six images together in an ...
user avatar
  • 102k
6 votes
4 answers
12k views

Unpack, modify and pack initrd as a user

I've got a problem with rebuilding the initrd image as a user. Firstly, when I try to "unpack" the original initrd image: cpio -idm < initrd-base cpio: dev/tty8: Cannot mknod: Operation not ...
user avatar
  • 221
4 votes
2 answers
2k views

what are the techniques to extract files safely?

Yesterday I was making some experiments on Slitaz. It uses multiple initrd.img's to store files/changes. I wanted to extract one of its initrd.gz images (which is a cpio archive) to a folder, edit/...
user avatar
  • 1,967
2 votes
1 answer
70 views

What is the meaning of '.' in the cpio file

This is my the content of my rootfs.cpio file: [root@xilinx output]# cpio -idv < rootfs.cpio . init dev dev/console 1149 blocks What is . here ?
user avatar
  • 1,622
2 votes
1 answer
911 views

When I execute a cpio command, it hangs forever

I've been trying to unarchive a cpio archive (in this case, my initial ramdisk). However, when I try to extract the files, cpio hangs forever. It happens if I pass the -V argument to print extra info, ...
user avatar
  • 14.1k
0 votes
2 answers
2k views

Using rsync or cpio to do an incremental backup [duplicate]

I'm trying to do an incremental backup of all files on my NAS box that where modified in the last 24 hours (or so, can be more flexible). I'm using PuTTY to connect through SSH to a ReadyNAS 102 ...
user avatar
1 vote
1 answer
3k views

Is the busybox cpio THAT different from GNU cpio?

I'm trying to do an incremental backup using cpio but it seems that the busybox version doesn't work the same as the normal one? This is what I've got so far: find data/Backup -mtime -2 | cpio -cm ...
user avatar
7 votes
6 answers
3k views

How would you use the cpio command?

While studying for the lpic exam, I've run into the command cpio. The description of cpio states: Cpio was originally designed to store backup file archives on a tape device in a sequential, ...
user avatar
  • 16.5k
1 vote
3 answers
2k views

How to include directory tree for back-up using cpio?

I am backing up files including directories from 1 partition to other using cpio. cpio works perfect for backing but I am unable to backup directory tree. I am in a partition mounted on the directory ...
user avatar
  • 3,513