Have tried everything but ubuntu keeps giving an error

Hey, I have problems installing Ubuntu on my server.

I have a USB stick (64gb sandisk) that i want to flash ‘ubuntu-20.04.1-desktop-amd64.iso’ to. The first time I did it I got a message at the end of the process in belena, that there was an error.

I ignored it because I’m stupid and put the USB stick in my server. Booted from it, but when it was checking the filesystem (before going into the ‘Try ubuntu or install ubuntu’ screen), it said something like “Filesystem checked: 1 errors found; you may run into crashes”.

Again ingored it because I’m again stupid, but after it everything worked fine. Installed lots of things, set everything up and all was good.

It worked perfectly for 3 weeks. I wanted to reboot the system (did some sudo apt update/upgrade, so I thought let’s just reboot it, it can’t hurt) but it wouldn’t boot. It said that it (something like, can’t remember) couldn’t load kernel or something. Searched it up and found out that it had to do with the errors while flashing and the error when checking the filesystem. That the live usb was currupted. Fortunaly i was able to boot from the live usb and move 1tb of plex media to a different drive so that i wouldn’t lose it (moved it over the network).

I began google-ing and found this link: https://www.raspberrypi.org/forums/viewtopic.php?t=196472

Following this, I can give you the following information: I use the direct ISO file, not in a zip file. I have disconnected from the internet while flashing to stop anti virus software (as the last reply suggests), but didn’t work. My USB stick is perfectly working. I have ran balenaetcher an administrator, didn’t change anything. They also asked for the CTRL+SHIFT+I info. So here you have it.

This is what I have when verifying. It says 0 failed devices…

Verifying 1 device, 48% at 128.40 MB/s (total 128.40 MB/s) eta in 11s with 0 failed devices

But when it’s done, it says ‘1 failed target’.

In the console it says the following:

Tue Oct 20 2020 11:26:49 GMT+0200 (Midden-Europese zomertijd) Validation error ({"image":{"size":2785017856,"name":"ubuntu-20.04.1-desktop-amd64.iso","hasMBR":true,"partitions":[{"offset":2568904704,"size":4063232,"type":239,"index":1}],"extension":"iso","path":"D:\\iso\\ubuntu-20.04.1-desktop-amd64.iso"},"drives":[{"size":61530439680,"isVirtual":false,"enumerator":"USBSTOR","logicalBlockSize":512,"raw":"\\\\.\\PhysicalDrive2","error":null,"isReadOnly":false,"displayName":"E:\\","blockSize":512,"isSCSI":false,"isRemovable":true,"device":"\\\\.\\PhysicalDrive2","busVersion":"2.0","isSystem":false,"busType":"USB","isCard":false,"isUSB":true,"devicePath":null,"mountpoints":[{"path":"E:\\"}],"description":"SanDisk Ultra Fit USB Device","isUAS":false}],"driveCount":1,"uuid":"20b23c40-18f3-4da4-83ae-c42774772641","flashInstanceUuid":"20b23c40-18f3-4da4-83ae-c42774772641","unmountOnSuccess":true,"validateWriteOnSuccess":true,"sample":0.1,"applicationSessionUuid":"3174732a-db6a-4b10-b6d1-be9254304251","flashingWorkflowUuid":"4ada6234-a1c4-4ea0-b6af-101093fabfcc"})

When i look at the drive (It’s in dutch sorry),


It’s only 4mb big. And 57gb of the drive is just not there, as you can see in the diskmanager here.

On the drive it is the following: efi -> boot -> boootx64.efi grubx64.efi mmx64.efi
Thats all. Just three files in a folder in a folder.

The drive is formatted in NTFS. But when i change that to exfat (format the 4mb, remove the volume, format the whole drive), AKA the drive is one big 64gb normal empty exfat drive, and I flash it again, i get no errors in balena.

So in NTFS i get errors, but in exfat not.

When I’m done flashing the drive (exfat), it says ‘1 successful target’, and i have the following in the console screen:

Tue Oct 20 2020 11:42:43 GMT+0200 (Midden-Europese zomertijd) Done ({"image":{"size":2785017856,"name":"ubuntu-20.04.1-desktop-amd64.iso","hasMBR":true,"partitions":[{"offset":2568904704,"size":4063232,"type":239,"index":1}],"extension":"iso","path":"D:\\iso\\ubuntu-20.04.1-desktop-amd64.iso"},"drives":[{"size":61530439680,"isVirtual":false,"enumerator":"USBSTOR","logicalBlockSize":512,"raw":"\\\\.\\PhysicalDrive2","error":null,"isReadOnly":false,"displayName":"F:\\","blockSize":512,"isSCSI":false,"isRemovable":true,"device":"\\\\.\\PhysicalDrive2","busVersion":"2.0","isSystem":false,"busType":"USB","isCard":false,"isUSB":true,"devicePath":null,"mountpoints":[{"path":"F:\\"}],"description":"SanDisk Ultra Fit USB Device","isUAS":false}],"driveCount":1,"uuid":"b6b76cb6-41e2-4a4d-88d7-a35fafb7f8dc","status":"finished","flashInstanceUuid":"b6b76cb6-41e2-4a4d-88d7-a35fafb7f8dc","unmountOnSuccess":true,"validateWriteOnSuccess":true,"errors":[],"devices":{"failed":0,"successful":1},"bytesWritten":2785017856,"sourceMetadata":{"size":2785017856,"name":"ubuntu-20.04.1-desktop-amd64.iso","blocks":[{"blocks":[{"offset":0,"length":2785017856}]}],"blockmappedSize":2785017856},"sample":0.1,"applicationSessionUuid":"3174732a-db6a-4b10-b6d1-be9254304251","flashingWorkflowUuid":"00d169ea-a831-40b9-8e7c-0ce964210007"})

So I thought great, it’s fixed. Strange but ok. It’s still 4mb, still just 3 files but hey, it said successful. I plug the drive in my server, boot from it and ofcourse… “Filesystemchecked: 1 error found; you may encounter crashes”. Ofcourse it’s not that easy.

So now I really don’t know what to do anymore. I followed other people’s suggestions, but it just doesn’t work.

HELP… please…

Just checking, is your issue that the ISO you have for Ubuntu will not flash without errors on boot, or?

If so, then check the MD5/SHA sum of the ISO you have against Ubuntu and make sure they match. If they do then perhaps try another USB drive. Failing that I am not sure.

When i choose the iso file and the drive and balena starts doing it’s thing, at the end I get an (NTFS) ‘1 failed target’ message. But with exfat I get an (exfat) ‘1 successful target’.

But when I boot from the USB on my server (doesn’t matter if it’s NTFS or exfat) I get a “Filesystem checked: 1 errors found; you may run into crashes” message.

I don’t know how to check the MD5/SHA sum and compare it to Ubuntu’s, but I’ll do some google-ing to find out. Thanks

Hello, what OS are you using?

Basically, if you are using windows you can use CertUtil -hashfile <path to file> MD5 and if on mac or linux and you have openssl it’s openssl md5 <path to file>.

Hey,
I found out what the MD5 sum is of my iso file. It is the following:
77fc715a283e41d0ad33d6418a9ba128

The only thing i don’t know is, how do I compare it “against Ubuntu and make sure they match”?

And thanks mbalamat for explaining how i can find the MD5 sum :+1:.

Hello,

What do you mean by “I get an (NTFS) ‘1 failed target’” ?
Where do you choose between ntfs and exfat ?

Have you tried using another usb stick ?

It worked perfectly for 3 weeks. I wanted to reboot the system (did some sudo apt update/upgrade, so I thought let’s just reboot it, it can’t hurt) but it wouldn’t boot. It said that it (something like, can’t remember) couldn’t load kernel or something.

If it worked for 3 weeks then stopped working after an update, the problem is most probably that something went wrong during the update.

When I format the drive in NTFS in disk manager in windows.

Yes. Same problem. I have done a H2testw and it said that the usb stick was completely fine. The usb stick is not faulty.

After I got the ‘cant load kernel’ massage, I searched it up and every result suggested a corrupt usb install.

We can check this by comparing the md5 checksums of the ubuntu file and my ubuntu iso file. I already have the md5 checksum of my ubuntu iso file. I just don’t know how to compare it to the original ubuntu file.

When I format the drive in NTFS in disk manager in windows.

You don’t need to format the drive before flashing it. The image you flash will replace the partition table and any partition you’ve created anyway.

After I got the ‘cant load kernel’ massage, I searched it up and every result suggested a corrupt usb install.

That would be a good explanation if you got that error right after flashing. But right after flashing your system was working correctly.

We can check this by comparing the md5 checksums of the ubuntu file and my ubuntu iso file. I already have the md5 checksum of my ubuntu iso file. I just don’t know how to compare it to the original ubuntu file.

Ubuntu provides sha256 sums for their images (not md5), they are here https://releases.ubuntu.com/20.04/SHA256SUMS
Your file will most probably match.

On Windows, it might happen that Windows will write some data to partitions it can read right after Etcher flashes the image and before it finishes verifying it. This happens only with images that have fat or ntfs partitions. The ubuntu image has a fat partition. This would explain the verification error in etcher.
You can check Redirecting to see how to disable it.

However, I really doubt your issue is with the disk image if your system worked fine after installing it.

Thought I’d give an update.

IT WORKS.

Said bye bye to Balena. Said hello to Rufus. Chose the usb stick. Chose the iso file. Clicked Start. And then the magic.

Rufus told me that the iso file is a ISOHybrid-image. It said that when you have problems while booting, you should try to flash it in ‘DD-image-mode’ instead of ‘ISO-image-mode’. ISO-image-mode is recommended by Rufus. Ofcourse I chose DD-image-mode, because I had problems booting up (couldn’t load kernel).

And it worked. Got zero errors while booting from the usb stick. ‘Filesystem checked: 0 errors found’
I’m so happy right now haha.

I should mention that I chose the recommended ISO-image-mode a few days ago but then I still got the errors. The thing that saved it is the DD-image-mode.

Glad that it now works! We also recommend Rufus in some cases (e.g. bootable images). The first time you got the error it was most likely a verification error if the flash reached the end, meaning that the checksum did not match so it would’ve been better to try and re-flash it, especially on Windows where weird things can happen.