cp --parents fails without reason
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
coreutils (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Upstream bug: https:/
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/
/etc -> /tmp/f/etc
/etc/apt -> /tmp/f/etc/apt
'/etc/apt/
cp: ‘etc/apt’: No such file or directory
-rw-r--r-- 1 root root 2437 Apr 23 09:53 /etc/apt/
-rw-r--r-- 1 root root 2437 Apr 23 09:53 /tmp/f/
#
/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/
/etc -> /tmp/f/etc
/etc/apt -> /tmp/f/etc/apt
'/etc/apt/
yes
-rw-r--r-- 1 root root 263 Mär 26 15:20 /etc/apt/
-rw-r--r-- 1 root root 263 Mär 26 15:20 /tmp/f/
#
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/
/etc -> /tmp/f/etc
/etc/apt -> /tmp/f/etc/apt
'/etc/apt/
yes
-rw-r--r-- 2 root root 2437 Apr 23 09:53 /etc/apt/
-rw-r--r-- 1 root root 2437 Apr 23 11:02 /tmp/f/
#
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/
/etc -> /tmp/f/etc
/etc/apt -> /tmp/f/etc/apt
'/etc/apt/
cp: ‘etc/apt’: No such file or directory
-rw-r--r-- 2 root root 2437 Apr 23 09:53 /etc/apt/
-rw-r--r-- 1 root root 2437 Apr 23 11:02 /tmp/f/
#
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:/
OS Release Info:
PRETTY_NAME="Ubuntu 23.04"
NAME="Ubuntu"
VERSION_ID="23.04"
VERSION="23.04 (Lunar Lobster)"
VERSION_
ID=ubuntu
ID_LIKE=debian
HOME_URL="https:/
SUPPORT_URL="https:/
BUG_REPORT_URL="https:/
PRIVACY_
UBUNTU_
LOGO=ubuntu-logo
Coreutils version:
# cp --version
cp (GNU coreutils) 9.1
# dpkg-query -l coreutils
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
ii coreutils 9.1-1ubuntu2 amd64 GNU core utilities
ProblemType: Bug
DistroRelease: Ubuntu 23.04
Package: coreutils 9.1-1ubuntu2
ProcVersionSign
Uname: Linux 6.2.0-20-generic x86_64
ApportVersion: 2.26.1-0ubuntu2
Architecture: amd64
CasperMD5CheckR
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)
summary: |
- cp --preserve=all or --preserve=mode fails without reason + cp --parents fails without reason |
description: | updated |
I reported this bug upstream and somebody even provided a patch: https:/ /debbugs. gnu.org/ cgi/bugreport. cgi?bug= 63245