Received: from list by lists.gnu.org with archive (Exim 4.71) id 1hPZBN-0000eu-M8 for mharc-grub-devel@gnu.org; Sat, 11 May 2019 17:05:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPWX5-0000G5-03 for grub-devel@gnu.org; Sat, 11 May 2019 14:15:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hPWX3-0003aO-FI for grub-devel@gnu.org; Sat, 11 May 2019 14:15:38 -0400 Received: from mout.gmx.net ([212.227.17.21]:44579) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hPWX3-0003S8-4e for grub-devel@gnu.org; Sat, 11 May 2019 14:15:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1557598533; bh=1pmoRA/0m9ZRci2akJJD9BXGQZnwdGqfZlgUedzDF6o=; h=X-UI-Sender-Class:To:References:Subject:From:Cc:Date; b=hEELLM0QCqh+nGXqPNqgLTVDJn375XGFBFi8NVtDyRKF4QTQ+V5obovJfx/Gv8VwD PAw8AoQkVHtUdNA5d1ZZSBG3GsKWSdcumlwJfx9P2gsr7wbqqL72WO3q7hUDE/XgOU cMG71U79WuqXUPvJGG2QvixwNINFNCDYfNqL00z4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.20] ([79.195.91.28]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MOwY7-1hJBg205bD-006QOq; Sat, 11 May 2019 20:15:33 +0200 To: grub-devel@gnu.org References: Subject: Re: grub-mkrescue: Problem with MBR partition table at start of EFI partition From: Michael Schierl Openpgp: preference=signencrypt Autocrypt: addr=schierlm@gmx.de; prefer-encrypt=mutual; keydata= mQGiBD5FNhkRBACbPnpXQBmZdmWyImwtyr/E6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Q+g6A/LA+EUTpS2kEwn2VJro0/O3pX1 upSH6VUO3SczA4k1nlQiXXC+je3Q/3s2Bu4mRwMedNihRqpfU9t1Zwvh8AxUkKbJPm0K8Iz/ 26ntKi7Xwhl3nZLcM4zM9tYIN98v4Kahh293jVAK+CiiIvXA8AyuRYo1oLx/ZPM7xtOQxDRk 3+YTP8iXQzIPTPCjbf0ofOoRUcI/yyYQjMy/bZagDXFOXoRKWe8ABam76y8uyRGgcxVy1qtp paNTS+duKWrPUNNZOQHRI+pCXUiu3ntnMmPcrOonT19ivTzYryWWEKA+GzOIsciC0fM+d1aI RgQYEQIABgUCPkU2JQAKCRAyEMbih0smPtmOAKCRfT25ZoF60HYfxPYqSD+Qk8wPuACfeXTg LU5PswaSe8gruboei0JpQSc= Cc: scdbackup@gmx.net, pelzflorian@pelzflorian.de Message-ID: Date: Sat, 11 May 2019 20:15:33 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:8WdgMqaOS3ysSIukDmaORkkSgnb3I/lEIZRGVL36vByOoF76sb0 xNVHlqoUUu3y/b8NgbyJ6uy0UDzjHhYYpoAXlp43/wNX2kqgxXdOAdg9RanLdWXM3bn98nz mH3nDUxYkAHRzeoa9oAqG9JKiYz4w3Yekvqjikn71sDv3NlDyAtnZd5rN9wxRxvLUViQ+sj fSA2oBZ95Paug3ylU5e1Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:KC0bnMqZw7Q=:cQCfZkQOkSGHgwyFd4tuMm NYzHvyHmlz8CxJgHQDGpCrS3up1oeva2UBnfIkaJ2yCWg58AHjkEjZu+IeD+eem6+XBKqQhMq PskN0bxf5sk3SwqDG5afquWNpPVzgBJ5OlZi1QYC98yUwmwyw2HyzhT8XQ1aZFfjAMFQx626+ wzMwvKULRPTCkbpTiJ2+NbQqZefUnoXfRHThFNl7VfndRuj1Kgqbwnzwx4vpd34TYQrphuXj+ D3uz5G4qnuMfW0ITz26K7gtEcdFw2YzguYSeAkyp8WLC+CFjX/U7W7Eg3aD9iq5DT3scbBXz0 RY2fKVqNW6509D6e88obS97dfhXHPVBHawU9N92sn7mndfsgLRdUuKOuwZPcOLA50VqtQg4Ws FPrlaCSx5+g+4J1U2vU43OWWdKsSRo2sxkYkCb27ck7014MgMzv0ppHrOnVoKP8jJHhWiXpkg PfvHSiN11Kwl06DetSxUedRBrWHOv6xDee2ZsQ3jI8I0vMVLleUDQKeW3CK0m6/2QQAWTBip3 jEjclY4WJfyWizfH7HRdG0VgEPei2aLumBF0TUIW2l8LLDarlvlwEHPoVceamxJoYkqKqc4On rWSIDw6P8v1dT2qDYImmKqXk0UDjp8zlmg8tVse9E78x1OAGtuKphcIYoEKc+WToEd1k1/nSS hrRgtU3H1cREqPUaqAvvThNNM8fiKnl6DErRGHsV8wFJEcs5ELfbLEcJGitzBHOF4pzJAMOgt JPlwjuYsM0pLR5FePu971OX/VU2SrYvRyqisNVGUFke7GzorpRuOW2CcctxqGnte4NFm0klOf vJB6GvjBY9HasE8usHsI4VIGV/ShaCBSJ4g3LPhYUzaHsD9lfo2bUqL8IDCQOJBtt8qT8v46q AV7XJtJBvhITp8uhwbAI3a9hanuCz+brqngBkLvSdK0KCvLDJMVozqUv1Vg32dUl1KUeuBiG1 sfhj0CMHt4Q== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.21 X-Mailman-Approved-At: Sat, 11 May 2019 17:05:24 -0400 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 18:15:40 -0000 [Please cc: me since I am not subscribed to that list] Hello, I know this is getting off-topic, but since I am surprised how many people here (have to) base their knowledge of booting Windows install media from rumors and "advertising", I decided to bring in my knowledge and personal experience about the Windows installer boot process. >> > This is not an install ISO but a USB install medium. The USB drive >> > was written by the Windows Media Creation Tool. Copying instead a >> > Windows ISO created by the Windows Media Creation Tool to a USB drive >> > does *not* yield a bootable USB drive; it does not even boot on other >> > computers. >> >> This would bring the MS-World back in sync with my understanding of UEF= I >> specs and other info sources. >> >> But there are substantial rumors that the ISO boots from USB stick. >> Microsoft is said to advertise it for DVD+R DL and USB stick. >> (I could not get my hands on ISO or advertising yet ...) Yes, any Windows install ISO starting from Windows Vista supports installation from a USB stick. However, that does *not* mean that you can use a tool like Unix's "dd" to write it to the drive and expect it to boot (of course you can try, but it won't boot; valid for all Windows up to latest Windows 10 Insider version). Instead, assuming that you already have some Windows machine, you can either use the Media Creation Tool to write the ISO to your USB, or you can use the command line utilities included in the ISO itself. On the other hand, in the Windows world this rarely causes any confusion since no Windows version I've encountered so far contains native tools to write an ISO (or any other image file) to a USB stick as Unix' "dd" command would. Starting from Vista you can natively write ISO files to optical media and since Windows 8 you can mount ISOs as a drive without burning them, but that "just dd it to a USB key" feature of isohybrid is mainly useful to people who already have some kind of Unix running. In case you ever run into the situation to create a USB key from an Windows install ISO file from another OS than Windows (and you want that media to boot both on UEFI and CSM), you'd have to resort to third-party tools like ms-sys that can replicate this installation process, or chainload the Windows boot loader from another bootloader that supports it (e.g. from Grub - to get this discussion back on-topic). Or if you already have such a USB stick of any other Windows version (since Vista), just mount it, delete all the files and copy all the files from inside the ISO to it. Another thing to keep in mind is that until (at least) Windows 7, the Disk Management GUI refused to change partitioning of external "removable" mass storage devices, so in case you ever "dd" a smaller ISO to a larger stick, you would have to resort to third-party software or the command-line "diskpart" command to regain your USB key's capacity back. That may be another reason that dd-able ISOhybrid files are mostly used for Linux installs (since Linux does not have that restriction) and not used for Windows install media. > I wonder how other people can get to the impression that their attempts > succeeded. (Will have to wait for somebody who is willing to go on with > experiments after perceived success.) They probably did not use "dd" in the first place to get their ISO to the USB stick. >> I will continue testing the Windows 10 USB install medium: >> /dev/sdb1 * 2048 15728639 15726592 7.5G c W95 FAT32 (LBA) > > That's not an EFI System Partition. > So i assume the USB stick boots by BIOS and x86 machine code in the MBR. > Unless we believe in EFI firmware that hops on arbitrary partitions ... I do not believe that EFI firmware hops on arbitrary partitions either. On the other hand, all 64-bit EFI firmware versions I encountered so far (to be honest, I believe all of them were "designed to run Windows"), do EFI boot from the *first* MBR-style partition of an *external* drive (e.g. USB), if the partition type is either 0x0B or 0x0C, the partition is marked bootable, and it contains a FAT32 filesystem with an /EFI/BOOT/BOOTX64.EFI file on it. I have encountered machines who do not boot it if only one of these conditions is unmet (different partition type, not marked bootable, not the first partition slot, or drive was attached internally via SATA). I do not know if this is specified anywhere, but if it did not work, people would complain quickly. My own multiboot USB key (which uses GRUB for chainloading multiple Linux ISOs via loopback.cfg) also uses that exact disk layout, and I never had any machine where it could not boot. (As it has a USB-OTG port, I can even load new ISOs to it from my smartphone). On the other hand, if I partitioned the USB stick in GPT mode and used an EFI System Partition as primary partition, Windows would not assign a drive letter to it when I attach it, and older OSes would not be able to read the stick at all. (I never heard that the Windows installer "broke an USB stick", but I heard it multiple times about Linux installers that used isohybrid. Getting rid of all partitions always "cured" the USB stick again, but many Windows users are unable to fix this themselves). And that is exactly what happens when you "write" a Windows Installer ISO to a USB key: It will create a MBR-style partition table with one "bootable" 0x0C entry spanning the entire device, formats it at FAT32 and copies all the files in the ISO to it. (In case install.wim is larger than 4GB and the media creation tool is recent enough, it will run SplitWim to create install.swm, install2.swm etc. from it and put those on the device instead). Afterwards bootsect.exe is executed, which writes a MBR and a partition boot record so that booting in legacy mode works (this is not required for booting in UEFI mode, but does not hurt either). So, while the ISO used a UDF filesystem, the USB stick will use a FAT32 filesystem, and since bootmgr can read both, installation will succeed in either case. > I do not know how to verify on Windows if the boot used UEFI. Shall I c= ontinue testing? On a booted (installed) Windows, the easiest way is running msinfo32.exe (which shows "BIOS Mode: UEFI" in case booted from UEFI, and won't show it in case it is booted in legacy mode). When you are in the installer (or any other Preinstallation Environment or Recovery Environment), you'd have to go to the registry editor (in case of a standard install media, press next to get to the second install screen, press Shift+F10 to open a command prompt, and run "regedit" from there) and check the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\PEFirmwareType It is 1 for Legacy mode and 2 for UEFI mode. Another option would be to either damage the bootx64.efi file or the MBR/PBR of the drive. Also there are two versions of the Boot Configuration Database; the Legacy one as \BOOT\BCD and the EFI one as \EFI\MICROSOFT\BOOT\BCD (this is used by dual-arch ISOs so that in BIOS mode you can choose if you want 32- or 64-bit, but in UEFI mode it will pick 64-bit automatically). If you delete/rename one of these, the boot manager will stop with an error instead of booting. Regards, Michael