unable to make backup link of <some-file> before installing new version: Operation not permitted

Bug #1578863 reported by TJ
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
dpkg (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I accidentally reported this against bug 559127 via a duplicate but then realised that bug is specific to "Input/Output Error" so I'm reposting here.

I've just encountered this with 16.04 whilst developing a bash script that cross-builds (on amd64) a complete custom armhf RasPi 2/3 installation image.

It triggered when linux-image packages were being unpacked by 'dpkg' to the chroot target /boot/ directory.

The amd64 system has qemu-user-static and binfmt-support installed so that commands can be executed in the armhf target chroot.

The command:

$ sudo chroot /mnt/raspi dpkg -i /var/local/cache/apt/archives/linux-image-4.5.0-v7+_4.5.0-v7+-2_armhf.deb
(Reading database ... 30501 files and directories currently installed.)
Preparing to unpack .../linux-image-4.5.0-v7+_4.5.0-v7+-2_armhf.deb ...
Unpacking linux-image-4.5.0-v7+ (4.5.0-v7+-2) over (4.5.0-v7+-2) ...
dpkg: error processing archive /var/local/cache/apt/archives/linux-image-4.5.0-v7+_4.5.0-v7+-2_armhf.deb (--install):
 unable to make backup link of './boot/config-4.5.0-v7+' before installing new version: Operation not permitted
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/local/cache/apt/archives/linux-image-4.5.0-v7+_4.5.0-v7+-2_armhf.deb

and strace reveals:

13605 utimes("/boot/config-4.5.0-v7+.dpkg-new", {{1462489111, 0}, {1458064430, 0}}) = 0
13605 link("/boot/config-4.5.0-v7+", "/boot/config-4.5.0-v7+.dpkg-tmp") = -1 EPERM (Operation not permitted)

Additional debug info using dpkg -D7777 ...

...
D000100: setupvnamevbs main='/boot' tmp='/boot.dpkg-tmp' new='/boot.dpkg-new'
D000100: tarobject already exists
D000100: tarobject directory exists
D000010: tarobject ti->name='./boot/config-4.5.0-v7+' mode=100644 owner=0:0 type=48(-) ti->linkname='' namenode='/boot/config-4.5.0-v7+' flags=2 instead='<non
e>'
D000100: setupvnamevbs main='/boot/config-4.5.0-v7+' tmp='/boot/config-4.5.0-v7+.dpkg-tmp' new='/boot/config-4.5.0-v7+.dpkg-new'
D000100: tarobject already exists
D000010: path_remove_tree '/boot/config-4.5.0-v7+.dpkg-new'
D000010: path_remove_tree '/boot/config-4.5.0-v7+.dpkg-tmp'
D000100: tarobject file open size=133889
D000100: tarobject file hash=2666c2e844c3e9ce3a7121842743ed95
D000100: tarobject nondirectory, 'link' backup
dpkg: error processing archive /var/local/cache/apt/archives/linux-image-4.5.0-v7+_4.5.0-v7+-2_armhf.deb (--install):
 unable to make backup link of './boot/config-4.5.0-v7+' before installing new version: Operation not permitted
D000010: cu_installnew '/boot/config-4.5.0-v7+' flags=202
D000100: setupvnamevbs main='/boot/config-4.5.0-v7+' tmp='/boot/config-4.5.0-v7+.dpkg-tmp' new='/boot/config-4.5.0-v7+.dpkg-new'
D000100: cu_installnew not restoring
D000100: secure_remove '/boot/config-4.5.0-v7+.dpkg-new' unlink OK
...

RasPi images require the boot file-system to be VFAT:

$ mount | grep /mnt/raspi/boot
/dev/mapper/VG_DATA-raspi1 on /mnt/raspi/boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

$ sudo blkid /dev/mapper/VG_DATA-raspi1
/dev/mapper/VG_DATA-raspi1: SEC_TYPE="msdos" LABEL="RASPI_4084" UUID="C5B8-3907" TYPE="vfat" PARTLABEL="primary" PARTUUID="009a2020-4eec-451a-9bb7-b18241729fd1"

As far as I recall it isn't possible to hard link on VFAT.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dpkg (Ubuntu):
status: New → Confirmed
Revision history for this message
untoreh (untoreh) wrote :

#1318951

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.