jpz4085 / ms-sys

Program for writing Microsoft compatible and other boot records. Linux, BSD and Mac supported.
GNU General Public License v2.0
5 stars 2 forks source link

using ms-sys with legacy boot windows #2

Closed calngu closed 2 months ago

calngu commented 6 months ago

Hello,

I was able to successfully use your bcd-sys script to make a bootable drive after using wimapply to apply a windows 10 image. I would like to do the same with a Windows 10 legacy boot and use ms-sys to create the appropriate boot files.

Here are the steps I'm doing:

  1. Created a MBR disk with two partitions; Windows and System.
  2. use wimapply to write an image to the block device of the windows partition.

After this I'm a little lost on what to do, i've tried running ms-sys with different flag options but can't seem to make the drive bootable. Any thoughts or if you can point me in the right direction? Thanks for your time!

jpz4085 commented 6 months ago

Hello,

I was able to successfully use your bcd-sys script to make a bootable drive after using wimapply to apply a windows 10 image. I would like to do the same with a Windows 10 legacy boot and use ms-sys to create the appropriate boot files.

Here are the steps I'm doing:

  1. Created a MBR disk with two partitions; Windows and System.
  2. use wimapply to write an image to the block device of the windows partition.

After this I'm a little lost on what to do, i've tried running ms-sys with different flag options but can't seem to make the drive bootable. Any thoughts or if you can point me in the right direction? Thanks for your time!

After the first two steps above, legacy boot should be enabled as follows: (Adjust examples for correct block device.)

  1. Unmount any partitions on the target disk.
  2. Make sure the system partition (with the WBM files) is set as active using fdisk.
  3. Write a Windows MBR to the block device of the target disk as shown below. sudo ms-sys -7 /dev/sdc
  4. Write a Windows PBR to the block device of the system partition appropriate for the file system. FAT32: sudo ms-sys -8 /dev/sdc1 or NTFS: sudo ms-sys -n /dev/sdc1
  5. Boot from the target disk in legacy BIOS/CSM mode.
calngu commented 6 months ago

root@devcal:/home/calvin/mssys/ms-sys-2.8.0# sudo ms-sys -7 /dev/sdl Windows 7 master boot record successfully written to /dev/sdl root@devcal:/home/calvin/mssys/ms-sys-2.8.0# sudo ms-sys -n /dev/sdl1 NTFS Windows 7 boot record successfully written to /dev/sdl1 root@devcal:/home/calvin/mssys/ms-sys-2.8.0#

I ran the commands you mentioned successfully however when I try to boot I get the message '"BOOTMGR" is missing'

thoughts?

jpz4085 commented 6 months ago

root@devcal:/home/calvin/mssys/ms-sys-2.8.0# sudo ms-sys -7 /dev/sdl Windows 7 master boot record successfully written to /dev/sdl root@devcal:/home/calvin/mssys/ms-sys-2.8.0# sudo ms-sys -n /dev/sdl1 NTFS Windows 7 boot record successfully written to /dev/sdl1 root@devcal:/home/calvin/mssys/ms-sys-2.8.0#

That all looks good.

I ran the commands you mentioned successfully however when I try to boot I get the message '"BOOTMGR" is missing'

thoughts?

Seems like the WBM files are missing. Did you run bcd-sys after the steps above? Some examples:

Windows and System partitions on the same disk: bcd-sys -f bios /media/user/windows System partition on different disk or no (UEFI) firmware entry: bcd-sys -f bios /media/user/windows -s /media/user/system

I assumed this step in my previous response but maybe should have been explicit.

calngu commented 6 months ago

root@devcal:/home/calvin/bcd-sys# ./bcd-sys.sh -f BIOS /mnt/windows Checking block devices for active partition (sudo required)... Unable to find the BIOS boot files at /mnt/windows root@devcal:/home/calvin/bcd-sys# ls -l /mnt/windows total 240673 drwxrwxrwx 1 root root 0 Aug 30 2023 '$Recycle.Bin' drwxrwxrwx 1 root root 0 Oct 29 2020 BIXOLON drwxrwxrwx 1 root root 4096 Aug 16 2021 boot -rwxrwxrwx 1 root root 384322 Jul 16 2016 bootmgr -rwxrwxrwx 1 root root 1 Jul 16 2016 BOOTNXT -rwxrwxrwx 1 root root 8192 Oct 14 2021 Devices.exe lrwxrwxrwx 2 root root 18 Feb 14 2018 'Documents and Settings' -> /mnt/windows/Users drwxrwxrwx 1 root root 4096 Aug 30 2023 IBT -rwxrwxrwx 2 root root 2924 Aug 30 2023 ImageInfo.txt -rwxrwxrwx 1 root root 1673 Aug 12 2021 info.xml drwxrwxrwx 1 root root 0 Feb 8 2018 Intel drwxrwxrwx 1 root root 0 Aug 12 2021 Languages -rwxrwxrwx 2 root root 225 Aug 12 2021 linearize.bat -rwxrwxrwx 2 root root 977 Aug 12 2021 LinearizeTouchScreen.ahk -rwxrwxrwx 2 root root 826368 Aug 12 2021 LinearizeTouchScreen.exe -rwxrwxrwx 1 root root 2596864 Aug 12 2021 MT7SDU.EXE drwxrwxrwx 1 root root 12288 Aug 11 2021 p15xx drwxrwxrwx 1 root root 4096 Aug 30 2023 Pangaea -rwxrwxrwx 2 root root 12800 Sep 16 2020 PangaeaClientUpdate.exe drwxrwxrwx 1 root root 0 Jul 16 2016 PerfLogs -rwxrwxrwx 1 root root 1740 Aug 12 2021 prints.bin drwxrwxrwx 1 root root 4096 Feb 16 2022 ProgramData drwxrwxrwx 1 root root 8192 Feb 16 2022 'Program Files' drwxrwxrwx 1 root root 8192 Feb 16 2022 'Program Files (x86)' -rwxrwxrwx 2 root root 187392 Apr 11 2022 RadPCAccess.exe drwxrwxrwx 1 root root 0 Feb 14 2018 Recovery -rwxrwxrwx 2 root root 239954720 Sep 22 2021 'Retail Platform Software for Windows_5360.exe' drwxrwxrwx 1 root root 4096 Oct 29 2020 Users -rwxrwxrwx 2 root root 2374656 Apr 11 2022 VideoPanelTestNet.exe drwxrwxrwx 1 root root 28672 Aug 30 2023 Windows root@devcal:/home/calvin/bcd-sys#

I'm getting an error trying to run bcdsys after running the two ms-sys commands.

jpz4085 commented 6 months ago

root@devcal:/home/calvin/bcd-sys# ./bcd-sys.sh -f BIOS /mnt/windows Checking block devices for active partition (sudo required)... Unable to find the BIOS boot files at /mnt/windows

Seems as if the WBM files for BIOS are missing. They should be located at "/mnt/windows/Windows/Boot/PCAT". There should be a collection of language folders followed by boomgr, bootnxt, bootuwf.dll, bootvhd.dll and memtest.exe at that location. Check to see if everything is still there. You may need to replace missing files from the Windows install media.

drwxrwxrwx 1 root root 4096 Aug 16 2021 boot -rwxrwxrwx 1 root root 384322 Jul 16 2016 bootmgr -rwxrwxrwx 1 root root 1 Jul 16 2016 BOOTNXT

However it looks as if the BIOS boot files are currently on the root of the Windows partition for some reason. Perhaps this was caused by a previous attempt :confused: and they could be moved back to the location described above and you can run the script again. That's as much as I can suggest at this point.