Jump to content











Photo
- - - - -

Using bootlace and installing to PBR


  • Please log in to reply
21 replies to this topic

#1 xpt

xpt

    Frequent Member

  • Advanced user
  • 138 posts
  •  
    Canada

Posted 28 July 2019 - 07:44 PM

Has anyone been able to use bootlace to install GRLDR to PBR?

 

BOOTLACE can write GRLDR boot record to PBR as well as MBR, right?

 

However, this is what I got:

% bootlace64.com /dev/sdd2
Error: Invalid partition table. Must specify --floppy explicitly for floppy.
what could be wrong? 
PBR wouldn't contain partition table but MBR does, right? 
 

thx

$ lsb_release -a 
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic


#2 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 29 July 2019 - 12:56 PM

Read the README file first.

 

The Error message means /dev/sdd2 is not an MBR device. It is just a volume, like a traditional floppy.

 

Add a --floppy parameter and other required parameters, and try again. 

 

 

BOOTLACE can write GRLDR boot record to PBR as well as MBR, right?

 

Yes and no.

 

The original BOOTLACE (in grub4dos 0.4.5c) does not support writing directly to PBR of a device.

 

Yaya's BOOTLACE in grub4dos 0.4.6a has support for writing to PBR directly.



#3 xpt

xpt

    Frequent Member

  • Advanced user
  • 138 posts
  •  
    Canada

Posted 30 July 2019 - 02:55 AM

Thanks tinybit. 

 

Is it `--floppy` or `--floppy=N` that I should use? 

 

  • --floppy if DEVICE_OR_FILE is floppy, use this option.      
  • --floppy=N if DEVICE_OR_FILE is a partition on a hard   drive, use this option. N is used to specify   the partition number: 0,1,2 and 3 for the   primary partitions, and 4,5,6,... for the   logical partitions.


#4 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 30 July 2019 - 08:48 AM

 

Thanks tinybit. 

 

Is it `--floppy` or `--floppy=N` that I should use? 

 

The second you said, since it is actually a volume on a partitioned device.

 

I would say that the "=N" fits the definition of "Add a --floppy parameter and other required parameters" ;)

 

Please remember to double check partition numbering, they are different in grub4dos and Linux.

 

:duff:

Wonko



#5 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 30 July 2019 - 12:49 PM

******************************************************************************
***           Use bootlace.com to install partition boot record            ***
******************************************************************************

Method 1:

Step 1. Get the boot sectors of the partition and save to a file MYPART.TMP.
	For EXT2/3/4 partition, you need to get the start of the three sectors, 
	for other types of file systems, you only need to obtain a sector.

Step 2. Under DOS, Windows, these commands are executed:
	bootlace.com --floppy= MYPART.TMP

Step 3. Put MYPART.TMP back on to the boot sector(s) of your original partition
	(hdX,Y).

Method 2:
	Executed under DOS command:
	bootlace.com --install-partition=I K

	I is the partition number (0,1,2,3,4, ...), K is the drive letter (0x80, 0x81, ...).
	Implementation will show the simple disk information and regional capacity, 
	and are prompted to press "y" key to continue, press the other key to exit.

Installing GRLDR boot code to PBR under Linux:
	bootlace.com --floppy /dev/sda1
	
Note: Only a few file systems(FAT12/16/32/NTFS/ext2/ext3/ext4/exfat) are supported by now.

Note: grubinst has the feature of installing grldr boot code onto a
	partition boot area.
        

******************************************************************************
***        bootlace.com - Install GRLDR.MBR bootstrap code to MBR          ***
******************************************************************************

BOOTLACE.COM installs GRLDR.MBR boot record to the MBR of a harddrive or of a
harddrive image file, or to the boot sector of a floppy or a floppy image.

Usage:

	bootlace.com  [OPTIONS]  DEVICE_OR_FILE

OPTIONS:

	--read-only		do everything except the actual write to the
				specified DEVICE_OR_FILE.

	--restore-mbr		restore the previous mbr.

	--mbr-no-bpb		do not copy BPB in the boot sector of the
				leading FAT partition to MBR.

	--no-backup-mbr		do not copy the old MBR to the second sector of
				DEVICE_OR_FILE.

	--force-backup-mbr	force the copy of old MBR to the second sector
				of DEVICE_OR_FILE.

	--mbr-enable-floppy	enable the search for GRLDR on floppy.

	--mbr-disable-floppy	disable the search for GRLDR on floppy.

	--mbr-enable-osbr	enable the boot of PREVIOUS MBR with invalid
				partition table(usually an OS boot sector).

	--mbr-disable-osbr	disable the boot of PREVIOUS MBR with invalid
				partition table(usually an OS boot sector).

	--duce			disable the feature of unconditional entrance
	                        to the command-line.

				Normally one can unconditionally get the
				command-line console by a keypress of `C',
				bypassing all config-files(including the
				preset-menu). This is a security hole. So we
				need this option to disable the feature.

				DUCE is for Disable Unconditional Command-line
				Entrance.

	--chs-no-tune		disable the feature of geometry tune.

	--boot-prevmbr-first	try to boot PREVIOUS MBR before the search for
				GRLDR.

	--boot-prevmbr-last	try to boot PREVIOUS MBR after the search for
				GRLDR.

	--preferred-drive=D	preferred boot drive number, 0 <= D < 255.

	--preferred-partition=P	preferred partition number, 0 <= P < 255.

	--serial-number=SN	setup a new serial number for the hard drive.
				SN must be non-zero.

	--time-out=T		wait T seconds before booting PREVIOUS MBR. if
				T is 0xff, wait forever. The default is 5.
	
	--hot-key=K		if the desired key K is pressed, start GRUB
				before booting PREVIOUS MBR. K is a word
				value, just as the value in AX register
				returned from int16/AH=1. The high byte is the
				scan code and the low byte is ASCII code. The
				default is 0x3920 for space bar. See "int 16
				keyboard scan codes" below.

	--floppy		if DEVICE_OR_FILE is floppy, use this option.

	--floppy=N		if DEVICE_OR_FILE is a partition on a hard
				drive, use this option. N is used to specify
				the partition number: 0,1,2 and 3 for the
				primary partitions, and 4,5,6,... for the
				logical partitions.

	--sectors-per-track=S	specifies sectors per track for --floppy.
				1 <= S <= 63, default is 63.

	--heads=H		specifies number of heads for --floppy.
				1 <= H <= 256, default is 255.

	--start-sector=B	specifies hidden sectors for --floppy=N.

	--total-sectors=C	specifies total sectors for --floppy.
				default is 0.

	--install-partition=I	Install the boot record onto the boot area of
				partition number I of the specified hard drive
				or harddrive image DEVICE_OR_FILE.
				
	--gpt  Install the grldr.mbr to the GPT partition type device.

DEVICE_OR_FILE:	Filename of the device or the image file. For DOS, a BIOS drive
number(hex 0xHH or decimal DDD) can be used to access the drive. BIOS drive
number 0 is for the first floppy, 1 is for the second floppy; 0x80 is for the
first hard drive, 0x81 is for the second hard drive, etc.

Note: BOOTLACE.COM writes only the boot code to MBR. The boot code needs to
load GRLDR as the second(and last) stage of the GRUB boot process. Therefore
GRLDR should be copied to the root directory of one of the supported
partitions, either before or after a successful execution of BOOTLACE.COM.
Currently only partitions with filesystem type of FAT12, FAT16, FAT32, NTFS,
EXT2, EXT3, EXT4 or EXFAT are supported.

Note 2: If DEVICE_OR_FILE is a harddisk device or a harddisk image file, it
must contain a valid partition table, otherwise, BOOTLACE.COM will fail. If
DEVICE_OR_FILE is a floppy device or a floppy image file, then it must contain
a supported filesystem(i.e., either of FAT12/FAT16/FAT32/NTFS/EXT2/EXT3/EXT4/EXFAT).

Note 3: If DEVICE_OR_FILE is a floppy device or a floppy image file, and it
was formated EXT2/3/4, then you should specify --sectors-per-track and
--heads explicitly.
Update: You can not specify.

Important!! If you install GRLDR Boot Record to a floppy or a partition, the
floppy or partition will boot solely grldr, and your original
IO.SYS(DOS/Win9x/Me) and NTLDR(WinNT/2K/XP) will become unbootable. This is
because the original boot record of the floppy or partition was overwritten.
There is no such problem when installing GRLDR Boot Record onto the MBR.
Update: Some NTLDR/IO.SYS/KERNEL.SYS files can be directly chainloaded in the
latest GRUB4DOS.

Tip: If the filename begins in a dash(-) or a digit, you may prefix a dirname
(./) or (.\) to it.

Examples:

	Installing GRLDR boot code to MBR under Linux:

		bootlace.com  /dev/sda

	Installing GRLDR boot code to MBR under DOS:

		bootlace.com  0x80

	Installing GRLDR boot code to a harddisk image under DOS, Windows or Linux:

		bootlace.com  hd.img

	Installing GRLDR boot code to floppy under Linux:

		bootlace.com  --floppy /dev/fd0

	Installing GRLDR boot code to floppy under DOS:

		bootlace.com  --floppy 0x00

	Installing GRLDR boot code to a floppy image under DOS, Windows or Linux:

		bootlace.com  --floppy floppy.img

BOOTLACE.COM cannot function well under Windows NT/2000/XP/2003. It is expected
(and designed) to run under DOS/Win9x and Linux. Update: For image FILES,
bootlace.com function well under Windows NT/2000/XP/2003. For devices,
bootlace.com will not work under Windows NT/2000/XP/2003 because bootlace.com
is a DOS utility and Windows NT/2000/XP/2003 does not allow bootlace.com to
access devices.

------------------------------------------------------------------------------

 

It is from 0.4.6a README.  Should you have any questions, contact the developer Yaya.


  • xpt likes this

#6 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 30 July 2019 - 01:27 PM

By contrast, the below sections are from 0.4.5c README:

----------------------------------------------------------------------------------

                      

******************************************************************************
***           Use bootlace.com to install partition boot record            ***
******************************************************************************

Since bootlace.com has not implemented the --install-partition option, you
need to use the already implemented --floppy=PartitionNumber option instead.

Hear is a way you might want to follow:

Step 1. Get the boot sectors of the partition and save to a file MYPART.TMP.
	For NTFS, you need to get the beginning 16 sectors. For other type of
	filesystems, you only need to get one sector, but getting more sectors
	is also ok.

Step 2. Run this:

	bootlace.com --floppy=Y --sectors-per-track=S --heads=H --start-sector=B --total-sectors=C --vfat --ext2 --ntfs MYPART.TMP

	where we suppose MYPART.TMP is for (hdX,Y) and the partition number Y
	should be specified as in the --floppy=Y option.

	Note that for FAT12/16/32/NTFS partitions, you can omit these options:

		 --sectors-per-track, --heads, --start-sector, --total-sectors,
		 --vfat and --ext2.

	For NTFS partitions, you must specify --ntfs option.

	For ext2 partitions, you can omit --vfat, --ntfs and --ext2 options,
	but other options should be specified.

Step 3. Put MYPART.TMP back on to the boot sector(s) of your original partition
	(hdX,Y).


Note: Only a few file systems(FAT12/16/32/NTFS/ext2/ext3) are supported by now.

Note2: Under Linux you may directly write the partition. That is to say, Step
	1 and Step 3 are not needed. Simply use its device name instead of
	MYPART.TMP.

Note3: grubinst has the feature of installing grldr boot code onto a
	partition boot area.
                            
******************************************************************************
***        bootlace.com - Install GRLDR.MBR bootstrap code to MBR          ***
******************************************************************************

BOOTLACE.COM installs GRLDR.MBR boot record to the MBR of a harddrive or of a
harddrive image file, or to the boot sector of a floppy or a floppy image.

Usage:

	bootlace.com  [OPTIONS]  DEVICE_OR_FILE

OPTIONS:

	--read-only		do everything except the actual write to the
				specified DEVICE_OR_FILE.

	--restore-mbr		restore the previous mbr.

	--mbr-no-bpb		do not copy BPB in the boot sector of the
				leading FAT partition to MBR.

	--no-backup-mbr		do not copy the old MBR to the second sector of
				DEVICE_OR_FILE.

	--force-backup-mbr	force the copy of old MBR to the second sector
				of DEVICE_OR_FILE.

	--mbr-enable-floppy	enable the search for GRLDR on floppy.

	--mbr-disable-floppy	disable the search for GRLDR on floppy.

	--mbr-enable-osbr	enable the boot of PREVIOUS MBR with invalid
				partition table(usually an OS boot sector).

	--mbr-disable-osbr	disable the boot of PREVIOUS MBR with invalid
				partition table(usually an OS boot sector).

	--duce			disable the feature of unconditional entrance
	                        to the command-line.

				Normally one can unconditionally get the
				command-line console by a keypress of `C',
				bypassing all config-files(including the
				preset-menu). This is a security hole. So we
				need this option to disable the feature.

				DUCE is for Disable Unconditional Command-line
				Entrance.

	--chs-no-tune		disable the feature of geometry tune.

	--boot-prevmbr-first	try to boot PREVIOUS MBR before the search for
				GRLDR.

	--boot-prevmbr-last	try to boot PREVIOUS MBR after the search for
				GRLDR.

	--preferred-drive=D	preferred boot drive number, 0 <= D < 255.

	--preferred-partition=P	preferred partition number, 0 <= P < 255.

	--serial-number=SN	setup a new serial number for the hard drive.
				SN must be non-zero.

	--time-out=T		wait T seconds before booting PREVIOUS MBR. if
				T is 0xff, wait forever. The default is 5.
	
	--hot-key=K		if the desired key K is pressed, start GRUB
				before booting PREVIOUS MBR. K is a word
				value, just as the value in AX register
				returned from int16/AH=1. The high byte is the
				scan code and the low byte is ASCII code. The
				default is 0x3920 for space bar. See "int 16
				keyboard scan codes" below.

	--floppy		if DEVICE_OR_FILE is floppy, use this option.

	--floppy=N		if DEVICE_OR_FILE is a partition on a hard
				drive, use this option. N is used to specify
				the partition number: 0,1,2 and 3 for the
				primary partitions, and 4,5,6,... for the
				logical partitions.

	--sectors-per-track=S	specifies sectors per track for --floppy.
				1 <= S <= 63, default is 63.

	--heads=H		specifies number of heads for --floppy.
				1 <= H <= 256, default is 255.

	--start-sector=B	specifies hidden sectors for --floppy=N.

	--total-sectors=C	specifies total sectors for --floppy.
				default is 0.

	--lba			use lba mode for --floppy. If the floppy BIOS
				has LBA support, you can specify --lba here.
				It is assumed that all floppy BIOSes have CHS
				support. So you would rather specify --chs.
				If neither --chs nor --lba is specified, then
				the LBA indicator(i.e., the third byte of the
				boot sector) will not be touched.

	--chs			use chs mode for --floppy. You should specify
				--chs if the floppy BIOS does not support LBA.
				We assume all floppy BIOSes have CHS support.
				So it is likely you want to specify --chs.
				If neither --chs nor --lba is specified, then
				the LBA indicator(i.e., the third byte of the
				boot sector) will not be touched.

	--fat12			FAT12 is allowed to be installed for --floppy.

	--fat16			FAT16 is allowed to be installed for --floppy.

	--fat32			FAT32 is allowed to be installed for --floppy.

	--vfat			FAT12/16/32 are allowed to be installed for
				--floppy.

	--ntfs			NTFS is allowed to be installed for --floppy.

	--ext2			EXT2 is allowed to be installed for --floppy.

	--install-partition=I	Install the boot record onto the boot area of
				partition number I of the specified hard drive
				or harddrive image DEVICE_OR_FILE.

DEVICE_OR_FILE:	Filename of the device or the image file. For DOS, a BIOS drive
number(hex 0xHH or decimal DDD) can be used to access the drive. BIOS drive
number 0 is for the first floppy, 1 is for the second floppy; 0x80 is for the
first hard drive, 0x81 is for the second hard drive, etc.

Note: BOOTLACE.COM writes only the boot code to MBR. The boot code needs to
load GRLDR as the second(and last) stage of the GRUB boot process. Therefore
GRLDR should be copied to the root directory of one of the supported
partitions, either before or after a successful execution of BOOTLACE.COM.
Currently only partitions with filesystem type of FAT12, FAT16, FAT32, NTFS,
EXT2 or EXT3 are supported.

Note 2: If DEVICE_OR_FILE is a harddisk device or a harddisk image file, it
must contain a valid partition table, otherwise, BOOTLACE.COM will fail. If
DEVICE_OR_FILE is a floppy device or a floppy image file, then it must contain
a supported filesystem(i.e., either of FAT12/FAT16/FAT32/NTFS/EXT2/EXT3).

Note 3: If DEVICE_OR_FILE is a floppy device or a floppy image file, and it
was formated EXT2/EXT3, then you should specify --sectors-per-track and
--heads explicitly.


Important!! If you install GRLDR Boot Record to a floppy or a partition, the
floppy or partition will boot solely grldr, and your original
IO.SYS(DOS/Win9x/Me) and NTLDR(WinNT/2K/XP) will become unbootable. This is
because the original boot record of the floppy or partition was overwritten.
There is no such problem when installing GRLDR Boot Record onto the MBR.
Update: Some NTLDR/IO.SYS/KERNEL.SYS files can be directly chainloaded in the
latest GRUB4DOS.

Tip: If the filename begins in a dash(-) or a digit, you may prefix a dirname
(./) or (.\) to it.

Examples:

	Installing GRLDR boot code to MBR under Linux:

		bootlace.com  /dev/hda

	Installing GRLDR boot code to MBR under DOS:

		bootlace.com  0x80

	Installing GRLDR boot code to a harddisk image under DOS or Linux:

		bootlace.com  hd.img

	Installing GRLDR boot code to floppy under Linux:

		bootlace.com  --floppy --chs /dev/fd0

	Installing GRLDR boot code to floppy under DOS:

		bootlace.com  --floppy --chs 0x00

	Installing GRLDR boot code to a floppy image under DOS or Linux:

		bootlace.com  --floppy --chs floppy.img

BOOTLACE.COM cannot function well under Windows NT/2000/XP/2003. It is expected
(and designed) to run under DOS/Win9x and Linux. Update: For image FILES,
bootlace.com function well under Windows NT/2000/XP/2003. For devices,
bootlace.com will not work under Windows NT/2000/XP/2003 because bootlace.com
is a DOS utility and Windows NT/2000/XP/2003 does not allow bootlace.com to
access devices.


#7 xpt

xpt

    Frequent Member

  • Advanced user
  • 138 posts
  •  
    Canada

Posted 30 July 2019 - 11:47 PM

Thanks Tinybit, 

 

I've formed the habit of checking the latest document/readme online, but just realized that the doc that I've been checking

https://github.com/c...ME_GRUB4DOS.txt

is not latest but 0.4.5c

 

Oh, well. thx again. 



#8 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 31 July 2019 - 09:52 AM

Anyway, this is not clear (actually it is "wrong"):

 

Method 2:
Executed under DOS command:
bootlace.com --install-partition=I K

I is the partition number (0,1,2,3,4, ...), K is the drive letter (0x80, 0x81, ...).
Implementation will show the simple disk information and regional capacity,
and are prompted to press "y" key to continue, press the other key to exit.

 

0X80, 0x81 etc, are NOT "drive letters", but rather DOS DISK NUMBERS, 0x80 means first disk, same as it would be in grub noitation (hd0).

 

Why it is used this kind of notation, is another (marginal) question, if you want to install to what will always be referred to in grub4dos as - say - (hd0,0) you need to use --install-partition=0 0x80 :dubbio:

 

:duff:

Wonko



#9 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 31 July 2019 - 01:27 PM

Anyway, this is not clear (actually it is "wrong"):

 

0X80, 0x81 etc, are NOT "drive letters", but rather DOS DISK NUMBERS, 0x80 means first disk, same as it would be in grub noitation (hd0).

 

Why it is used this kind of notation, is another (marginal) question, if you want to install to what will always be referred to in grub4dos as - say - (hd0,0) you need to use --install-partition=0 0x80 :dubbio:

 

:duff:

Wonko

 

mmm...... I think the DOC was first written in Chinese and when translated into English there was some confusion (something went wrong), especially when it was translated by a machine.



#10 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 31 July 2019 - 02:08 PM

mmm...... I think the DOC was first written in Chinese and when translated into English there was some confusion (something went wrong), especially when it was translated by a machine.

Yep :) I perfectly understand how it could have happened, but I was going a bit further than the mistake in translation.

 

There is some (again understandable) "cruft" in the way the commands are implemented, due to the *need* to maintain (without an actual *need*) compatibility with earlier versions and the *need* (also without an actual *need*) to "keep" bootlace.com as the program, and having it work in Dos, Linux and Windows.

 

I mean, IF we *need* to keep the "general syntax" as:

bootlace.com [OPTIONS] DEVICE_OR_FILE

then it must be kept  and this:

bootlace.com --install-partition=I K

resulting in something *like*

bootlace.com --install-partition=1 0x80

makes no sense.

 

It would make more sense (to me at least) to get rid of the "--floppy" switch, replacing it with either --pbr or --vbr (Volume Boot Record), i.e.:to have a syntax like:

bootlace.com --pbr (hd0,1) 

or 

boolace.com --vbr (hd0,1)

and

bootlace.com --vbr (fd0)

 

Or let's forget about bootlace.com, and let's make two programs, let's say ginstallmbr and ginstallvbr, and let's make them run "natively" in grub4dos, unifying the syntax between Linux, DOS and Windows ....  :dubbio:

 

:duff:

Wonko



#11 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 31 July 2019 - 03:29 PM

To me...... I would rather go further......

 

grldr.mbr, as well as bootlace, should not be used any longer.

 

For harddrive MBR, a better solution is wee63.mbr.

 

If grldr boot record is installed on PBR(VBR), it requires that the caller (usually the MBR) (must) transfer the correct BIOS drive number to the CPU register DL. Why? Because the grldr's PBR code uses DL for the drive number, and the drive number field in the BPB is not used. No, no...... Actually it is used indeed, but it was first written to with the value of DL, before it was read from at a later time.

 

But, many MBRs did not transfer the correct DL to PBR (they hard coded a drive number, e.g., 0x80). I suppose only grldr.mbr could handle it properly. If the boot drive is the internal hard drive, everything is OK. If the boot drive is USB and the boot drive number is 0x00 (floppy), you will have trouble (with other MBRs than grldr.mbr).

 

So, if you want to use grub4dos's PBR code, you need grub4dos's MBR code. But, if grub4dos's MBR code (grldr.mbr) was installed, then the PBR code would not be used.

 

As stated just now, wee63.mbr is better than grldr.mbr for internal HDD MBR.

 

And for USB, a better solution (than grldr.mbr) is fbinst, which was developed by Bean. Another replacement, multimbr, is also good, and it was developed by me.

 

So I say, grldr.mbr and bootlace should not be used any more.

 

Note: In case someone is interested, my multimbr can be found here on a Chinese board:

 

http://bbs.wuyou.net...read&tid=320244

 

And I think I should also upload it here:

Attached Files



#12 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 31 July 2019 - 03:57 PM

To me...... I would rather go further......

 

grldr.mbr, as well as bootlace, should not be used any longer.

 

For harddrive MBR, a better solution is wee63.mbr.

 

If grldr boot record is installed on PBR(VBR), it requires that the caller (usually the MBR) (must) transfer the correct BIOS drive number to the CPU register DL. Why? Because the grldr's PBR code uses DL for the drive number, and the drive number field in the BPB is not used. No, no...... Actually it is used indeed, but it was first written to with the value of DL, before it was read from at a later time.

 

But, many MBRs did not transfer the correct DL to PBR (they hard code a drive number, e.g., 0x80). I suppose only grldr.mbr could handle it properly. If the boot drive is the internal hard drive, everything is OK. If the boot drive is USB and the boot drive number is 0x00 (floppy), you will have trouble (with other MBRs than grldr.mbr).

 

So, if you want to use grub4dos's PBR code, you need grub4dos's MBR code. But, if grub4dos's MBR code (grldr.mbr) was installed, then the PBR code would not be used.

 

As stated just now, wee63.mbr is better than grldr.mbr for internal HDD MBR.

 

And for USB, a better solution (than grldr.mbr) is fbinst, which was developed by Bean. Another replacement, multimbr,  is also good, and it was developed by me.

 

So I say, grldr.mbr and bootlace should not be used any more.

Well, allow me to disagree, both the grldr.mbr and the wee63.mbr are not (as I see it) viable in a number of cases (because they exceed the 1 sector size), but both are just fine on - say - USB sticks.

 

And I don't really get the issue, the grldr.mbr loads grldr, not a PBR/VBR so it makes little sense to have BOTH a grldr.mbr and a grldr PBR/VBR, which is instead useful in case for whatever reason you *need* a 1 sector MBR, and unless something has changed lately, the grub4dos PBR/VBR worked just fine, even with my half-@§§ed modified Syslinux/makebotfat MBR code (used to map an underfloppy, not mapped partition as floppy on a GPT disk).

 

Surely there are a number of cases where a "bad BIOS" will ruin the plans. :( but those should be the exception and not the rule :).

 

:duff:

Wonko



#13 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 31 July 2019 - 11:58 PM

Well, allow me to disagree, both the grldr.mbr and the wee63.mbr are not (as I see it) viable in a number of cases (because they exceed the 1 sector size), but both are just fine on - say - USB sticks.

 

And I don't really get the issue, the grldr.mbr loads grldr, not a PBR/VBR so it makes little sense to have BOTH a grldr.mbr and a grldr PBR/VBR, which is instead useful in case for whatever reason you *need* a 1 sector MBR, and unless something has changed lately, the grub4dos PBR/VBR worked just fine, even with my half-@§§ed modified Syslinux/makebotfat MBR code (used to map an underfloppy, not mapped partition as floppy on a GPT disk).

 

Surely there are a number of cases where a "bad BIOS" will ruin the plans. :( but those should be the exception and not the rule :).

 

:duff:

Wonko

 

I agree. You talked a lot of good sense.

 

Well, it just depends. If you never encounter those "rare" cases/problems, or you just don't mind, then, you don't need techniques like fbinst/multimbr. If you release your software to the masses, and you want to take those "rare" (actually not rare) cases into account, you have to use such techniques.

 

Note that fbinst/multimbr should be used only on USB-HDD, USB-FDD or USB-ZIP drives, not on internal HDD drives. The code (including data) of fbinst/multimbr is very large, and it occupies 8MB or more of space starting at the very beginning of the whole USB drive.



#14 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 01 August 2019 - 08:59 AM

Well, it just depends. If you never encounter those "rare" cases/problems, or you just don't mind, then, you don't need techniques like fbinst/multimbr. If you release your software to the masses, and you want to take those "rare" (actually not rare) cases into account, you have to use such techniques.

Yep, only for the record, I do have in operation a "strange" hardware, a Futro "terminal" S220/230 which is a strange beast, with a Transmeta :w00t: processor and "heaven-help-me" very crappy Insyde BIOS that - for *some* reasons boots (I should say booted, as I set it up in 2012 or so and never had to touch it again) *only* with the MS or the syslinux MBR but that wouldn't boot with the grub4dos grldr.mbr one (and also had some issues with PLoP).

 

I use it as a "router" with the (BTW very good) Zeroshell minidistro and it proved to be a very good choice (once I found the way to boot it, that is) it is now the second one (first one burned the PSU) and since I got them on e-bay, used for some 30 Euro each (+ a second el-cheapo network card, some 5 or 6 Euro)  it has been a very good investment, it churns away 24/7 consuming very little power and simply does what it is supposed to do :).

 

Since it is supposed to be working always I have a second one (third considering the burned one) ready besides it with a dd copy of the internal CF card on USB stick, so that if the "main" one has issues (it happened a couple of times, besides the burned PSU, with worn down CF card and with a "bad" update) I simply move the cables to its brother and I can troubleshoot the issue.

 

At the time I grew a few (more) white hairs looking for a way to have it boot (and reboot) reliably.

 

:duff:

Wonko



#15 Lex24

Lex24
  • Members
  • 4 posts
  •  
    Canada

Posted 16 December 2019 - 10:38 AM

 

Has anyone been able to use bootlace to install GRLDR to PBR? This is what I got:

% bootlace64.com /dev/sdd2
Error: Invalid partition table. Must specify --floppy explicitly for floppy.

Let me bump this thread, in case someone else is interested in writing the boot record to PBR. In case of a simple setup it's not really that complicated to get it working. The OP was apparently trying to use bootlace64.com. I only have experience with bootlace.com and have been using the following setup for about five years on a few older machines:

 

- Legacy BIOS boot mode

- Boot-US boot code in MBR

- Grub4Dos boot code in PBR of each primary partition

- Grub4Dos: v0.4.5c 2016-01-18 (older versions worked too)

- bootlace.com (not bootlace64.com)

- two hard disks, each one with three primary NTFS partitions

- multiple logical partitions, mostly Ext4

 

Here is the procedure:

 

- copy grldr and menu.lst to the root of the partition

- copy bootlace.com to any directory of your choice in Linux installed on any Ext4 partition

- from the Terminal in Linux cd to that directory and execute the following command:

# Hard Disk #1 Partition #3

sudo ./bootlace.com --floppy=2 --ntfs /dev/sda3

There will be a confirmation that the operation was successful:

 

https://imagizer.ima...9098/f76Dw7.png

 

Here are some more examples showing how to modify the command to install a boot record to PBR on different partitions:

sudo ./bootlace.com --floppy=0 --ntfs /dev/sda1
sudo ./bootlace.com --floppy=1 --ntfs /dev/sda2
sudo ./bootlace.com --floppy=2 --ntfs /dev/sda3
sudo ./bootlace.com --floppy=4 --ntfs /dev/sda5

sudo ./bootlace.com --floppy=0 --ntfs /dev/sdb1
sudo ./bootlace.com --floppy=1 --ntfs /dev/sdb2
sudo ./bootlace.com --floppy=2 --ntfs /dev/sdb3
sudo ./bootlace.com --floppy=4 --ntfs /dev/sdb5


Edited by Lex24, 16 December 2019 - 11:07 AM.


#16 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 16 December 2019 - 02:09 PM

is --floppy=n required?

I just use --floppy



#17 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 16 December 2019 - 06:47 PM

is --floppy=n required?

I just use --floppy

Under Linux, NO, you don't need to specify the partition number "=n"but you have to specify the actual partition/volume, like /sda1, /sda2, etc..  no idea if specifying the --ntfs or --fat32 etc. is actually *needed* or it is normally auto detected and specifying it is a way to "force" the PBR type :unsure:

 

From the readme tinybit posted:

 

 

Installing GRLDR boot code to PBR under Linux:
bootlace.com --floppy /dev/sda1

 

 

:duff:

Wonko



#18 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 17 December 2019 - 06:58 AM

is --floppy=n required?
I just use --floppy

Yes, required, at least for grub4dos 0.4.5c.

If you just use --floppy, it was for booting up a device without MBR (partition table). If the device has MBR (partition table), you should use --floppy=n where n is the partition number for that volume.

0.4.6's bootlace was greatly changed by yaya, and I am not sure if the "=n" is required for hard drive partitions.

#19 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 17 December 2019 - 08:42 AM

0.4.6's bootlace was greatly changed by yaya, and I am not sure if the "=n" is required for hard drive partitions.

 

@tinybit

You (not someone else) posted a readme for grub4dos 0.4.6 that I partly quoted.

 

You must make up your mind:

EITHER:

1) that grub4dos 0.4.6 explicit example I posted is accurate

OR:

2) it is not

 

tertium non datur:

https://en.wikipedia...excluded_middle

 

 

:duff:

Wonko



#20 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 17 December 2019 - 01:27 PM

None of the 0.4.6 examples is about PBR install. Only for floppy or floppy image file.

 

The 0.4.6 readme also has the --floppy=n parameter. So I guess the "=n" is required for PBR install, just the same case as 0.4.5.

 

The value of the partition number, n, is to be written to a BPB field, which was (newly) defined by grub4dos (not by MS). The field is a byte in width, and immediately follow the "drive number" field. See readme for boot sector layout.

 

p.s.

 

The above post by Lex24 mentioned "Grub4Dos: v0.4.5c 2016-01-18". So it is 0.4.5, not 0.4.6.



#21 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 18 December 2019 - 08:21 AM

None of the 0.4.6 examples is about PBR install. Only for floppy or floppy image file.

Read attentively Method 2 in the grubdos 0.4.6 readme you posted on post #5, (I bolded the relevant part for your convenience):

 

 

 

Method 2:
Executed under DOS command:
bootlace.com --install-partition=I K

I is the partition number (0,1,2,3,4, ...), K is the drive letter (0x80, 0x81, ...).
Implementation will show the simple disk information and regional capacity,
and are prompted to press "y" key to continue, press the other key to exit.

Installing GRLDR boot code to PBR under Linux:
bootlace.com --floppy /dev/sda1

 

Last time I had handy a Linux system /dev/sda1 was first partition of first hard disk. :dubbio:

 

As you say, surely it was needed for 0.4.5c, but seemingly it is not for 0.4.6.

 

:duff:

Wonko



#22 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 18 December 2019 - 10:33 AM

Read attentively Method 2 in the grubdos 0.4.6 readme you posted on post #5, (I bolded the relevant part for your convenience):

 

 

Last time I had handy a Linux system /dev/sda1 was first partition of first hard disk. :dubbio:

 

As you say, surely it was needed for 0.4.5c, but seemingly it is not for 0.4.6.

 

:duff:

Wonko

 

Sorry for my blindness.

 

So, I think yaya's bootlace in 0.4.6 might not use the special BPB field of "partition number", or, it could be a DOC bug? I am not sure.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users