Web lists-archives.com

Re: Debian Live USB fails; bricks the USB stick






On Tue, Nov 7, 2017 at 1:37 PM, Thomas Schmitt <scdbackup@xxxxxxx> wrote:
Hi,

> sudo if=debian-live-9.2.0-amd64-cinnamon.iso  of=/dev/sdc

I assume the missing "dd" between "sudo" and "if=" is a copy+paste error.
Elsewise it is the correct copying method.


Yes, my bad. Sorry. 



> I checked the md5sum on the downloaded file (it was correct),

Did you also check the MD5 of the copy on USB stick ?

  dd if=/dev/sdc bs=2048 count=1043616 | md5sum

This has to be done before booting the stick the first time.
If i boot the image with OVMF as virtual firmware, then the MD5 of the
ISO changes. Obviously some data get written into the EFI partition.


No, I did not check the MD5 of the USB stick's copy. This is a good thing to know for future attempts.

 

> It gave me the grub menu,

So the copying process has probably worked fine.

If the menu is really from GRUB (with a headline saying "GNU/GRUB") and
not ISOLINUX (with no such headline), then your firmware is EFI in its
native mode.


The headline says "GNU GRUB Version 2.02~beta3-5". 




> but then when I tried to
> boot Debian Live, I got an error about an invalid magic number and a need to
> load a kernel first.

This must be an inner problem of the operating system.

But

  qemu-system-x86_64 -enable-kvm -m 512 \
                     -bios /usr/share/ovmf/OVMF.fd \
                     -hda debian-live-9.2.0-amd64-cinnamon.iso

boots for me through the first item of the GRUB menu and the kernel boot
messages into some graphical desktop.
The option -hda is the equivalent to an USB stick, -cdrom would be the
equivalent of a CD or DVD.''


Well that's cool! I've used Parallels years ago, then VMWare a bit, then VirtualBox, and had a couple of false starts with QEMU (so it's installed on my Debian box), but I think this is the first time I've ever seen it in action. (I don't have a /usr/share/ovmf directory, so I skipped that part; still, cool!)

Yeah, I get to a partial Cinnamon desktop (it's missing pieces) so that tells me that the image [mostly/sort of] works.



Since i cannot reproduce the problem from your info, you will have to
describe the symptoms and preconditions in more detail.
What's the firmware mode ? EFI or BIOS/Legacy ?
Especially the original error messages will be needed.

The firmware mode is EFI; BIOS/Legacy is disabled.

But I also tried re-enabling BIOS/Legacy, and setting it to that mode, just to see what happened. That was this morning, so I don't recall exactly what happened, but I do recall it didn't help.



Then probably you will have to carry the issue to debian-live mailing list
  https://lists.debian.org/debian-live/


> And now, both my sticks are complaining about being mounted read-only, and I
> can't seem to fix that.

That's just a consequence of the fact that the partitions number 1 of the
sticks bear ISO 9660 filesystems, which are read-only. The stick is still
writable.

I thought I had rescued one of the sticks by discovering that cfdisk would write to it and wipe out the partitions. But by the time I finished tinkering with that, the stick became completely unreadable - sort of. I stick it into my Debian box, and dmesg sees an sdc appear, but trying to access it in any way reports that there's no medium for /dev/sdc. I'll try the dd trick you share below, as soon as I can find where I misplaced that stick :-0 

You can invalidate the ISO 9660 filesystem by

  dd if=/dev/zero bs=2048 count=1 seek=16 of=/dev/sdc

You may want to change the partitioning and also remove the EFI partition 2.
Then you may create new filesystems in the partitions.

(If you had dd'ed a backup image of the USB stick before dd-ing the ISO onto
 it, then you could dd that image onto the stick to get back the old
 partitions and their filesystems.)


Have a nice day :)

Thanks! I appreciate your help!
 

Thomas




--
Kent West                    <")))><
Westing Peacefully - http://kentwest.blogspot.com