Results 1 to 6 of 6

Thread: cp Input/output error

  1. #1
    Join Date
    Aug 2008
    Location
    Mexico and Sweden
    Posts
    1,288

    Default cp Input/output error

    I get a strange Input/output error when I try as root to copy an image file as follows...

    Code:
    apollo:/home/ion/DATA/PHOTOS/AMSTER2015 # ls
    DSC04392.JPG  DSC04393.JPG  DSC04394.JPG  DSC04395.JPG  DSC04396.JPG  DSC04397.JPG
    apollo:/home/ion/DATA/PHOTOS/AMSTER2015 # mount /dev/sdb9 /mnt/hd
    apollo:/home/ion/DATA/PHOTOS/AMSTER2015 # ls /mnt/hd/PHOTOS/AMSTER2015
    apollo:/home/ion/DATA/PHOTOS/AMSTER2015 # 
    apollo:/home/ion/DATA/PHOTOS/AMSTER2015 # cp DSC04392.JPG /mnt/hd/PHOTOS/AMSTER2015
    cp: cannot create regular file ‘/mnt/hd/PHOTOS/AMSTER2015/DSC04392.JPG’: Input/output error
    How do I go about diagnosing the problem? Thanks in advance.

  2. #2

    Default Re: cp Input/output error

    Try reading from disk to nowhere to just verify it can be done:

    Code:
    cat DSC04392.JPG >> /dev/null
    If that works, then perhaps you have a writing problem. Try putting
    arbitrary data where that file would go, preferably in a similar quantity
    (MBs):

    Code:
    dd if=/dev/zero of=/mnt/hd/PHOTOS/AMSTER2015/test0 bs=1048576 count=10

    --
    Good luck.

    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below...

  3. #3
    Join Date
    Aug 2008
    Location
    Mexico and Sweden
    Posts
    1,288

    Default Re: cp Input/output error

    Hexedit shows no white spaces of the file names being copied.

    Code:
    00000000   44 53 43 30  34 33 39 32  2E 4A 50 47  0A 44 53 43  30 34 33 39  DSC04392.JPG.DSC0439
    00000014   33 2E 4A 50  47 0A 44 53  43 30 34 33  39 34 2E 4A  50 47 0A 44  3.JPG.DSC04394.JPG.D
    00000028   53 43 30 34  33 39 35 2E  4A 50 47 0A  44 53 43 30  34 33 39 36  SC04395.JPG.DSC04396
    0000003C   2E 4A 50 47  0A 44 53 43  30 34 33 39  37 2E 4A 50  47 0A 78 78  .JPG.DSC04397.JPG

  4. #4
    Join Date
    Aug 2008
    Location
    Mexico and Sweden
    Posts
    1,288

    Default Re: cp Input/output error

    Quote Originally Posted by ab View Post

    If that works, then perhaps you have a writing problem. Try putting
    arbitrary data where that file would go, preferably in a similar quantity
    (MBs):

    Code:
    dd if=/dev/zero of=/mnt/hd/PHOTOS/AMSTER2015/test0 bs=1048576 count=10

    --
    Good luck.

    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below...
    That did the trick. It errored out. Deleting the directory and re-creating it solved the problem. Many thanks.

  5. #5
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: cp Input/output error

    On 2015-07-06 13:26, ionmich wrote:

    > How do I go about diagnosing the problem? Thanks in advance.


    Is it an USB stick?

    Run "dmesg -Tw" in a terminal, connect the stick, mount, write a file,
    then paste the /new/ text in the terminal.

    --
    Cheers / Saludos,

    Carlos E. R.

    (from 13.1 x86_64 "Bottle" (Minas Tirith))

  6. #6
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: cp Input/output error

    On 2015-07-06 14:26, ionmich wrote:

    > That did the trick. It errored out. Deleting the directory and
    > re-creating it solved the problem. Many thanks.


    That means you must run fsck on that partition, before it bombs out...

    --
    Cheers / Saludos,

    Carlos E. R.

    (from 13.1 x86_64 "Bottle" (Minas Tirith))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •