Jump to content











Photo
- - - - -

ImDisk Toolkit

imdisk toolkit ramdiskui discutils image file mount

  • Please log in to reply
334 replies to this topic

#301 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 19 November 2018 - 12:50 AM

Okay, since ImDisk has been updated to version 2.0.10, I can't wait to see the next update to the ImDisk Toolkit as well. :D



#302 Tr3bg0D

Tr3bg0D
  • Members
  • 5 posts
  • Location:Space
  •  
    United States

Posted 12 April 2020 - 05:50 PM

2 Questions regarding the 20200412 release:

1 - make_releases.bat does not create valid release files. The CMD window displays errors that it cannot find files. Is there something missing or I am doing wrong then just running the BAT file?

2 - Is there a way for us to create SFX Modules on our end? Can you include a script?



#303 v77

v77

    Silver Member

  • Team Reboot
  • 602 posts
  •  
    France

Posted 12 April 2020 - 07:14 PM

@Tr3bg0D:
Answered on SourceForge:
https://sourceforge....ead/2e7846cc5e/
  • Tr3bg0D likes this

#304 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 19 April 2020 - 06:29 AM

It looks like that IMDisk is reporting that the OS/2 2.1 boot partition is located on partition 2 instead of partition 1.

 

Note that I managed to create the VM using Virtual PC 2007 and got this:

 

Here's a link to the screenshot in question: https://imgur.com/a/2J972xn

 

I would like to note that the OS/2 2.1 boot partition is located on drive C which resides as partition 1 (primary partition) and drive D being partition 2 (the logical partition ). I can't understand why OS/2 2.x would would not display the numbering of partitions correctly under IMDisk.

 

Should I have to report a bug about this issue and provide a copy of the MBR of the partition drives in question?



#305 v77

v77

    Silver Member

  • Team Reboot
  • 602 posts
  •  
    France

Posted 19 April 2020 - 09:53 AM

@ppgrainbow

 

So you mean that the partitions are reversed?
Is that a new behavior, or did you see the same with the previous version of the Toolkit?

If I am not mistaken, the boot partition is not necessarily the first one.



#306 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 19 April 2020 - 10:01 AM

@ppgrainbow

 

So you mean that the partitions are reversed?
Is that a new behavior, or did you see the same with the previous version of the Toolkit?

If I am not mistaken, the boot partition is not necessarily the first one.

 

That's correct. IMDisk reports that the partitions are reversed (the boot partition being on partition #2) after creating a primary partition and a logical partition using OS/2 2.1 FDISK and partially installing OS/2 2.1 in text mode.

 

This appears to be a behaviour that existed when OS/2 2.1 came out in May 1993.



#307 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 19 April 2020 - 10:06 AM

That's correct. IMDisk reports that the partitions are reversed (the boot partition being on partition #2) after creating a primary partition and a logical partition using OS/2 2.1 FDISK and partially installing OS/2 2.1 in text mode.

 

Long time since I ran OS/2 now, but I seem to recall that at least in some scenarios it would create partitions in a different order in the MBR than the actual location on disk and that this could have some interesting consequences to how the partition table was shown in various disk tools. If you could upload the MBR we could check what is going on!



#308 friske

friske

    Frequent Member

  • Advanced user
  • 252 posts
  •  
    Italy

Posted 19 April 2020 - 10:22 AM

When I try to create a project with Android Studio in a ImDisk RamDisk i get:

"the path is not writable please choose a new location"

and

"Could not ensure the target project location exist and is accessible. Please try to specify another path"

do it is ImDisk relate problem?



#309 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 19 April 2020 - 10:28 AM

When I try to create a project with Android Studio in a ImDisk RamDisk i get:

"the path is not writable please choose a new location"

and

"Could not ensure the target project location exist and is accessible. Please try to specify another path"

do it is ImDisk relate problem?

 

Yes, I would guess so. Such compatibility problems are not uncommon these days.



#310 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 19 April 2020 - 10:29 AM

Long time since I ran OS/2 now, but I seem to recall that at least in some scenarios it would create partitions in a different order in the MBR than the actual location on disk and that this could have some interesting consequences to how the partition table was shown in various disk tools. If you could upload the MBR we could check what is going on!

 

Okay, I uploaded the copy of the OS/2 2.1 MBR and here is the link to the file in question: https://1drv.ms/u/s!...4cb77B?e=F7Ntg0

 

Once you get it, I will remove it from OneDrive.

 

The command that I entered was:

rawcopy 512 "E:\OS_2-2.1_Test\boot.vhd" E:\OS_2-2.1_Test\OS2_MBR

Once again, is it possible to do a rawcopy of the MBR of the logical drive on the extended partition?


Edited by ppgrainbow, 19 April 2020 - 10:30 AM.

  • Olof Lagerkvist likes this

#311 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 19 April 2020 - 10:41 AM

It is perfectly possible that the partiton entries are swapped in the MBR.

 

Just check the partition table directly, with *any* tool showing what is actually written in each "slot".

 

You can use Tiny Hexer and my scripts for it, but *any* other partition related tool showing the actual partition entires as they are would do, this "bundle" has also partition Info:

http://reboot.pro/to...xer-mbr-backup/

 

:duff:

Wonko


  • Olof Lagerkvist likes this

#312 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 19 April 2020 - 10:50 AM

It is perfectly possible that the partiton entries are swapped in the MBR.

 

Just check the partition table directly, with *any* tool showing what is actually written in each "slot".

 

You can use Tiny Hexer and my scripts for it, but *any* other partition related tool showing the actual partition entires as they are would do, this "bundle" has also partition Info:

http://reboot.pro/to...xer-mbr-backup/

 

:duff:

Wonko

 

Is it possible to fix the swapped partition entries using TinyHexer? I didn't realise that OS/2 2.1 would swap partition entries when viewed using IMDisk after creating the hard disk partitions using OS/2 2.1 FDISK.



#313 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 19 April 2020 - 10:53 AM

Yep, confirmed, the partition entries are swapped:

Entry        Type         Boot         bCyl         bHead       bSect        eCyl         eHead       eSec         StartSector                    NumSectors 

#0             5              0              255           0              1              510           31             63             514080                      516096

                                                                                                                                               

#1             6              80             0              1              1              254           31             63             63                             514017

 

Maybe of use:

http://reboot.pro/to...try-float-to-0/

 

:duff:

Wonko


  • Olof Lagerkvist likes this

#314 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 19 April 2020 - 10:55 AM

Okay, I uploaded the copy of the OS/2 2.1 MBR and here is the link to the file in question: https://1drv.ms/u/s!...4cb77B?e=F7Ntg0
 
Once you get it, I will remove it from OneDrive.

The command that I entered was:

rawcopy 512 "E:\OS_2-2.1_Test\boot.vhd" E:\OS_2-2.1_Test\OS2_MBR

 
Thanks. Indeed, that partition table has the extended partition as first partition entry and the bootable primary partition is the second partition entry. This unfortunately means that different disk partition tools will display things differently, because the order in which partitions are displayed is not clear in this case. Partitions can be ordered either by the location of their entry in the partition table or by their location on disk.
 

Once again, is it possible to do a rawcopy of the MBR of the logical drive on the extended partition?


Yes, you need to skip forward to the extended partition table, In your particular case:

rawcopy 263208960 512 "E:\OS_2-2.1_Test\boot.vhd" E:\OS_2-2.1_Test\OS2_EBR


#315 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 19 April 2020 - 11:13 AM

@Olof

You are doing imho the right thing, as most tools (particularly simple/low level ones) will access partition entries in the MBR according to their position, not the actual order on disk.

 

@ppgrainbow

Sure you can use Tiny hexer after all it revolves around:

copy/paste the 16 bytes of the first entry in an empty slot or in another temporary file

copy/paste the next 16 bytes overwriting the first entry 

copy/paste from the temporary location the 16 bytes overwriting the second entry

if you used an empty slot fill it with 00's

 

but the proposed batch should make it easier.

 

:duff:

Wonko


  • Olof Lagerkvist likes this

#316 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 19 April 2020 - 11:14 PM

 

 
Thanks. Indeed, that partition table has the extended partition as first partition entry and the bootable primary partition is the second partition entry. This unfortunately means that different disk partition tools will display things differently, because the order in which partitions are displayed is not clear in this case. Partitions can be ordered either by the location of their entry in the partition table or by their location on disk.
 


Yes, you need to skip forward to the extended partition table, In your particular case:

rawcopy 263208960 512 "E:\OS_2-2.1_Test\boot.vhd" E:\OS_2-2.1_Test\OS2_EBR

 

Here is the MBRs of the primary partition and the logical drives:

Primary Partition: https://1drv.ms/u/s!...2VomNn?e=b84EpP

Logical Partition: https://1drv.ms/u/s!...hVV6__?e=KNy8VT



#317 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 19 April 2020 - 11:20 PM

@Olof

You are doing imho the right thing, as most tools (particularly simple/low level ones) will access partition entries in the MBR according to their position, not the actual order on disk.

 

@ppgrainbow

Sure you can use Tiny hexer after all it revolves around:

copy/paste the 16 bytes of the first entry in an empty slot or in another temporary file

copy/paste the next 16 bytes overwriting the first entry 

copy/paste from the temporary location the 16 bytes overwriting the second entry

if you used an empty slot fill it with 00's

 

but the proposed batch should make it easier.

 

:duff:

Wonko

 

Are the first 16 bytes located on the beginning of the primary partition and logical partitions? Just wondering.

 

I would like to see a proposed patch to make things easier so that I don't screw up.



#318 steve6375

steve6375

    Platinum Member

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

Posted 19 April 2020 - 11:34 PM

I think if you run Diskpart and just use it to 'look' at the drive and then exit, it will re-order and save the partitions for you.

 

e.g.

diskpart

list disk

select disk X  (where X is your disk)

list part

list vol

exit



#319 steve6375

steve6375

    Platinum Member

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

Posted 19 April 2020 - 11:37 PM

Or you can use RMPrepUSB which has a partition table swap function (Ctrl+O).

Enter 2 and it will swap ptn 2 with ptn 1. Or enter 0 to sort partitions in ascending order.

Use the Settings option so it sees non-USB drives and large drives.



#320 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 20 April 2020 - 01:47 AM

I think if you run Diskpart and just use it to 'look' at the drive and then exit, it will re-order and save the partitions for you.

 

e.g.

diskpart

list disk

select disk X  (where X is your disk)

list part

list vol

exit

 

Okay, I ran DISKPART, clicked on disk 8 and recognised the primary and logical partitions as drives I and J respectively. Here's the output:

Microsoft DiskPart version 6.3.9600

Copyright (C) 1999-2013 Microsoft Corporation.
On computer: M5A97R20

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          931 GB      0 B
  Disk 1    Online          931 GB      0 B
  Disk 2    Online           29 GB      0 B
  Disk 3    Online          931 GB      0 B
  Disk 4    Online         1953 MB      0 B
  Disk 5    Online         1862 GB  1024 KB
  Disk 6    Online         7629 MB      0 B
  Disk 7    Online          118 GB      0 B
  Disk 8    Online          504 MB      0 B

DISKPART> select disk 8

Disk 8 is now the selected disk.

DISKPART> list part

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    Primary            250 MB    31 KB
  Partition 0    Extended           252 MB   251 MB
  Partition 2    Logical            251 MB   251 MB

DISKPART> list vol

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     X                       DVD-ROM         0 B  No Media
  Volume 1     C                NTFS   Partition    931 GB  Healthy    System
  Volume 2     D                NTFS   Partition    931 GB  Healthy
  Volume 3         SDCFX-032G   FAT32  Removable     29 GB  Healthy
    C:\35BAYCF2SAT\boot\
  Volume 4     E                NTFS   Partition    931 GB  Healthy
  Volume 5         SDCFH-2048   FAT    Removable   1951 MB  Healthy
    C:\PCI2PCMCIA1E\boot\
  Volume 6     F                NTFS   Partition   1862 GB  Healthy
  Volume 7     H                FAT32  Removable   7624 MB  Healthy
  Volume 8     G                FAT32  Removable    118 GB  Healthy
  Volume 9     I   OS2          FAT    Partition    250 MB  Healthy
  Volume 10    J                FAT    Partition    251 MB  Healthy

DISKPART correctly reports partition 1 on disk 8 as the primary partition and partition 2 on disk 8 as the logical one.

 

Please note that DISKPART also lists volume 9 as drive I and volume 10 as drive J. Drive I is the OS/2 boot partition.

 

On a side note, exiting DISKPART didn't fix the partition numbering swap as IMDisk still listed the OS/2 primary partition as partition 2 and the logical partition as partition 1. :(


Edited by ppgrainbow, 20 April 2020 - 01:53 AM.


#321 steve6375

steve6375

    Platinum Member

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

Posted 20 April 2020 - 04:48 AM

Disk part is lying!
Basically, it is reporting what it would write to the disk, not what is actually on the disk now.
If you make any change to the disk partitions, e.g. change type number of one partition and then change it back again and then exit, it will reorder the partitions.

#322 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 20 April 2020 - 05:36 AM

Disk part is lying!
Basically, it is reporting what it would write to the disk, not what is actually on the disk now.
If you make any change to the disk partitions, e.g. change type number of one partition and then change it back again and then exit, it will reorder the partitions.

 

Well, the only way that I can re-order the partitions is deleting the partitions in question and re-creating them using the MS-DOS FDISK utility which will correctly order the disk partition number in IMDisk after formatting the drive.



#323 steve6375

steve6375

    Platinum Member

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

Posted 20 April 2020 - 07:30 AM

Rmprepusb will reorder them for you, as I said before.

#324 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 20 April 2020 - 09:16 AM

Are the first 16 bytes located on the beginning of the primary partition and logical partitions? Just wondering.
 
I would like to see a proposed patch to make things easier so that I don't screw up.

No.
A partition table in the MBR is a set of 4 entries, each 16 bytes in length starting at offset 446 in the MBR, i.e.:
slot #0 (first slot) offset 446 length 16
slot #1 (second slot) offset 446+16=462 length 16
slot #2 (third slot) offset 446+2*16=478 length 16 
slot #3 (fourth slot) offaet 446+3*16=494 length 16
 
Normally the addresses in the slots are in the same order they have on disk, i.e. lower before, higher after, in your case the two partitions are swapped, i.e. addresses in slot #0 are higher than the ones on slot #1.
 

Well, the only way that I can re-order the partitions is deleting the partitions in question and re-creating them using the MS-DOS FDISK utility which will correctly order the disk partition number in IMDisk after formatting the drive.

No, no, NO!

 
The linked to batch (ptnfloat) will do (in this particular case where you have only 2 partitions), and - casually - uses the rawcopy by Olof.
 
Wimb wrote a program to re-order partitions, . USB_Part_Flip.exe (but it has to be seen if it applies on non-USB)
 
There is (was) another batch file (chptnord) I wrote while Wimb made his program (uses dsfo/dsfi and dumphex), I am attaching it just in case, together - for your convenience - with a hextools archive with dsfo, dsfi and dumphex, this also allows seeing the contents of the MBR partition table in a human readable format.
 
Steve6375 made a small grub4dos batch that would do the same:
http://reboot.pro/to...n-as-1st-entry/
 
But really. it is only about copying and pasting a few bytes as seen in my previous post.
 
:duff:
Wonko

Attached Files



#325 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 20 April 2020 - 05:09 PM

No.
A partition table in the MBR is a set of 4 entries, each 16 bytes in length starting at offset 446 in the MBR, i.e.:
slot #0 (first slot) offset 446 length 16
slot #1 (second slot) offset 446+16=462 length 16
slot #2 (third slot) offset 446+2*16=478 length 16 
slot #3 (fourth slot) offaet 446+3*16=494 length 16
 
Normally the addresses in the slots are in the same order they have on disk, i.e. lower before, higher after, in your case the two partitions are swapped, i.e. addresses in slot #0 are higher than the ones on slot #1.
 

No, no, NO!

 
The linked to batch (ptnfloat) will do (in this particular case where you have only 2 partitions), and - casually - uses the rawcopy by Olof.
 
Wimb wrote a program to re-order partitions, . USB_Part_Flip.exe (but it has to be seen if it applies on non-USB)
 
There is (was) another batch file (chptnord) I wrote while Wimb made his program (uses dsfo/dsfi and dumphex), I am attaching it just in case, together - for your convenience - with a hextools archive with dsfo, dsfi and dumphex, this also allows seeing the contents of the MBR partition table in a human readable format.
 
Steve6375 made a small grub4dos batch that would do the same:
http://reboot.pro/to...n-as-1st-entry/
 
But really. it is only about copying and pasting a few bytes as seen in my previous post.
 
:duff:
Wonko

 

Thank you. I'll try the batch files out and post the results when I can. :)







Also tagged with one or more of these keywords: imdisk, toolkit, ramdiskui, discutils, image file, mount

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users