40

Today I downloaded Ubuntu for my laptop. It runs great from a bootable USB, but when I tried to install it, I got the following error message:

The installer encountered an error copying files to the hard disk:

[Errno 5] Input/output error

This is often due to a faulty CD/DVD disk or drive, or a faulty hard   
disk. It may help to clean the CD/DVD, to burn the CD/DVD at a lower  
speed, to clean the CD/DVD drive lens (cleaning kits are often   
available from electronics suppliers), to check whether the hard disk  
is old and in need of replacement, or to move the system to a cooler  
environment.  

enter image description here

I tried everything to install it on my laptop including redownloading the Ubuntu ISO image, but nothing worked.

1

12 Answers 12

24

I had this problem too, during installation...

[Errno 5] Input/output error

Target machine was a brand new Asus K53e laptop. Installation image was ubuntu-11.10-desktop-amd64.iso (64-bit). I burned this image to CD... Errno 5. Burned it to bootable USB stick... Errno 5 again :( I tried 4 or 5 times.

fsck said the entire root partition was fine (after 10 hours). memtest86+ said all 6GB of RAM was fine too. I tried installing directly when the live image booted up (Install Ubuntu). I also tried the Try Ubuntu button, then ran install from the live desktop. Again, Errno 5.

In the end, it turns out the iso file I downloaded was somehow out of date or wrong. Can you believe it!?

$ md5sum ubuntu-11.10-desktop-amd64.iso

The output was different from Ubuntu's official hash (62fb5d750c30a27a26d01c5f3d8df459). Then I cast my mind back. I remember, when I downloaded this image, I think I was forwarded from ubuntu.com to a mirror site, and I chose a French one at random because my nearest UK mirror was down. It must've been slightly out of date or something. In fact, I now remember seeing entries like this

SQUASHFS error: zlib inflate error, data probably corrupt
squashfs_read_data failed to read block 0x1e457bbd

in the output of dmesg (I think) or somewhere in /var/log when checking after the installation crash dumped me back to the live (Try Ubuntu) desktop.

Basically, make sure you check the MD5 hash of your downloaded ISO file! (I know. I know. I rarely check either!)

Anyway,I downloaded 64-bit Ubuntu 11.10 again and, this time, I was prompted with a Save As dialog, instead of being asked to choose a mirror site. When downloaded, checksum matched :) Installation ok :)

4
  • 1
    Correct hashes are listed here: help.ubuntu.com/community/UbuntuHashes, and zsync (help.ubuntu.com/community/ZsyncCdImage) is useful to fix *.iso.
    – vorburger
    May 27, 2014 at 18:00
  • Thank you @tarmarc, also for MD5 problem just download the torrent file and it will fix the incomplete part of your ISO May 30, 2017 at 23:18
  • I downloaded from torrent. Md5sum is matching. Still facing the same issue. It is a brand new pc. And have checked for bad sectors too Jun 3, 2017 at 13:50
  • I suggest that you go to alternative download and download the iso using torrent.
    – anirus
    Jan 4, 2018 at 2:18
15

You may have some bad sectors on the target HDD.

To check sda1 volume for bad sectors in Linux run fsck -c /dev/sda1. For drive C: in Windows it should be chkdsk c: /f /r.

IMHO chkdsk way will be more suitable as it will remap bad blocks on the HDD while Linux fsck simply marks such blocks as unusable in the current file system.

Quote from man fsck.ext2

-c This option causes e2fsck to use badblocks(8) program to do a read-only scan of the device in order to find any bad blocks. If any bad blocks are found, they are added to the bad block inode to prevent them from being allocated to a file or directory. If this option is specified twice, then the bad block scan will be done using a non-destructive read-write test

7
  • I format my installation USB to low level from windows, re-mount the iso and it works... my hdd works great but this USB pendrive not. Thanks a lot for the answer Oct 15, 2011 at 13:30
  • i have same problem and i have tried fresh download from Ubuntu site and solved Thank For Support Jul 6, 2015 at 16:57
  • -1 chkdsk can only remap bad blocks, if the file system supports it, which is only FAT. In a similar fashion, fsck can only work on existing file systems, which is not very useful, when trying to create a new file system during system installation. If one wants to simply detect bad blocks independently of any file systems, one should use badblocks(8) directly. Additionally, modern HDDs and SDDs will remap bad blocks, if you try to write to them (and there are unused reserve blocks left). Bad blocks are also a sign, that a drive is dying and shouldn't be used any longer. Nov 14, 2015 at 7:58
  • When I did 'chkdsk' from Windows, it returned no errors and no bad blocks. So I had to use the windows Disk Management Utility to delete the unsuccessful installation of Ubuntu and leave it unallocated. Tried to install again and it worked.
    – axolotl
    May 27, 2016 at 11:13
  • @Sergey - i just got this hard disk and it's brand new. does this mean i should get a new one?
    – BenKoshy
    Jul 25, 2018 at 14:08
3

I've seen many comments proposing various fixes for the "errno 5" issue. I was experiencing the same issue. My solution is pretty simple and one that I believe a lot of users are inadvertently using.

Rather than remove RAM, replacing SATA cables, or reburning discs...Before doing any of that, rearrange the SATA cable in your PC. I found mine were laying in close proximity to the CPU fan. So...in trying some of the other fixes, I rearranged my SATA cables coming from my DVD writers and VOILA!!!...Perfect installation of both Ubuntu 12.04 and LinuxMint Petra.

Just a little hygiene fixed the problem. Hope this helps y'all!

1
  • Cleaning Ram and removing dust from my board works perfectly. Oct 8, 2021 at 4:30
3

Your ISO was either corrupted, or your write to install media was flawed. Other reasons for it are the install media is faulty etc, but in my experience it's the write to install media most at fault.

Did you verify your ISO after download and before write to media?

https://tutorials.ubuntu.com/tutorial/tutorial-how-to-verify-ubuntu#0

Assuming you trust your installation media, the write is the most common faulty flaw in my experience, so I write it again (if it fails again, using another box or to different media). Either way first step is the validate your ISO following the tutorial.

FYI: For faulty installation media, you'll see messages like the following in logs, these are the result of what I'm describing:

Jun 26 10:37:24 ubuntu kernel: [  363.074612] SQUASHFS error: zlib decompression failed, data probably corrupt
Jun 26 10:37:24 ubuntu kernel: [  363.074615] SQUASHFS error: squashfs_read_data failed to read block 0x76d9b3d5

You can verify this by using

grep |squashfs

which should report only the version message(s) with no errors.

If you file a bug report with these messages, you'll either get a response telling you what I've said here (and marked invalid), or your report will be marked a duplicate of https://bugs.launchpad.net/ubuntu/+bug/1874662 (which you can read for anothers wording of what I'm trying to say)

2

Same thing happened to me while trying to install 11.10.

The system worked perfectly off LiveCD/LiveUSB but would fail when trying to install it. Tried burning a different cd and re-writing the iso on the usb drive, re-partitioned HDD space several times, checked it for errors, low-level formatted the installation usb and no luck.

As a last resort I did a memory test using the memtest86+ that comes in Ubuntu's image and it revealed that I have problems with the memory. I know the test takes up lots of time but if you've never done it, try it out!

I haven't yet replaced my memory so I can't be 100% sure that it'll resolve the problem but very likely.

2

This could be the result of bad RAM in your computer. I had a similar problem and it turned out to be that. Try testing your RAM by booting from the USB flash drive and, as soon as you see the keyboard and person icons at the bottom of the screen, press a key to show the non-graphical boot menu. Then select the option to test your RAM, from there.

If that reveals a defect in your RAM, then you'll have to remove or replace the affected RAM stick. (If you don't feel comfortable with doing this, you should enlist the assistance of a friend, professional, or other acquaintance with hardware experience. Since this would be a hardware issue, you could ask on Super User for advice about it, too.)

This could also be the following problems:

  • Bad installation media (either physically defective, or, more likely, a corrupted write or corrupted ISO image). MD5SUM the Ubuntu ISO you used to make sure it's good (and if it's not, download a new one, MD5SUM it too, and start over with it).

    Also verify that the USB drive was written correctly by selecting Check disc for defects from the same menu that has the RAM test option (see also this video).

  • There could be a problem with the drive you're trying to install Ubuntu to. If you have another drive, you could try installing it to that. Since the live system (running off the flash drive itself) works, you could test your hard disk with smartctl as explained in the Failing Disk section of this article.

0
1

I had the same error and it was just because the ISO file was corrupted. So I re-writed a new and clean ubuntu iso on my USB key and it worked.

1

I also have same issue while installing Ubuntu, I already have Windows 10 in dual boot.

To debugging this I made following tests.

1) checked Disk Diagnostic for HDD, SSD, USB drive in windows.

2) checked Memory Diagnostic in windows(for total memory).

In the Memory Diagnostic test, I found the RAM issue. As I have 4 sticks, 1 or more sticks having a problem

3) repeated step 2 for each RAM stick (by removing other).

I found 1 RAM stick having issue "corsair vengeance LPX 8gb 2400mhz ddr4"

Then I removed it and installed Ubuntu 20.04 without any issues.

This might be one of the reason for installation failure.

1

[Errno 5] Input/output error error message can be caused by the USB flash drive or the USB port.

  • Unplug USB flash drive, plug it into another USB port, and restart the Ubuntu installer. For example, if your computer has both front USB ports and back USB ports unplug the USB flash drive and plug it into another USB port on the other side of the computer.

  • Try recreating the bootable Ubuntu live USB stick again using a different USB stick. Try using the most reliable one or the one used the least often. It might help to buy a new USB flash drive.

0

I had the same problem.

After searching I decided to install Ubuntu from the alternate CD (with the text-based installer) rather than the desktop CD.

That worked.

1
  • 1
    It's likely (though not definite) that this worked because the desktop ISO was corrupted during download. When you separately downloaded the alternate ISO, it was probably not corrupted. If you had redownloaded the desktop ISO, it would likely have worked too. (This is especially relevant now that, as of 12.10, there is no alternate CD.) Feb 17, 2013 at 15:11
0

I was having Issue's trying to install Lubuntu with a bootable USB,and I kept getting that annoying " installer crash" and it wouldn't let me install on my netbook eeePC...Well I finally, got it to Install, and here's how it worked for me. Umm first of all I have win 7 starter on my netbook when I tried to install Lubuntu. So, in the options menu where it asked you how you want to install (partition) go to the "someting else" and in there you will highlight the drive, click on add partition. Now what this does, it wipes out the hard drive leaving it with nothing on it. After your done return back to the menu set up and Install. PS. this is good If your looking to do a FULL INSTALL only !!!

0

In my case that happened because I showed as primary(not secondary!) the Hard disk. But this is a *.iso file so you need to expose CD disk not Hard one. The ISO is supposed to be distributed via cd or sd card and its format should match one.Otherwise it will drop error:

[Errno 5] - Input/output error

enter image description here

after installation you can change primary bootable drive to Hard disk the system to load faster.

You must log in to answer this question.

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