Jump to content











Photo
- - - - -

grub4dos sees extended as first partition and primary as second


  • Please log in to reply
22 replies to this topic

#1 Bit

Bit
  • Members
  • 9 posts

Posted 02 February 2011 - 07:14 AM

Hi everybody.
I'm not an experienced user of grub4dos so please excuse my mistakes...
Also English is not my native language...

I used Paragon Hard Disk Manager 6 to partition my Usb hdd.
I created a 64 GB NTFS primary partition, an extended one and a logical NTFS in it with the rest of the free space.
I installed grub4Dos in MBR and used WinSetupFromUsb to add different CDs/DVDs to the primary partition.
It worked fine.
A few days later I had to delete and recreate the first primary partition. After that I copied the content from backup.
As a precaution I reinstalled grub4Dos in MBR.

The problem is that the extended partition is seen now as hd(0,0) and the primary is hd(0,1) (reversed). Like the primary partition is a logical one in the extended, but it's not.
Is still boots and loads the menu but when I try some entries it says something "cannot mount hd(0,0)" (which is normal since you can't mount an extended partition). On some entries it works changing to hd(0,1).

My questions are:
1. Why the partition order for the first 2 is seen as reversed in grub4Dos, because many other partitioning programs are detecting the old (and I say "normal") order..?
2. How can I fix this easy without recreating all the partitions or using WinSetupFromUsb from 0 or changing manually hd(0,0) into hd(0,1) in every *.lst (I have a few, not just menu.lst) (if this works for all menu entries)..?

Thank you in advance for any help.

Best regards, Bit

#2 ded

ded

    Frequent Member

  • Developer
  • 133 posts

Posted 02 February 2011 - 07:32 AM

Entries in the MBR can be considered
1. historically, that is, in order of their appearance = creation (GRUB4DOS)
2. physically, ie, in order of placement on the HDD = location (Windows)
Example:
- Creating a partition A-B-C. For them, the two approaches are equivalent.
- Delete the partition B and create in its place two new partitions X and Y. Will now be a difference: the historical record of the partitions are so A-C-X-Y, but they are physically located A-X-Y-C.
I think that your problem is from this area. :thumbsup:

#3 steve6375

steve6375

    Platinum Member

  • Developer
  • 5,340 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 02 February 2011 - 07:50 AM

If you have Vista or Win7 or a recovery DVD of these, boot to the command console and run diskpart, select your USB disk then exit diskpart.

Diskpart always rewrites the partition table in the correct order even if you don't do anything! (But if it does not, then create and delete a small partition just to force it to re-order).

#4 ded

ded

    Frequent Member

  • Developer
  • 133 posts

Posted 02 February 2011 - 08:14 AM

If you have Vista or Win7 or a recovery DVD of these, boot to the command console and run diskpart, select your USB disk then exit diskpart.

Diskpart always rewrites the partition table in the correct order even if you don't do anything! (But if it does not, then create and delete a small partition just to force it to re-order).

Interesting information. Would it work if we select the HDD with operation system?

#5 Bit

Bit
  • Members
  • 9 posts

Posted 02 February 2011 - 08:17 AM

@ded
Thank you for the informations.
I understand, grub4dos is seeing historically, not physically. But why is made like this..? Is there any advantage..?

@steve6375
Thank you for the idea. I will try it...

#6 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 02 February 2011 - 08:19 AM

Just for the record, MBRWIZ does have this feature of sorting partition tables.
http://mbrwizard.com/
http://mbrwizard.com/examples.php#sort

:thumbsup:
Wonko

#7 Bit

Bit
  • Members
  • 9 posts

Posted 02 February 2011 - 08:34 AM

@Wonko
I tried "MBRWiz /Sort /Disk=1" and it seemed that it worked. Thank you.

#8 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 02 February 2011 - 09:39 AM

@Wonko
I tried "MBRWiz /Sort /Disk=1" and it seemed that it worked. Thank you.

Only too happy to have contributed to another happy bunny. :cheers:
http://www.msfn.org/...up/page__st__10

Now I have basket Release 2 :cheers:
http://www.msfn.org/...up/page__st__40
so no problems, plenty of space in it. :thumbsup:

:cheers:
Wonko

#9 karyonix

karyonix

    Frequent Member

  • Advanced user
  • 434 posts
  •  
    Thailand

Posted 02 February 2011 - 11:08 AM

I understand, grub4dos is seeing historically, not physically. But why is made like this..? Is there any advantage..?

It is not seeing historically.
Partition table is an array consists of 4 16-byte entries. GRUB's partition number for each primary partitions is index of partition table array element in current state.

#10 Bit

Bit
  • Members
  • 9 posts

Posted 02 February 2011 - 12:08 PM

It is not seeing historically.
Partition table is an array consists of 4 16-byte entries. GRUB's partition number for each primary partitions is index of partition table array element in current state.


Ok.
But why do this and not scanning for the physical position of the partitions (or something else that Windows and its programs do...)? What is the advantage? Speed, compatibility..?
I'm just trying to understand...

Edited by Bit, 02 February 2011 - 12:09 PM.


#11 karyonix

karyonix

    Frequent Member

  • Advanced user
  • 434 posts
  •  
    Thailand

Posted 02 February 2011 - 12:49 PM

Sorting is not required to access partitions. Sorting is additional work. Why sort them when you can access them without sorting ?

Advantage of unsorted partition number :
- Unchanged partitions have unchanged partition number.
- References to unchanged primary partition by partition number is still valid when user create/delete other partitions.

GNU/Linux systems also do not sort primary partitions. Primary partition numbers appear in order they are in partition table.
GNU fdisk also keeps unchanged-primary-partition number unchanged.

I think GRUB legacy's developers do not care much about Windows partition number. GRUB legacy can chainloader Windows MBR anyway.
GRUB4DOS maintains compatibility with GRUB legacy.

#12 Bit

Bit
  • Members
  • 9 posts

Posted 02 February 2011 - 01:21 PM

Sorting is not required to access partitions. Sorting is additional work. Why sort them when you can access them without sorting ?


Well, it's obvious why sorting is sometimes good: my problem. I recreated the partition and most of the entries in *.lst menus didn't worked anymore. And I had to ask on this forum and use other programs to fix it.
On my HDD deleting and creating partitions are not so rare and I think there may be others too...
Since we're talking here about "Grub4Dos" and not "Grub4Linux", imho it should be a little more compatible with the way Dos\Windows are "seeing" partitions.
Just saying my opinion...

#13 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 02 February 2011 - 01:28 PM

It seems to me like you are making it more complex (which actually means too easy :cheers:) than needed. :thumbsup:

A "normal" partitioning tool starts partitioning from the beginning of the disk (conventionally represented as the "left" side in any graphical utility) and continues towards the end of the disk (conventionally represented by the "right" side) and writes entries in the partition tables in a "left to right order".
You have in the MBR FOUR "slots" for each hard disk (hdm)numbered (in grub4dos notation):
(hdm,0)
(hdm,1)
(hdm,2)
(hdm,3)
Since you normally create partitions from left to right, normally:
First partition (the one nearest the beginning of the disk) is the first entry (hdm,0)
Next partition (the one nearest the preceding partition) is the second entry (hdm,0)
and so on.

The above is only "logical", the unsorted partition entries ONLY happen if someone deletes/moves/resizes/create partitions using any of the "smart" tools available and/or use them to create partitions not in the above described "left to right" (or "begginning to end") order.

The situation with Logical Volumes inside extended may even be worse due to the "chains" of which each EPBR constitutes a link.

So, the "right" (or if you prefer traditional, used since the first hard disks were produced, failsafe) way is to:
  • think about the needed partitioning scheme before
  • create partitions in the "left to right" order
  • do NOT move/resize/create new ones without thinking what the effects are

Most nice, GUI, easy tools nowadays available "automagically" make things so easy that the user is led to presume that they will take care of EVERYTHING, and, consequently needs NOT to think, nor to plan, nor to understand the consequences of his/her actions performed through the tool.

The average user, in perfect good faith :cheers:, thinks he can do ANYTHING (and the tools actually allow him/her to do so) without knowing ANYTHING.

Poewerful tools in the hands of inexperienced users are likely - if the users stops thinking before dong things - to have consequences.

You know, kids, matches ....

@Bit
About the opportunity of using entry # instead of actual position think a bit of the consequences of this action:
You have three (very small :cheers:) Primary partitions, originally partitioned in the "right" way:

(hd0,0)Sectors 0-999
(hd0,1)Sectors 1000-1999
(hd0,2)Sectors 2000-2999


You decide to split the partition in the middle in two.
Informative, preliminary question:
  • What would be the result of using your preferred tool?

(hd0,0)Sectors 0-999
(hd0,1)Sectors 1000-1499
(hd0,2)Sectors 2000-2999
(hd0,3)Sectors 1500-1999

or:

(hd0,0)Sectors 0-999
(hd0,1)Sectors 1000-1499
(hd0,2)Sectors 1500-1999
(hd0,3)Sectors 2000-2999

:cheers:
First "real" question (easy):
  • Which one of the two looks more tidy?
Now, a few more questions (not so easy):
  • What effect will the two different way on your running Operating systems?
  • How many different ways does a Windows NT based system use to identify a partition?
  • Can you list all the ways the partition that spans sectors 2000-2999 can be addressed (before the change)?
  • Can you list the same ways after the change? (with both the possible resulting orders in the partition table)


:cheers:
Wonko

#14 Bit

Bit
  • Members
  • 9 posts

Posted 02 February 2011 - 02:48 PM

It seems to me like you are making it more complex (which actually means too easy :)) than needed. :happy_dance:


Well, computers exist to make life easier not to make it more complicated. But even I sometimes forget that :w00t:

do NOT move/resize/create new ones without thinking what the effects are


Well, that's wise but:
1. we can only advise others to do that not force them;
2. there are situations when you have to delete/create, especialy on a external hdd, which was bought because it can be modified easy. Btw, on the computer's internal HDD I hadn't made such modifications since the day I partitioned it the first time.
So, for internal HDD I agree with you 100%, for external about 30..40%.

Most nice, GUI, easy tools nowadays available "automagically" make things so easy that the user is led to presume that they will take care of EVERYTHING, and, consequently needs NOT to think, nor to plan, nor to understand the consequences of his/her actions performed through the tool.

The average user, in perfect good faith :), thinks he can do ANYTHING (and the tools actually allow him/her to do so) without knowing ANYTHING.

Poewerful tools in the hands of inexperienced users are likely - if the users stops thinking before dong things - to have consequences.

You know, kids, matches ....


You're right about inexperienced users, that it's dangerous.
But that's the situation with Linux trying to enter in the world of Windows :whistling:
You are trying to show me that's all white or that's all black (I don't know which), I'm just saying my opinion that it should be a different shade of gray...
I haven't said about implementing two different ways, I just said it should be a little more compatible.
How it should do that, I don't know yet and obviously I'm not qualified yet to make a good suggestion.
But I have the right to express my opinion without been "crucified" because nobody has found a good solution yet.
The fact that I don't have yet a perfect solution is so bad..?

Well, here's a solution that I think now: both should be implemented but the user will choose which one will be used when is installing it. So when it boots only one is used. I think the user should have the right to choose how Grub4Dos should work on his computer.
Now let's see how you'll "demolish" this idea too...
Just kidding :D

#15 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 02 February 2011 - 03:11 PM

I guess you misunderstood the message.

The point is that due to a number of reasons - mostly, but not only, historical, it is actually ALL shades of gray (missing a "standard").

Point is that everyone (MS peeps, Linux ones, developers of the "smart" GUI apps and everyone else) think that they got the "right" shade of grey, and they haven't.

Just imagine that you try choosing a shade of gray from an image made with 65,536 shades:
http://en.wikipedia.org/wiki/Grayscale
BUT you attempt to do so on a monitor set to view only 256 of them.
In a number of cases, you will pick the right one, but in most you will pick a near-enough BUT NOT EXACT one.

The other point is also NOT about your opinion (which of course you are perfectly free to express :whistling:), but rather with the not so marginal fact that changing the current half@§§ed approach will create so many incompatibilities that it would be counterproductive.

The general idea (yes, someone already had it :)) is currently that of using a completely new partitioning scheme leaving behind "legacy" systems, still linked to the MBR, and use GPT partitioning (and EFI):
http://en.wikipedia....Partition_Table
which is theoretically a "standard".

It will be interesting to see how the various peeps will manage to create incompatibilities with GPT too. :w00t:

No attempt whatsoever involving crucifixion :happy_dance::
http://www.imdb.com/...uotes?qt0471984

Brian: What will they do to me?
Ben the Prisoner: Oh you'll probably get away with crucifixion.
Brian: CRUCIFIXION?
Ben the Prisoner: Yeah, first offense.


:)

:D
Wonko

#16 karyonix

karyonix

    Frequent Member

  • Advanced user
  • 434 posts
  •  
    Thailand

Posted 02 February 2011 - 05:52 PM

Well, it's obvious why sorting is sometimes good: my problem. I recreated the partition and most of the entries in *.lst menus didn't worked anymore. And I had to ask on this forum and use other programs to fix it.


Why don't you think that you have this problem because you used Paragon Hard Disk Manager 6 ?
You want sorting ? You may ask Paragon Hard Disk Manager 6 developer for this feature.
If you use Windows Disk Management or Windows DISKPART or GNU fdisk or Gparted, you may have your expected partition number.

If you want partition number independent configuration, GRUB4DOS has find and uuid command to identify partition.
find --set-root /ntldr
find --set-root uuid () 7f95820f-5e33-4e6c-8f50-0760bf06d79c
Read README_GRUB4DOS.txt for more information

#17 Bit

Bit
  • Members
  • 9 posts

Posted 02 February 2011 - 07:04 PM

Why don't you think that you have this problem because you used Paragon Hard Disk Manager 6 ?


I just tried with Acronis Disk Director. Same problem.

You want sorting ? You may ask Paragon Hard Disk Manager 6 developer for this feature.


What are the chances that they will listen to me (just one user)? Pretty much the same chances that the makers of Grub4Dos will listen to me... :happy_dance:

If you use Windows Disk Management or Windows DISKPART or GNU fdisk or Gparted, you may have your expected partition number.


I don't like Windows Disk Management cause it's not working well. I know that in Linux is common to make partitions in console but still...
And Gparted: I have friends with Linux but not even one recommended it to me.

Oh, until today I have found no real problems in Acronis and Paragon. And I'm not so sure that this sorting is their problem.

If you want partition number independent configuration, GRUB4DOS has find and uuid command to identify partition.
find --set-root /ntldr
find --set-root uuid () 7f95820f-5e33-4e6c-8f50-0760bf06d79c
Read README_GRUB4DOS.txt for more information


Thank you, the code looks good, but:
1. if I recreate the partition isn't the uuid gonna change..? If yes, then I'll have to modify any lst each time. So what's the point...?
2. in my first post I asked for a solution that will not make me modify the lst's.


Later edit: I'm surprised that was_jaclaz haven't said something. It's not his style... Maybe he's busy.
I just can't wait till he'll say too that I'm wrong :)

Edited by Bit, 02 February 2011 - 07:10 PM.


#18 karyonix

karyonix

    Frequent Member

  • Advanced user
  • 434 posts
  •  
    Thailand

Posted 02 February 2011 - 07:56 PM

but:
1. if I recreate the partition isn't the uuid gonna change..? If yes, then I'll have to modify any lst each time. So what's the point...?

If you recreate other partition, unchanged partition's UUID will not change. You will not have to modify menu.lst each time.

but:
2. in my first post I asked for a solution that will not make me modify the lst's.

Your question in #1 has already been answered. You problem from #1 is already solved by rearranging your partition table.
You asked more questions and got more answers. Isn't this better than "Problem from #1 is solved. This topic is closed. ".

#19 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 02 February 2011 - 08:09 PM

Later edit: I'm surprised that was_jaclaz haven't said something. It's not his style... Maybe he's busy.
I just can't wait till he'll say too that I'm wrong :)

He ALREADY told you! :D
The only problem is that you didn't realize that it already happened. :happy_dance:
http://reboot.pro/10068/

:whistling:

:w00t:
Wonko

#20 Bit

Bit
  • Members
  • 9 posts

Posted 02 February 2011 - 08:24 PM

If you recreate other partition, unchanged partition's UUID will not change. You will not have to modify menu.lst each time.


But the problem is that I don't recreate other partition, I recreate the (primary) partition where grldr and menu.lst are stored.

Your question in #1 has already been answered. You problem from #1 is already solved by rearranging your partition table.
You asked more questions and got more answers. Isn't this better than "Problem from #1 is solved. This topic is closed. ".


Sorry for trying to find out more or to make things better instead of been happy just with that answer.
Ok, you gave me your answer, thank you, I didn't like it, that's my choice. Isn't this better than "let's try to be nice with each other on this forum, let's try to help"?
Oh, sorry, that's not my style of talking to others. I can't be this way, no matter how I am treated.

#21 Bit

Bit
  • Members
  • 9 posts

Posted 02 February 2011 - 08:31 PM

He ALREADY told you! :D
The only problem is that you didn't realize that it already happened. :happy_dance:
http://reboot.pro/10068/

:whistling:

:w00t:
Wonko


Well, hello there, then I'm not surprised anymore, what you said before fits you like a glove (from how other people described you) :)

But that's enough fun for me on this forum. Thank you those who tried to help me, I wish myself "Good readens" and go on other forums.
Bye, bye...

Edited by Bit, 02 February 2011 - 08:42 PM.


#22 karyonix

karyonix

    Frequent Member

  • Advanced user
  • 434 posts
  •  
    Thailand

Posted 03 February 2011 - 02:04 AM

@Bit #20
part1
For FAT and NTFS partition, UUID is volume serial number. It change when you format the parttion. If you just re-create a partition without formatting, UUID remains the same.

part2
Don't sorry for asking more questions. Asking more questions is OK. I think learning is encouraged here.
But your post sounds like you don't want answers to other questions.
I read your But 2. from #17 and felt you complained that my answer is off-topic, miss the point of the question you ask in question in #1.
So I explained that I was answering to your question. Even if it is not the #1 question it is still your question. I didn't go off-topic.
I just defended my post. Why do you think you are threated badly ?

#23 ded

ded

    Frequent Member

  • Developer
  • 133 posts

Posted 03 February 2011 - 06:54 AM

For FAT and NTFS partition, UUID is volume serial number. It change when you format the parttion. If you just re-create a partition without formatting, UUID remains the same.

And yet. UUID is also stored when working with images. For example, when you use Acronis True Image. When restoring a partition from an image, is restored also its UUID.

:thumbsup: