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
1 answer
63 views

"initrd.img-5.10.0-18-amd64" exists but is not a a directory. Function "open" failed: is not a directory : trying to overwrite a file inside cpio arch

I would like to overwrite a file that's already located inside a cpio folder with a new file that has the same name. I'm having some troubles by finding the working parameters. I've found this webpage ...
Marietto's user avatar
  • 501
0 votes
1 answer
83 views

The file produced unpacking a kernel file with (gunzip and cpio),overwriting some files and repacking everything,is not bootable

How the title says,I'm trying to unpacking a kernel file (let's say the first one : initrd.img-5.10.0-18-amd64.gz) with gunzip and cpio,overwriting some files and repacking everything. The issue is ...
Marietto's user avatar
  • 501
0 votes
0 answers
179 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 ...
Zur13's user avatar
  • 101
0 votes
1 answer
407 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 ...
Kourosh Taheri-Golvarzi's user avatar
0 votes
1 answer
812 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-...
Ashar's user avatar
  • 481
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 "...
mastupristi's user avatar
3 votes
1 answer
916 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/...
Parsa Mousavi's user avatar
1 vote
2 answers
804 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 ...
davolfman's user avatar
  • 544
0 votes
1 answer
633 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 ...
HobartTas's user avatar
-3 votes
1 answer
2k 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 ...
ValientProcess's user avatar
0 votes
1 answer
2k 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 | ...
pkaramol's user avatar
  • 2,669
0 votes
1 answer
571 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 ...
Hamid's user avatar
  • 113
-1 votes
2 answers
880 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, ...
A. Michael's user avatar
6 votes
2 answers
7k 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 < ...
manifestor's user avatar
  • 2,443
1 vote
1 answer
735 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/**, ...
Steven Dumais's user avatar
0 votes
1 answer
339 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. ...
xcode's user avatar
  • 121
1 vote
1 answer
2k 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
Top Music's user avatar
1 vote
2 answers
3k 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....
Mowzer's user avatar
  • 959
0 votes
1 answer
1k 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 ...
cat's user avatar
  • 3,448
1 vote
2 answers
244 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 ...
Sylvain Leroux's user avatar
-1 votes
1 answer
133 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 '^/...
illiterate's user avatar
4 votes
2 answers
2k 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 '-...
John Gowers's user avatar
4 votes
3 answers
2k 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 ...
Thiner's user avatar
  • 41
6 votes
1 answer
9k 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-...
Christian's user avatar
  • 303
0 votes
1 answer
176 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 ...
inimene's user avatar
  • 109
3 votes
1 answer
989 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 ...
Ben's user avatar
  • 31
5 votes
1 answer
10k 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 ...
dotslash's 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 ...
yael's user avatar
  • 1,521
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 ...
Michael L.'s user avatar
7 votes
4 answers
6k 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 ...
Charles Duffy's user avatar
1 vote
2 answers
554 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 ...
ingli's user avatar
  • 1,725
0 votes
1 answer
36 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 ...
Ravi's user avatar
  • 3,783
11 votes
2 answers
9k 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 ...
Emilio Lazo's user avatar
3 votes
0 answers
54 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?
Nicolas Danelon's user avatar
2 votes
2 answers
683 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 ...
AndyW's user avatar
  • 123
3 votes
3 answers
2k 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 ...
Baard Kopperud's user avatar
2 votes
1 answer
1k 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 ...
Dakkaron's user avatar
  • 2,007
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 ...
Dakkaron's user avatar
  • 2,007
1 vote
1 answer
305 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 ...
Naftuli Kay's user avatar
  • 39.1k
0 votes
3 answers
385 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 ...
maihabunash's user avatar
  • 7,031
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/...
maihabunash's user avatar
  • 7,031
49 votes
6 answers
19k 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 ...
user986730's user avatar
2 votes
1 answer
2k 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
tcsapunaru's user avatar
14 votes
3 answers
5k 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 ...
derobert's user avatar
  • 108k
6 votes
4 answers
13k 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 ...
Dejwi's 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/...
ceremcem's user avatar
  • 2,271
2 votes
1 answer
84 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 ?
user2799508's user avatar
  • 1,682
2 votes
1 answer
1k 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, ...
strugee's user avatar
  • 14.8k
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 ...
user62094's 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 ...
user62094's user avatar