Debian Bug report logs - #836211
dpkg: Cannot upgrade some packages on overlayfs: Invalid cross-device link

version graph

Package: linux; Maintainer for linux is Debian Kernel Team <[email protected]>;

Affects: dpkg

Reported by: Felipe Sateler <[email protected]>

Date: Wed, 31 Aug 2016 15:18:06 UTC

Severity: normal

Tags: upstream

Found in versions 4.12.6-1, 4.6.4-1

Forwarded to [email protected]

Full log


🔗 View this message in rfc822 format

X-Loop: [email protected]
Subject: Bug#836211: dpkg: Cannot upgrade some packages on overlayfs: Invalid cross-device link
Reply-To: Johannes Schauer <[email protected]>, [email protected]
Resent-From: Johannes Schauer <[email protected]>
Resent-To: [email protected]
Resent-CC: Dpkg Developers <[email protected]>
X-Loop: [email protected]
Resent-Date: Thu, 01 Sep 2016 07:03:02 +0000
Resent-Message-ID: <[email protected]>
Resent-Sender: [email protected]
X-Debian-PR-Message: followup 836211
X-Debian-PR-Package: dpkg
X-Debian-PR-Keywords: 
X-Debian-PR-Source: dpkg
Received: via spool by [email protected] id=B836211.14727131788934
          (code B ref 836211); Thu, 01 Sep 2016 07:03:02 +0000
Received: (at 836211) by bugs.debian.org; 1 Sep 2016 06:59:38 +0000
X-Spam-Checker-Version: SpamAssassin 3.4.0-bugs.debian.org_2005_01_02
	(2014-02-07) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-9.5 required=4.0 tests=BAYES_00,FROMDEVELOPER,
	PGPSIGNATURE,URIBL_CNKR autolearn=ham autolearn_force=no
	version=3.4.0-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 12; hammy, 150; neutral, 111; spammy,
	0. spammytokens: hammytokens:0.000-+--H*c:pgp-sha256,
	0.000-+--H*c:pgp-signature, 0.000-+--H*c:protocol, 0.000-+--H*c:micalg,
	0.000-+--H*c:signed
Received: from fulda116.server4you.de ([62.75.219.19])
	by buxtehude.debian.org with esmtp (Exim 4.84_2)
	(envelope-from <[email protected]>)
	id 1bfLyL-0002Jq-R5
	for [email protected]; Thu, 01 Sep 2016 06:59:38 +0000
Received: from localhost (ip1f10fe5b.dynamic.kabel-deutschland.de [31.16.254.91])
	by mister-muffin.de (Postfix) with ESMTPSA id 08FD48027C;
	Thu,  1 Sep 2016 08:59:34 +0200 (CEST)
Content-Type: multipart/signed; protocol="application/pgp-signature";
 micalg="pgp-sha256"; boundary="===============2030192053491286205=="
MIME-Version: 1.0
Content-Disposition: inline
To: [email protected]
References: <147265657047.31705.7496372748096616425.reportbug@felipepc>
In-reply-to: <147265657047.31705.7496372748096616425.reportbug@felipepc>
Cc: [email protected]
From: Johannes Schauer <[email protected]>
Message-ID: <147271317433.13193.5690193472125748324@localhost>
User-Agent: alot/0.3.6
Date: Thu, 01 Sep 2016 08:59:34 +0200
[Message part 1 (text/plain, inline)]
Hi,

On Wed, 31 Aug 2016 12:16:10 -0300 Felipe Sateler <[email protected]> wrote:
> overlayfs does not support renaming directories when the directories
> live in the lower filesystem:
> 
>  * Directory renames only allowed on "pure upper" (already created on
>  * upper filesystem, never copied up).  Directories which are on lower or
>  * are merged may not be renamed.  For these -EXDEV is returned and
>  * userspace has to deal with it.  This means, when copying up a
>  * directory we can rely on it and ancestors being stable.
> 
> https://github.com/torvalds/linux/blob/v4.8-rc2/fs/overlayfs/copy_up.c#L318-L322
> 
> Unfortunately this means that dpkg fails at least in the case where a
> directory is converted into a file: apt 1.3~rc2 moves
> /usr/share/bug/apt/script to /usr/share/bug/apt . This causes dpkg to
> fail when running in an overlayfs with the following error:
> 
> # dpkg -i /var/cache/apt/archives/apt_1.3~rc3_amd64.deb 
> (Reading database ... 11401 files and directories currently installed.)
> Preparing to unpack .../archives/apt_1.3~rc3_amd64.deb ...
> Unpacking apt (1.3~rc3) over (1.3~rc2) ...
> dpkg: error processing archive
> /var/cache/apt/archives/apt_1.3~rc3_amd64.deb (--install):
>  unable to move aside './usr/share/bug/apt' to install new version: Invalid cross-device link
> dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
> Processing triggers for libc-bin (2.23-5) ...
> Errors were encountered while processing:
>  /var/cache/apt/archives/apt_1.3~rc3_amd64.deb
> 
> I don't know what the correct workaround should be.
> 
> This can break pre-build upgrades in sbuild when the schroot is of
> overlayfs type.

thanks for the analysis!

I just stumbled across the exact same problem with sbuild in a directory type
overlayfs schroot. My workaround: destroy the chroot (you can now use
sbuild-destroychroot) and then recreate it with sbuild-createchroot. :(

cheers, josch
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Mon May 12 02:24:23 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.