Jump to content











Photo
- - - - -

Grub4dos as makeboot.bat?


  • Please log in to reply
3 replies to this topic

#1 Manolenta

Manolenta

    Newbie

  • Members
  • 10 posts
  •  
    Spain

Posted 26 January 2015 - 04:24 PM

Hi.

 

I am searching for an option to make an automated install using dos menus from a bat file. is it possible? I have been searching and trying but I can't find any guide to learn to do that. And all my tries with grubinstall.exe from a dos window fails...

 

In lot of Linux distros, there is a file named "makeboot.bat" or "makeboot.sh" to automate the process. This file helps the user (maybe a no expert user) to install syslinux in a pendrive. Here is the code (makeboot.bat):

@echo off
rem This batch file was modified by Steven Shiau.
rem The original one is from PDLA http://pendrivelinux.com
rem This batch file was created by ©2007 PDLA http://pendrivelinux.com
cd /d "%~dp0"
cls
echo -----------------------------------------------------------------
echo This batch file will prepare drive %~d0 for boot using syslinux!
echo -----------------------------------------------------------------
echo.
echo.
echo --------------------- WARNING!: ---------------------------------
echo.
echo Run this file from your portable USB device ONLY.
echo Running this file from your hard drive may overwrite your current
echo Master Boot Record (MBR) and render your Windows Operating System
echo un-bootable. YOU HAVE BEEN WARNED!
echo.
echo This batch file is offered in hopes that it will be useful and
echo comes with absolutely no warranty. USE AT YOUR OWN RISK!
echo.
echo -----------------------------------------------------------------
echo.
echo %~d0 | "%windir%\system32\findstr.exe" /B /I "%systemdrive%" && echo You can _NOT_ RUN makeboot.bat from your local system hard drive! It should only be run from your USB flash drive or USB hard drive. && goto end
echo.
echo Press any key to make drive %~d0 bootable
echo or close this window to abort...
pause > nul
cls

syslinux64.exe -d syslinux -mafi %~d0
echo.
echo ~~~~~~~~ Congratulations ~~~~~~~
echo.
echo The hidden file ldlinux.sys has been installed
echo Your %~d0 drive should now be bootable.
echo //NOTE// If your USB flash drive fails to boot (maybe buggy BIOS), try to use "syslinux64 -d syslinux -sfmar %~d0".
echo.
echo.
:end
cd /d %systemdrive%
echo Press any key to exit this window!
pause > nul


Thanks!



#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 January 2015 - 08:16 AM

Which is good since you shouldn't really use grubinstall.exe, but rather bootlace.com (if you want to install (BTW WHY "installing") the grub4dos grldr.mbr).

And the batch you posted, just so you know is NOT a DOS batch (i.e. a batch for the command interpreter COMMAND.COM) , it is a batch for the CMD.EXE command processor in NT based systems.

 

Bootlace.com is included in the grub4dos download and it is usage is covered in README_GRUB4DOS.txt

 

BUT you can well bypass even bootlace.com and use instead *any* form of dd or similar, see here:

http://reboot.pro/to...dows-and-linux/

http://reboot.pro/to...linux/?p=189578

 

:duff:

Wonko



#3 Manolenta

Manolenta

    Newbie

  • Members
  • 10 posts
  •  
    Spain

Posted 27 January 2015 - 01:03 PM

Ok! Thanks for the help. I will try to learn more about that.



#4 Manolenta

Manolenta

    Newbie

  • Members
  • 10 posts
  •  
    Spain

Posted 28 January 2015 - 11:54 AM

Hi, I am trying that grubinst version from the pendrive I want to use grub4dos, with the command:

 

grubinst.exe --read-only --file-system-type=MBR --verbose --mbr-disable-floppy --skip-mbr-test --time-out=0 %~d0.

 

I get this message:

Start sector: 0x0
Image type: MBR
Num of heads: 0
Sectors per track: 0
Partition table
  bt  h0  s0  c0  fs  h1  s1  c1      base      leng
  0A  50  72  65  73  2E  20  75  7420616E  616C6365
  20  70  61  72  61  20  72  65  63696E69   D726169
  0A  00  00  00  00  00  00  00         0         0
  00  00  00  00  00  00  00  00   1AC0000       1BD
Install mode
grubinst: Write error

If I try the GUI, nothing happens. If I use the "test" mode in the GUI it shows me:

 

Starting "grubinst.exe --read-only --file-system-type=MBR --verbose --mbr-disable-floppy --skip-mbr-test --time-out=0 (hd2)"...

 

Start sector: 0x0
Image type: MBR
Num of heads: 0
Sectors per track: 0
Partition table
  bt  h0  s0  c0  fs  h1  s1  c1      base      leng
  0A  50  72  65  73  2E  20  75  7420616E  616C6365
  20  70  61  72  61  20  72  65  63696E69   D726169
  0A  00  00  00  00  00  00  00         0         0
  00  00  00  00  00  00  00  00   1AC0000       1BD
Install mode
Read only mode
The Grub4Dos MBR/BS can be successfully installed

If I try the command "grubinst.exe --verbose --skip-mbr-test %~d0" with the grubinst.exe from the RMPrepUSB tool, I get this message

grubinst: open: Permission denied

Any idea to advance on this? It feels like I have to unmount the pendrive or something like that, but I want to use the tool from Windows...

 

Thanks!


Edited by Manolenta, 28 January 2015 - 11:56 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users