FedoraQt / MediaWriter

Fedora Media Writer - Write Fedora Images to Portable Media
GNU General Public License v2.0
742 stars 161 forks source link

My USB is oddly written - and does not boot #106

Closed bobgus closed 3 years ago

bobgus commented 7 years ago

My host machine is also running Fedora WS 26. It has been booted from UEFI.

The USB is a 4GB with a usb 3 interface.

I can start mediawriter in my user account, but when it finishes writing a USB disk, it says the write was successful, but also mentions there was a Permission problem.

When mounting a partition, I get: [root@hoho8 ~]# mount /dev/sde1 /mnt/cf mount: /mnt/cf: WARNING: device write-protected, mounted read-only. [root@hoho8 ~]#

(This may be the problem - but how to un-protect the partition)

Moving along:

My USB disk appears as: brw-rw----. 1 root disk 8, 64 Aug 17 14:27 /dev/sde brw-rw----. 1 root disk 8, 65 Aug 17 14:27 /dev/sde1 brw-rw----. 1 root disk 8, 66 Aug 17 14:27 /dev/sde2 brw-rw----. 1 root disk 8, 67 Aug 17 14:27 /dev/sde3

[root@hoho8 ~]# mount /dev/sde1 /mnt/cf [root@hoho8 ~]# ls -l /mnt/cf total 8 dr-xr-xr-x. 3 root root 2048 Jul 5 17:29 EFI dr-xr-xr-x. 3 root root 2048 Jul 5 17:29 images drwxrwxr-x. 2 root root 2048 Jul 5 17:29 isolinux drwxrwxr-x. 2 root root 2048 Jul 5 17:28 LiveOS [root@hoho8 ~]#

[root@hoho8 ~]# umount /mnt/cf [root@hoho8 ~]# mount /dev/sde2 /mnt/cf [root@hoho8 ~]# ls -l /mnt/cf total 2 drwxr-xr-x. 3 root root 2048 Jul 5 17:29 EFI [root@hoho8 ~]#

[root@hoho8 ~]# umount /mnt/cf [root@hoho8 ~]# mount /dev/sde3 /mnt/cf [root@hoho8 ~]#

no files on /dev/sde3 partition

Looking at the partition table of the USB:

[root@hoho8 ~]# umount /mnt/cf [root@hoho8 ~]# fdisk /dev/sde

Welcome to fdisk (util-linux 2.30.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command.

Command (m for help): p Disk /dev/sde: 7.4 GiB, 7927234560 bytes, 15482880 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x0975cb23

Device Boot Start End Sectors Size Id Type /dev/sde1 * 0 3053567 3053568 1.5G 0 Empty /dev/sde2 104772 117775 13004 6.4M ef EFI (FAT-12/16/32) /dev/sde3 117776 145855 28080 13.7M 0 Empty

Command (m for help): q [root@hoho8 ~]#

======

The partition table is not quite what I expected. The 'Type' Empty - I have never seen before..

My user account is in the sudoers file.

My target motherboard (APU2) seems to support UEFI, and the USB drive has some UEFI data written by MediaWriter, but I haven't yet been able to boot from the USB - either normal grub or UEFI.

Any suggestions would be greatly welcomed.

squimrel commented 7 years ago

Everything above looks totally correct. sde1 is read-only because iso9660 is a read-only file system so you can't mount it read-write. The partition table is supposed to look like that. It's the isohybrid layout which the iso uses.

What's the issue / error message when booting / why can't you boot from it?

bobgus commented 7 years ago

Well, it may be totally correct, but the USB disk partition table and contents look different than a USB written with livecd-iso-to-disk:

[user1@hoho8 Downloads]$ su -c "livecd-iso-to-disk --format --reset-mbr --efi Fedora-Workstation-Live-x86_64-26-1.5.iso /dev/sde" Password:

WARNING: This will DESTROY All DATA on: /dev/sde !!

    Press Enter to continue, or Ctrl C to abort.

/dev/sde: 2 bytes were erased at offset 0x000001fe (dos): 55 aa /dev/sde: calling ioctl to re-read partition table: Success Waiting for devices to settle... mkfs.fat 4.1 (2017-01-24)

Copying LiveOS image to target device... squashfs.img 1,482,072,064 100% 419.28MB/s 0:00:03 (xfr#1, to-chk=0/1)

Syncing filesystem writes to disc. Please wait, this may take a while... Setting up /EFI/BOOT Updating boot config file. Installing boot loader Target device is now set up with a Live image! [user1@hoho8 Downloads]$

[root@hoho8 Documents]# mount /dev/sde1 /mnt/cf [root@hoho8 Documents]# ls -l /mnt/cf total 12 drwxr-xr-x. 3 root root 4096 Aug 17 16:00 EFI drwxr-xr-x. 2 root root 4096 Aug 17 16:00 LiveOS drwxr-xr-x. 2 root root 4096 Aug 17 16:00 syslinux [root@hoho8 Documents]# umount /mnt/cf [root@hoho8 Documents]#

[root@hoho8 Downloads]# fdisk /dev/sde

Welcome to fdisk (util-linux 2.30.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command.

Command (m for help): p Disk /dev/sde: 7.4 GiB, 7927234560 bytes, 15482880 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 30AB4225-5837-488E-A33F-BFF9340EF453

Device Start End Sectors Size Type /dev/sde1 8192 15478783 15470592 7.4G EFI System

Command (m for help): q

[root@hoho8 Downloads]# mount /dev/sde1 /mnt/cf [root@hoho8 Downloads]# ls -l /mnt/cf total 12 drwxr-xr-x. 3 root root 4096 Aug 17 16:00 EFI drwxr-xr-x. 2 root root 4096 Aug 17 16:00 LiveOS drwxr-xr-x. 2 root root 4096 Aug 17 16:00 syslinux [root@hoho8 Downloads]#

But this USB doesn't boot either.

I think I will temporarily give up on trying to boot using UEFI and go back to just plain grub.

MartinBriza commented 7 years ago

If legacy boot works for you but UEFI doesn't, it's most likely your secure boot verification doesn't handle the Fedora signing keys as trusted, resulting in the inability to boot from the flash drive. I recommend either disabling secure boot or trying to boot the flash drive on some other EFI-enabled computer.

bobgus commented 7 years ago

So far, I haven't tried legacy boot. Will do so probably today.

However, you haven't addressed why the USB written by your MediaWriter looks so odd compared to the USB written by livecd-iso-to-disk.

squimrel commented 7 years ago

@bobgus it's supposed to look like that. You can always look at the source code if you'd like to know more.

Basically the MediaWriter copies the image dd-like to disk and livecd-iso-to-disk creates a fat partition and sets it up from scratch but still uses some information from the image you provided. As mentioned before the iso you've been using apperently uses the isohybrid layout. That's why the partition table looks like that.

bobgus commented 7 years ago

As a test, I used the USB written by livecd-iso-to-disk to boot up my host Fedora26 system. It worked fine, and it even used the UEFI boot.

I haven't tried the MediaWriter USB yet to do the same thing.

I used the same Fedora-Workstation-Live-x86_64-26-1.5.iso file for both the livecd and MediaWriter, so the USB drives should look the same. They don't.

squimrel commented 7 years ago
fdisk -l Fedora-Workstation-Live-x86_64-26-1.5.iso
bobgus commented 7 years ago

[user1@hoho8 Downloads]$ fdisk -l Fedora-Workstation-Live-x86_64-26-1.5.iso Disk Fedora-Workstation-Live-x86_64-26-1.5.iso: 1.5 GiB, 1563426816 bytes, 3053568 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x0975cb23

Device Boot Start End Sectors Size Id Type Fedora-Workstation-Live-x86_64-26-1.5.iso1 * 0 3053567 3053568 1.5G 0 Empt Fedora-Workstation-Live-x86_64-26-1.5.iso2 104772 117775 13004 6.4M ef EFI Fedora-Workstation-Live-x86_64-26-1.5.iso3 117776 145855 28080 13.7M 0 Empt [user1@hoho8 Downloads]$

squimrel commented 7 years ago

I didn't mean that you should post the output o_O. But anyway as you can see it has exactly the same partition table as the drive you've created using the FMW so it's all good. If you got any further questions simply re-read what I wrote on this issue.

bobgus commented 7 years ago

I think I will use the livecd-iso-to-disk application. It creates a bootable USB (with UEFI) which I have tested on my host system.

I still need to do some research on my apu2 re UEFI

MartinBriza commented 7 years ago

The partition layout is different because livecd-iso-to-disk formats the drive to a single partition and then copies all the files from the ISO file, modifying the MBR accordingly itself. FMW, on the other hand, takes the ISO file as it is and copies it to the drive bit-by-bit. The ISO is formatted in a special way that's treated as a three-partition layout by Linux systems. There's nothing wrong about it, it's just a different approach to the problem.

grulja commented 3 years ago

Doesn't look like an issue in FMW.