Confusing Cpio Problem Copying Filesystems

For decades, on many Unix variant, I used the following to backup.

find /source/directory | cpio -dumpv /destination/directory

Lately on Ubuntu, this fails in a strange way: Instead of creating the destination directory, it creates some strange data file. In addition, it outputs (for every file in the input list)"Cannot Create destination/directory: file exists. If I am not mistaken, the destination file is the last one copied over. Summary: Very recently cpio(1) pass through fails to create directories.

Additional Data:

CPIO(1) version: cpio (GNU cpio) 2.13
Ubuntu  Version: Started as 20.4 and kept up with automatic upgrade.

(How do you obtain Ubuntu version?)

If I use long form (getopts) it seems to work:

cat /tmp/list | cpio --pass-through --make-directories --preserve-modification-time --unconditional /bu/Nightly/20220618 

BUT it still does not create directories. It appears there was a change made in the last week or so.

#file /usr/bin/cpio
/usr/bin/cpio: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=419bee4eb6cf7238d4e5ee8cda5657310719b634, for GNU/Linux 3.2.0, stripped

File Systems: ZFS everywhere {zpool,zfs} version:

#zfs version
zfs-2.0.6-1ubuntu2.1
zfs-kmod-2.0.6-1ubuntu2.1

I know there are other methods of accomplishing the same, but my eyesight is very poor and I really do not want to dig into shell scripts that are decades old. I know this method worked in the past (two weeks ago), with Ubuntu. I have terabytes of archives I cannot update anymore.

The problem is clearly in cpio(1). The find(1) piping into it can be replaced with a file listing the content, or even typing the filenames directly.

6
Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article