I reported this bug upstream and somebody even provided a patch: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63245
-- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to coreutils in Ubuntu. https://bugs.launchpad.net/bugs/2017414 Title: cp --preserve=all or --preserve=mode fails without reason Status in coreutils package in Ubuntu: New Bug description: The following example of a copy command fails without reason: # rm -Rf /tmp/f && mkdir /tmp/f && cp --verbose -t /tmp/f -L --preserve=all --parents /etc/apt/sources.list && echo yes ; ls -lR /tmp/f/etc/apt/sources.list /etc/apt/sources.list /etc -> /tmp/f/etc /etc/apt -> /tmp/f/etc/apt '/etc/apt/sources.list' -> '/tmp/f/etc/apt/sources.list' cp: ‘etc/apt’: No such file or directory -rw-r--r-- 1 root root 2437 Apr 23 09:53 /etc/apt/sources.list -rw-r--r-- 1 root root 2437 Apr 23 09:53 /tmp/f/etc/apt/sources.list # /tmp is on the same filesystem as /. The same on Ubuntu 22.04 works without a problem: # rm -Rf /tmp/f && mkdir /tmp/f && cp --verbose -t /tmp/f -L --preserve=all --parents /etc/apt/sources.list && echo yes ; ls -lR /tmp/f/etc/apt/sources.list /etc/apt/sources.list /etc -> /tmp/f/etc /etc/apt -> /tmp/f/etc/apt '/etc/apt/sources.list' -> '/tmp/f/etc/apt/sources.list' yes -rw-r--r-- 1 root root 263 Mär 26 15:20 /etc/apt/sources.list -rw-r--r-- 1 root root 263 Mär 26 15:20 /tmp/f/etc/apt/sources.list # Why I omit the --preservce=all then it works without a problem: # rm -Rf /tmp/f && mkdir /tmp/f && cp --verbose -t /tmp/f -L --parents /etc/apt/sources.list && echo yes ; ls -lR /tmp/f/etc/apt/sources.list /etc/apt/sources.list /etc -> /tmp/f/etc /etc/apt -> /tmp/f/etc/apt '/etc/apt/sources.list' -> '/tmp/f/etc/apt/sources.list' yes -rw-r--r-- 2 root root 2437 Apr 23 09:53 /etc/apt/sources.list -rw-r--r-- 1 root root 2437 Apr 23 11:02 /tmp/f/etc/apt/sources.list # Also, when I only use --preserve=mode, then it again fails: # rm -Rf /tmp/f && mkdir /tmp/f && cp --verbose -t /tmp/f -L --preserve=mode --parents /etc/apt/sources.list && echo yes ; ls -lR /tmp/f/etc/apt/sources.list /etc/apt/sources.list /etc -> /tmp/f/etc /etc/apt -> /tmp/f/etc/apt '/etc/apt/sources.list' -> '/tmp/f/etc/apt/sources.list' cp: ‘etc/apt’: No such file or directory -rw-r--r-- 2 root root 2437 Apr 23 09:53 /etc/apt/sources.list -rw-r--r-- 1 root root 2437 Apr 23 11:02 /tmp/f/etc/apt/sources.list # Is this a bug in cp or something else? I'm one of the maintainers of Relax-and-Recover (rear) and noticed this in https://github.com/rear/rear/issues/2972 OS Release Info: PRETTY_NAME="Ubuntu 23.04" NAME="Ubuntu" VERSION_ID="23.04" VERSION="23.04 (Lunar Lobster)" VERSION_CODENAME=lunar ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=lunar LOGO=ubuntu-logo Coreutils version: # cp --version cp (GNU coreutils) 9.1 # dpkg-query -l coreutils Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============-============-============-================================= ii coreutils 9.1-1ubuntu2 amd64 GNU core utilities ProblemType: Bug DistroRelease: Ubuntu 23.04 Package: coreutils 9.1-1ubuntu2 ProcVersionSignature: Ubuntu 6.2.0-20.20-generic 6.2.6 Uname: Linux 6.2.0-20-generic x86_64 ApportVersion: 2.26.1-0ubuntu2 Architecture: amd64 CasperMD5CheckResult: pass Date: Sun Apr 23 10:48:56 2023 InstallationDate: Installed on 2023-04-23 (0 days ago) InstallationMedia: Ubuntu-Server 23.04 "Lunar Lobster" - Release amd64 (20230415) SourcePackage: coreutils UpgradeStatus: No upgrade log present (probably fresh install) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/2017414/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp