I am installing ubuntu on a brand new motherboard (onto m.2 ssd) using an usb

when I got to the part of extracting image from cp:///media/systemfile, it gets error. error code 23 with message:

file "/usr/lib/python3/dist-packages/curtin/utils.py, line131, in _subp cmd=args)
...tin.util.ProcessExecutionError: Unexpected error while running command.
command: ['sh', '-c', 'mkdir -p "$2" && cd "$2" && rsync -aXHAS --one-file-sstem "$1/" .', '--',
...t code :23
reason : -
stdout: ''
stderror: ''

Can someone explain what is the cp: protocol? what is it trying to do?

and what would be error code 23 in this case?

  • cp:///media/filesystem or cp:///media/systemfile. Edit taken from here. Sep 22, 2018 at 7:21
  • OS error code 23: Too many open files in system
    – danblack
    Sep 22, 2018 at 7:22

1 Answer 1


"23 Partial transfer due to error". See http://manpages.ubuntu.com/manpages/bionic/en/man1/rsync.1.html#exit%20values

Normally an rsync command would print an error message. But curtin is being horribly unhelpful here. It doesn't pass capture to _subp(), and as a result it sets stderr to None. Any error messages from rsync are simply discarded.

While looking up curtin, I found its definition of cp:///.


Specify the root image to install on to the target system. The URI also configures the method used to copy the image to the target system.


source URI may be one of:

  • dd-: [sic] Use dd command to write image to target.
  • cp://: Use rsync command to copy source directory to target.
  • file://: Use tar command to extract source to target.
  • http[s]://: Use wget | tar commands to extract source to target.
  • fsimage://: mount filesystem image and copy contents to target. Local file or url are supported. Filesystem can be any filesystem type mountable by the running kernel.
  • thanks, that's really deep. It was indeed due to bad image on the usb.
    – bhomass
    Sep 24, 2018 at 15:43
  • @bhomass thanks for the followup! I think this answers the question as written, would you like to mark it as accepted? (click on the grey tick at the right hand side). (I thought it might be something like this :) after having troubleshooted a Fedora install failure due to a bad install image / bad usb. unix.stackexchange.com/a/453307/29483 . As I wrote, the Fedora USB writer is great as it verifies the written image, but it's only shipped for Windows and Fedora, on generic Linux you kind of have to resort to cmp on the command line).
    – sourcejedi
    Sep 24, 2018 at 15:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .