Page 4 of 20

number of bytes

Posted: Mon 08 Nov 2010, 05:31
by shinobar
piratesmack wrote:Wee is a little difficult to install, so I wrote a script that makes it easier.
Great thanks. And have some question.

Code: Select all

# Read disk signature and partition table from MBR_DEV
# and write it to wee63.mbr:
dd if=$MBR_DEV bs=1 skip=439 count=72 2>/dev/null | \
	dd of=/tmp/wee63.mbr bs=1 seek=439 conv=notrunc 2>/dev/null

# Back up the sectors about to be overwritten, just in case:
dd if=$MBR_DEV of=/root/$(basename $MBR_DEV).63s bs=512 count=63 2>/dev/null

# Write wee MBR to $MBR_DEV
dd if=/tmp/wee63.mbr of=$MBR_DEV 2>/dev/null
  1. Why we need to copy the disk signature and partition table?
    Doesn't the next work?

    Code: Select all

    dd if=/tmp/wee63.mbr of=$MBR_DEV bs=446 count=1
  2. What does the number 439(or 440 bytes) mean? Why not 446?
  3. Why the backup size is 512x63 bytes?

Re: number of bytes

Posted: Mon 08 Nov 2010, 06:33
by piratesmack
Hi, thank you for your interest
shinobar wrote: Why we need to copy the disk signature and partition table?
Doesn't the next work?

Code: Select all

dd if=/tmp/wee63.mbr of=$MBR_DEV bs=446 count=1
wee63.mbr is 63 sectors large (Actually a little less, but it can be a maximum of 63 sectors without overwriting data on the first partition). For comparison, the normal grub4dos boot code is only 18 sectors large, which isn't enough for Ext4 code.

You have to copy your disk signature and partition table to wee63.mbr, because you would lose them if you didn't (wee63.mbr would overwrite them).
What does the number 439(or 440 bytes) mean? Why not 446?
Wee's README.txt says:
First, read the Windows disk signature and partition information bytes
(72 bytes in total, from offset 0x01b8 to 0x01ff of the MBR sector), and
put them on the same range from offset 0x01b8 to 0x01ff of the beginning
sector of wee63.mbr.
If you convert 0x01b8 to decimal, you get 440
If you convert 0x01ff to decimal, you get 512

So the disk signature and partition table are located within bytes 440-512 (72 bytes total)
Why the backup size is 512x63 bytes?
I did that because wee63.mbr can be up to 63 sectors large.
1 sector = 512 bytes, so I backed up 512*63 bytes

I guess it would be better to check the exact size of wee63.mbr, and only back up that much.
Something like:

Code: Select all

# Back up the sectors about to be overwritten, just in case: 
BSIZE=$(stat -c "%s" /tmp/wee63.mbr)
dd if=$MBR_DEV of=/root/$(basename $MBR_DEV).63s bs=$BSIZE count=1

Re: number of bytes

Posted: Mon 08 Nov 2010, 07:09
by shinobar
Hi, piratesmack.
I can release the next update of grub4dosconfig using your code soon.
Thanks for the nice lecture so quick!

grub4dos-0.4.4.v1.6.0

Posted: Mon 08 Nov 2010, 12:50
by shinobar
THIS IS THE KILLER!
We need not grub legacy anymore :P

The new version with features:
  • ext4 full support (Thanks to piratesmack)
    Supports ntfs, vfat, ext2, ext3, ext4 by standalone. Need not grub legacy anymore.
  • UUID for locating full installs
    Free from the drive order using the partition UUID for full installs.
  • Grub2 chain load
    Can chain to the coexisting grub2.
Try grub4dos-0.4.4.v1.6.0.pet, Download from here

Make a rescue FD/USB for the 1st try:
http://www.murga-linux.com/puppy/viewtopic.php?t=61348

Posted: Mon 08 Nov 2010, 13:14
by nooby
Shinobar,

that sure is great.

But being as clumsy persistent or even relentless newbie as I am


What will happen to my boot if I do that pet?

I bought an Acer Aspire one with win 7 starter on it. D250 the model.

I used Jolicloud version of Ubuntu 9.04? to make the changes to the boot up.

So the script of Wubi for Jolicloud rewrote what was need to get that thing going.

then I manually added puppy and other linux to the menu.lst deep down in Jolicound Directory.

So if I do the Pet you talk enthusiastically then that one ask me questions that I will have no way of knowing how to answer?


Sure I can start all over and add everything again from what that Pet do.

But that took me a year to accomplish and very very many questions on this board. To start all over will get a lot of members upset.

Hey Nooby we told you how to do that one year ago use the search.

But I can not use the search because me fail to know what search word to use. I know this from personal experience.

Make a rescue FD/USB

Posted: Mon 08 Nov 2010, 13:27
by shinobar
@nooby
Make a rescue FD/USB for the 1st try. You can see what happens without risk.
http://www.murga-linux.com/puppy/viewtopic.php?t=61348

Posted: Mon 08 Nov 2010, 14:23
by piratesmack
Shinobar, I used your new Grub4dosconfig on my USB drive (vfat) and internal hard drive (Ext4). Both working fine.

Thanks :)

Great Thanks

Posted: Mon 08 Nov 2010, 14:26
by shinobar
piratesmack wrote:Thanks :)
I need to express a great thanks to YOU, piratesmack :P

Posted: Mon 08 Nov 2010, 14:39
by nooby
Shinobar, that maybe works. I have several 4GB USB flash memorys to use.

Can I save a current puppy luci-236 then on such a USB and then if the config mess up I boot up using the rescue usb and somehow repair it?

But I lose all the other puppies and such?

Maybe me can use another computer as a test machine but I am so lazy now.

Anyway keep it coming. You are a good contributer to puppy.


Edit

Hahahah, I am in Luci-236 now and it failed to boot three times despite me having both

safe mode debug

I had to add panic=300 for it to boot.

I used a backup pubsave to do an upgrade.

I should maybe test to only use pfix=ram and see if that always boot.
that way I will find out that it is the pupsave that makes it fail to boot.

It always fail at this part.

b43-pci-bridge
text text text
text ...

-

blinking cursor and the only way to get out of it is to do a hard reboot.

What is it hat makes it fail there and not on some other part and why does it help to add a lot of things to the kernel line?

Posted: Mon 08 Nov 2010, 15:30
by nooby
Just greg, your post disappeard. :)

Posted: Mon 08 Nov 2010, 17:58
by big_bass
Hey shinobar


how about a nice icon a handsome grub :lol:

Posted: Tue 09 Nov 2010, 21:21
by noryb009
shinobar: Just making sure, but you DON'T need Dos/windows for grub4dos?

Dos/windows required?

Posted: Tue 09 Nov 2010, 22:34
by shinobar
noryb009 wrote:shinobar: Just making sure, but you DON'T need Dos/windows for grub4dos?
Frequently asked.
The name '4dos' makes confusion.

grub4dos can manage Dos/Windows file systems, but also works without.

Posted: Tue 09 Nov 2010, 22:43
by noryb009
Thanks for clearing that up!

Posted: Tue 09 Nov 2010, 23:00
by bigpup
This is the best ever boot loader! Thanks.
I have totally stopped using old Grub.

Posted: Wed 10 Nov 2010, 12:59
by sc0ttman
I've just re-installed grub4dosconfig (1.6.0)

I love this tool, with frugal installer - now I finally have Puppy on (ext3) HD, using a frugal install.
Windows always made this a problem, until now. :D

Anyway.. about easy of use/usability...

I think the grub4dosconfig (and frugal installer) utility should use tooltips on the checkboxes, buttons etc in the GUI..
They are easy to add to gtkdialog GUIs and very important for novice users (and idiots like me).

Something like:

Code: Select all

# set tooltips
SEARCH_ONLY='search only this drive for puppy installs'
...
# build gui
'<checkbox tooltip-text="'$SEARCH_ONLY'">'
...
For example, a tooltip could say that the 'search only this drive' option "will not search for puppy installs on other drives"..
I thought this meant for MBRs... Even though the list above shows the MBRs that were found :roll:

Therefore, when I clicked 'search only this drive', the installer found no frugal installs, and therefore there was no Puppy entry in my menu.lst..

Not a problem for me luckily, as I realised my error and can fix it.. But tooltips would solve these kind of 'issue' for novices

Tool tips

Posted: Wed 10 Nov 2010, 14:03
by shinobar
sc0ttman wrote:about easy of use/usability...
Thanks for the suggestion.
Next version must be more user friendly with your feed back. > to all the readers.

Posted: Wed 10 Nov 2010, 21:02
by nooby
Shinobar,

may I ask about your program.

If I have Win7 Starter on my Acer D250 and Jolicloud has installed their Ubuntu style for small Netbooks on it using Wubi specially made for Jolicloud.

And I fire up your prog and try to install grub4Dos when there is already kind of grub with gldr there already.

What does the script do then? Does it rewrite so it make menu entries for all the Os that are already installed like win7Starter, Joliclound, Puppy Quirky, luci-236, Fluppy007, puppeee, wolf, murky, Puppy Studio and SuperOS ?

Or does it skip the win 7 or the jolicloud due to its wubi peculiar thing?

I mean can it create disaster that can not be repaired?

I have no DVD because it is a Netbook without DVD or CD.

Wubi installed

Posted: Thu 11 Nov 2010, 00:20
by shinobar
nooby wrote:Does it rewrite so it make menu entries for all the Os that are already installed like win7Starter, Joliclound, Puppy Quirky, luci-236, Fluppy007, puppeee, wolf, murky, Puppy Studio and SuperOS ?
Hopfully all yes, but not tested. Calling for your test report.

Windows 7 Starter have not yet been tested. Hope the same as the regular Windows 7 as for the boot.
Hopefully the Grub4DosConfig detects Wubi installed distributions and place it on the top level menu.
If the Grub4DosConfig failed to list up them in the top level, you select 'Windows' there, then the next menu appears with Windows and Wubi listed on.

Test with Floppy is recommended, but for PC's without FDD, USB drives can.
http://www.murga-linux.com/puppy/viewtopic.php?t=61348

Posted: Thu 11 Nov 2010, 03:41
by nooby
Yes it is reasonable I make the rescue version first and see that it loads several times.

thanks.

Reason for that I ask is that I fail to use luci-236 and LupQ too but that for most of the time Quirky and pupeee and fluppy do boot. Dpup too boot.

SuperOS do boot.

So something about luci make it fail. Almost never fail if there is no pupsave in the sub dir but if it is a pupsave and if I do pfix=ram then it can still fail.

So I thought it can have to do with the older version of grub.
Jolicloud have their own version of grub so it can be different.

So if I use your version then luci should work too.