Dual boot XP (hidden partition)

Started by target_locked, June 21, 2013, 03:05:28 AM

Previous topic - Next topic

target_locked

Hi there,

I have this case.

My HDD originally has 2 partitions:
Partition 1 (primary); Partition 2(ext/logical)

Using Partition manager software to resize Partition 1 smaller and create a new Primary partition just after Partition 1.

Now my HDD has 3 partitions:
Partition 1 (primary); Partition 2 (pri), Partition 3(ext/logical)
Take note: the actual physical order from left to right.

Now I install Win XP to Partition 1.
Using Ghost to Clone Partition 1 to Partition 2.

At this point, I can boot into Win XP1 at Partition 1. I don't see Win XP 2 from XP1 Boot menu.
From Win XP1, I Install Plop to MBR.

Reboot, Install PLOP at Win XP bot menu.
Reboot, Go to Plop>>Setup>>Partition>>Select P1 >> Edit MBR>> I see there are 3 partitions P1, P2, P3
But the order is not same as the physical order (seen in the Partition manager)
P1 has id=07 (Primary)
P2 has id=0F (Extended)
P3 has id=07 (Primary)

The question for this MBR:
How can I know exactly which P1/P2/P3 in Plop are which Partition1/2/3 that showed in Partition manager software?

Now, if I want to boot to Partition 1 and hide (not cleared) partition 2 (Partition 3 use as shared drive), what is the step by step?
Now, if I want to boot to Partition 2 and hide (not cleared) partition 1 (Partition 3 use as shared drive), what is the step by step?
(The Windows drive is always C: and the shared drive is always D:)

Thanks.

jan4

#1
Hi target_locked,

First the the order of the partitions on the MBR can be different of the order on your disk.
In your case  in the MBR:
1 = XP1  07=NTFS
2 (or3) = Extended with one or more partitions in there.
3 (or4) = XP2  07=NTFS

On Disk it is XP1,XP2,Extended

Why plop in the boot menu ?? You have in the MBR so it will be available before boot menu , no need to have it there!

I think you only can hide the not booted partition in windows (hidden partitions are seen by windows anyway).
You can Save the partition data in plop and make profiles to boot XP1 and XP2  as you like .

If you clear partitions in the MBR you must save them first and after boot partiton programs and windows will see the space as not used so do not use that space!!
A note on what partitions (type start and length) on another media is usefull 2.

Can you boot XP2 if not you can change boot.ini it is now partition 2 (you can set wherever you want with plop ) .
For windows that operating system is real stupid and counting partitions using the MBR order would be mutch better (if partition 1 is not there XP2 does not boot without change boot.ini even is position in MBR=2).

Hope this helps in onderstanding how it works.

target_locked

Quote from: jan4 on June 23, 2013, 14:20:30 PM
Why plop in the boot menu ?? You have in the MBR so it will be available before boot menu , no need to have it there!
How can you install Plop to MBR from Windows without using Windows Boot menu?
Running "InstallToMBR.bat" will create an entry in the windows boot.ini
C:\plop\plpbt4winmbr.ldr="Install/Remove the Plop Boot Manager [MBR]"
At windows boot menu, I can run that to actually install PLOP to MBR or remove/uninstall PLOP from MBR.

Finally I can understand how the PLOP profile work.
But I have to guess which MBR entry is which actual partition.
Luckily I have only 2 primary partitions so I can guess them easily. The first entry is always the first partition. The remaining have to base on the partition ID "07".

target_locked

This is step by step for my case above:
This tutorial will help to boot to this XP and hide the un-booted partition, WinXP will see other unknown partition but don't see the data inside.

Create hidden parition data for Partition 1 and Partition 3. (they are 2 primary partitions)
--------
go to setup / partitions
choose an empty entry
give it a label like "Hidden P1"
select device: hda
edit mbr/import data:
  cursor down to "P1"
  press "s" key
  cursor up to "BP"
  press "p"
  esc
go to partition id
enter partition id, change the value to 17
esc and save
--------
go to setup / partitions
choose an empty entry
give it a label like "Hidden P3"
select device: hda
edit mbr/import data:
  cursor down to "P3"
  press "s" key
  cursor up to "BP"
  press "p"
  esc
go to partition id
enter partition id, change the value to 17
esc and save
-------
Now in profiles, select an empty entry and name it "XP1 hidden XP2"
>> Linked partition >>
Slot 1: HDA1, press "b" to set boot flag
Slot 2: Don't touch
Slot 3: "Hidden P3"
Slot 4: Don't touch
------
Now in profiles, select an empty entry and name it "XP2 hidden XP1"
>> Linked partition >>
Slot 1: "Hidden P1"
Slot 2: Don't touch
Slot 3: HDA3, press "b" to set boot flag
Slot 4: Don't touch

jan4

Quote from: target_locked on June 24, 2013, 06:24:29 AM
How can you install Plop to MBR from Windows without using Windows Boot menu?
Running "InstallToMBR.bat" will create an entry in the windows boot.ini

Finally I can understand how the PLOP profile work.
But I have to guess which MBR entry is which actual partition.
Luckily I have only 2 primary partitions so I can guess them easily. The first entry is always the first partition. The remaining have to base on the partition ID "07".
Yes you are right installer in boot menu, did not think of that as i never used it , i install from dos (cd or floppy).

No the Position in the Master Boot Record (MBR) has nothing to do with the partition ID!!
And de first entry is not always the first partition.
In most partitioning programs it depends on the sequence you create the partitions .

With the good old ranich partition manager (use only in dos not in windows dos screen) you can see and change the numbers 1,2,3,4 )
You don't have to guess the partitions, you can see all MBR info from plop  , go to :
Setup --> Partitions --> Select a used partition --> View/edit/copy data
Then you get 5 lines , the first is the profile partition (should be de same of 1 of the four below)
The 4 following lines are the 4 possible partitions of the MBR.
Byte 00 80=bootflag set 
Byte 04 = partition ID
Byte 08 09 0A 0B = Start of partition.

About hidden parition , that works with windows98 and before , not with 2000 or later (at least not with the latest service packs).
You can try to set the Partition id to something else (not 07 or 17) for example FF , but i think windows is actually looking in the partition and mounting it anyway.
You can hide the not used partition in windows by not connecting a drive letter in de disk managment window in windows.

If you don't wan't that , I think the only way is to clear the entry from the MBR.




target_locked

#5
Quote from: jan4 on June 24, 2013, 11:02:57 AM
You don't have to guess the partitions, you can see all MBR info from plop  , go to :
Setup --> Partitions --> Select a used partition --> View/edit/copy data
Then you get 5 lines , the first is the profile partition (should be de same of 1 of the four below)
The 4 following lines are the 4 possible partitions of the MBR.
Byte 00 80=bootflag set 
Byte 04 = partition ID
Byte 08 09 0A 0B = Start of partition.
I have this case:
P1 (primary FAT 32) is the first partition, P3 (primary FAT 32) is the next, P2 is the extended/logical partition.
And the MBR showed from PLOP:
I just write last 8 bytes
P1 ....3F 00 00 00 D3 0C E0 00
P2 ....3B 8B 38 01 86 06 70 03
P3 ....12 0D E0 00 29 7E 58 00
P4 ....00 00 00 00 00 00 00 00

From above table I don't know how to count the number. Which bit is the MSB which is LSB?

Elmar

#6
Quote from: target_locked on June 26, 2013, 03:12:17 AM
I just write last 8 bytes
P1 ....3F 00 00 00 D3 0C E0 00
P2 ....3B 8B 38 01 86 06 70 03
P3 ....12 0D E0 00 29 7E 58 00
P4 ....00 00 00 00 00 00 00 00

From above table I don't know how to count the number. Which bit is the MSB which is LSB?


the last 8 bytes in the partition table are 2 x 4 byte values. the first 4 byte value is the LBA start sector of the partition, the second is the length/size value.

P1 ....3F 00 00 00 D3 0C E0 00
value 1: 3F 00 00 00 = 0x3F = integer 63 = LBA sector 63 -> partition starts at sector 64. (info: LBA starts with sector 0)
value 2: D3 0C E0 00 = 0x00E00CD3 = 14683347 sectors = partition size is 7.1GB



Quote from: target_locked on June 21, 2013, 03:05:28 AM
But the order is not same as the physical order (seen in the Partition manager)

graphical partition managers are visualizing how the hard disk is partitioned and not in which order the partitions are written in the partition table. the user usually does not need to know what partition entry is used for what partition. none graphical partition programs like fdisk makes life easier for advanced users that play around with partitions. because they show the partition table entries and you tell the program what partition you want to create and which table entry should be used for the partition. i love fdisk. its simple and straight.

when you dont know what partition is the one you need, then either activate the unknown partition in a profile and look with an os at the partition, or you calculate around with the lba values to see where the partition is on the hard disk, or you look with fdisk at the partition table.


regards
elmar

target_locked

Thanks Elmar,

So what is the LBA value of P2 and P3?
P1 ....3F 00 00 00... LBA = 0x3F = integer 63
P2 ....3B 8B 38 01...
P3 ....12 0D E0 00...
P4 ....00 00 00 00...

I don't use FDISK so not sure how it show partition order.
I often use Ranish Disk Director which show physical order of partitions. The windows "Disk Management" also show same physical order.

Elmar

P1 ....3F 00 00 00... LBA = 0x3F = integer 63
P2 ....3B 8B 38 01... LBA = 0x01388B3B = 20482875
P3 ....12 0D E0 00... LBA = 0x00E00D12 = 14683410

target_locked

Quote from: Elmar on June 26, 2013, 08:22:30 AM
P1 ....3F 00 00 00... LBA = 0x3F = integer 63
P2 ....3B 8B 38 01... LBA = 0x01388B3B = 20482875
P3 ....12 0D E0 00... LBA = 0x00E00D12 = 14683410
Thanks Elmar,

Now I can read the MBR value to know physical order of partition.

One more question:
Why is the "Least Significant Byte" on the Left (not in the Right) ? This order made me confused.

Elmar

Quote from: target_locked on June 26, 2013, 08:38:21 AM
One more question:
Why is the "Least Significant Byte" on the Left (not in the Right) ? This order made me confused.

because its stored in little-endian format.

mbr's are used with "IBM PC-Compatible" computers -> those are using x86 cpu's -> x86 cpu's are working in little-endian mode