1

I'm trying to install Ubuntu from a live USB but always encounter errors in the copying files installation phase.

The error message says that this I/O error are commonly due to faulty Medium or HDD. I'm checking my SSD and making a new Live USB to try again.

So this is my concern I can md5sum the ISO I download, but how do I check the live USB is good?

userDepth
  • 2,010
  • I would suspect that other hardware is throwing the error , such as motherboard. I've used same USB that I was using for 3 other installations for an old PC , as well as live CD, but in no way it was successfull. I had to use another computer with SATA to USB controller to install Ubuntu there and then plug in the HDD back to the computer. – Sergiy Kolodyazhnyy Nov 22 '15 at 21:38
  • I don't get it @Serg . His question is asking about how does he check the live USB is good? right – BeGood Nov 22 '15 at 21:45
  • probably not enough ram, try this instead https://help.ubuntu.com/community/Installation/MinimalCD – mchid Nov 22 '15 at 21:47
  • @BeGood If you've read the question, you can see that OP mentioned I/O error while trying to install from a live USB. Live USB itself may be totally fine, but there may be issue with other hardware. – Sergiy Kolodyazhnyy Nov 22 '15 at 21:48
  • Voted to reopen because this question is not a duplicate of the linked question: they're asking how to check if the Live USB has defects, not how to check which defect(s) it has (which would imply by premise that the Live USB is defective, which is something yet to be determined). – kos Apr 13 '16 at 05:53

1 Answers1

3

You can check the integrity of the image written to the USB drive by checking its MD5 sum against the original ISO's MD5 sum:

  1. Check the original ISO's size:

    % ls -l archlinux-2015.10.01-dual.iso 
    -rwxrwxr-x 1 user user 689963008 nov 22 21:35 archlinux-2015.10.01-dual.iso
    
  2. Run this command (replace /dev/sdc with the actual device and change 689963008 according to the original ISO's size):

    sudo dd if=/dev/sdc iflag=fullblock count=$((689963008/512)) 2>/dev/null | md5sum -
    
  3. Check the output against the original ISO's MD5 sum.

If you want to get fancy:

  1. Enable the Universe repository (you can do that in Software & Updates);

  2. Install pv: sudo apt-get install pv;

  3. Check the original ISO's size:

    % ls -l archlinux-2015.10.01-dual.iso 
    -rwxrwxr-x 1 user user 689963008 nov 22 21:35 archlinux-2015.10.01-dual.iso
    
  4. Run this command (replace /dev/sdc with the actual device and change 689963008 according to the original ISO's size):

    sudo dd if=/dev/sdc iflag=fullblock count=$((689963008/512)) 2>/dev/null | pv -s 689963008 | md5sum -
    
  5. Check the output against the original ISO's MD5 sum.

kos
  • 35,891
  • Please explain the downvote. This method works perfectly, so I guess the problem is elsewhere. – kos Nov 22 '15 at 21:16
  • Does it work with LiveUSB ?. I mean after make a boots file in USB, whole file are extracted from iso. – BeGood Nov 22 '15 at 21:19
  • 1
    @BeGood Not sure what you mean exactly, but this will work either if done from an installed system or from a Live USB, even if the running system has been booted from the Live USB itself. – kos Nov 22 '15 at 21:26
  • So it likes Check disk for defects right? – BeGood Nov 22 '15 at 21:33
  • The package is not available in the 15.10 repos. So cannot try out.

    sudo apt-get install pv Reading package lists... Done Building dependency tree
    Reading state information... Done E: Unable to locate package pv

    – userDepth Nov 22 '15 at 21:38
  • @BeGood No, the option you're referring to checks if the disk is physically damaged, this method is useful only to check if the image written to the drive corresponds to the original non-broken image (which on the other hand on success implies that the drive is not damaged in correspondence of any of the read blocks). – kos Nov 22 '15 at 21:39
  • 1
    @user3005629 Yes, I didn't mention that you'll have to enable the Universe repository in order to install pv (you can do that in Software & Updates). – kos Nov 22 '15 at 21:40
  • As mention in Q he said : So this is my concern I can md5sum the ISO I download, but how do I check the live USB is good ? . and the source said “Check disk for defects” will compare the checksums of the files on the USB drive against a known good list. – BeGood Nov 22 '15 at 21:42
  • 1
    @BeGood My bad, I thought that option would have run a S.M.A.R.T. test or something. Then yes it's basically the same, but you don't necessarily need to boot the Live USB. – kos Nov 22 '15 at 21:49
  • if the same you should give a question and a solution is how to check disk for defects liveUSB without boots itself. I'm sure that will be my favvorite question – BeGood Nov 22 '15 at 21:51
  • @BeGood I'm not sure what you mean. The question is "How to check the integrity of Live USB in Ubuntu 15.10 amd 64 ( Not Xubuntu )"; this answer seems to fit it. – kos Nov 22 '15 at 21:58
  • I down-voted it because it was not applicable in my condition. But that's not really part of the question. My condition was that I was on a Live session but once by luck i could finally install Ubuntu after trying for TWO days then I finally can try your method and approve it.

    The software sources are enabled by default so no need to add them.

    I will try out and check your answer as approved.

    – userDepth Nov 22 '15 at 22:47
  • @user3005629 1. This works from the Live session. 2. Even if it wouldn't have worked from the Live session, please explain how are people supposed to know about your condition if you don't point that out in the question. – kos Nov 22 '15 at 22:55
  • As you can observe my first reply was about getting pv installed because I was confused by the alternative and thought I also needed it for the main answer. So it looked incomplete but now I re-read the answer and after your reply on the comments found you weren't suggesting a software that was not in the repos. My bad.

    Note: See that I included the Ubuntu version

    – userDepth Nov 22 '15 at 23:37
  • Kos would you please add the documentation here and quote a reference to the part that shows the method with dd ? Since your answer has been pointed as an exact duplicate. But the other answer doesn't emphasize this way of checking the USB. – userDepth Apr 12 '16 at 23:39
  • @kos read the previous comment – userDepth Apr 13 '16 at 01:10
  • @user3005629 I'm not sure what do you want me to do exactly, add a reference to what? However on the duplicate part, I voted to reopen your question, since the questions are not duplicates at all IMO. – kos Apr 13 '16 at 05:55
  • I agree and sorry I let loose ends before asking for the reference I meant this part:

    https://help.ubuntu.com/community/HowToMD5SUM#Check_the_CD

    I only speculate that maybe this is the part that made them think this is a duplicate. But you could reference your answer there and say is the same method stated there but for a USB Live image. Good day! :D

    – userDepth Apr 13 '16 at 11:57
  • So... is the first method sufficient or not? Is the second one more reliable, or does it just give more information? I.e., what's the difference? – polynomial_donut Jul 31 '18 at 15:35