henrikstengaard / hst-imager

Hst Imager is an imaging tool to read and write disk images to and from physical drives
MIT License
21 stars 1 forks source link

Possible format issue with two FSes in the RDB #7

Closed roc-eab closed 1 year ago

roc-eab commented 1 year ago

Hi Henrik,

Normally one FileSystem in the RDB is more than enough, however there is another corner-case where this is not sufficient.

The A3000 Dual Boot (1.3 plus 3.2.x) with the KS 1,4, requires the first two partitions to be DOS1 (WB_1.3 and WB_2.x) with the FFS up to the 40.1. The second is the one where the superkickstart is.

The last two 3.2.x partitions can be PFS3.

Unfortunately with two FSes in the RDB, there are no errors during the creation of the image and the formatting of partitions, but (unless I am doing something wonky ) the last two are not mountable/formatted.

Would it be possible allowing two FS in the RDB?

Thank you in advance for your help!

image

These are the commands. I tried both PFS3 and PDS3.

hst.imager.exe blank WB3000.hdf 32GB hst.imager.exe rdb init WB3000.hdf --size 99% hst.imager.exe rdb fs add WB3000.hdf pfs3aio PFS3 hst.imager.exe rdb fs add WB3000.hdf FFS_v401 DOS1 hst.imager.exe rdb part add WB3000.hdf WB_1.3 DOS1 1GB --max-transfer 0x0001fe00 --mask 0x7ffffffe --buffers 80 --bootable --boot-priority 0 hst.imager.exe rdb part add WB3000.hdf WB_2.x DOS1 0.015GB --max-transfer 0x0001fe00 --mask 0x7ffffffe --buffers 80 --bootable --boot-priority 1 hst.imager.exe rdb part add WB3000.hdf DH0 PFS3 1GB --max-transfer 0x0001fe00 --mask 0x7ffffffe --buffers 80 hst.imager.exe rdb part add WB3000.hdf DH1 PFS3 * --max-transfer 0x0001fe00 --mask 0x7ffffffe --buffers 80 hst.imager.exe rdb part format WB3000.hdf 1 WB13 hst.imager.exe rdb part format WB3000.hdf 2 WB2x hst.imager.exe rdb part format WB3000.hdf 3 Workbench hst.imager.exe rdb part format WB3000.hdf 4 Data hst.imager.exe rdb info WB3000.hdf

henrikstengaard commented 1 year ago

I found the issue being related to how block pointers (which sectors contain the different parts of the RDB) are updated in the Rigid Disk Block before being written to disk.

This is fixed in v0.9.256, which is just released.

The resulting image looks fine now in WinUAE. Install3_001

Note I put all your commands in following text file a3000_dual_boot.txt:

blank WB3000.vhd 32GB
rdb init WB3000.vhd --size 99%
rdb fs import WB3000.vhd "c:\Users\Public\Documents\Amiga Files\Shared\adf\amiga-os-310-install.adf" --name FastFileSystem --dos-type DOS1
rdb fs add WB3000.vhd pfs3aio PFS3
rdb part add WB3000.vhd WB1 PFS3 1GB --max-transfer 0x0001fe00 --mask 0x7ffffffe --buffers 80 --bootable --boot-priority 0
rdb part add WB3000.vhd WB2 PFS3 0.015GB --max-transfer 0x0001fe00 --mask 0x7ffffffe --buffers 80 --bootable --boot-priority 1
rdb part add WB3000.vhd DH0 PFS3 1GB --max-transfer 0x0001fe00 --mask 0x7ffffffe --buffers 80
rdb part add WB3000.vhd DH1 PFS3 * --max-transfer 0x0001fe00 --mask 0x7ffffffe --buffers 80
rdb part format WB3000.vhd 1 WB1
rdb part format WB3000.vhd 2 WB2
rdb part format WB3000.vhd 3 Workbench
rdb part format WB3000.vhd 4 Data
rdb info WB3000.vhd

Then run all commands in one go as a script by typing hst.imager.exe script a3000_dual_boot.txt.

I also use 2 tricks in the script:

Here's the output from running the script:

[14:19:21 INF] Hst Imager v0.9.256 (12/06/2022 12:51:52)
[14:19:21 INF] Henrik Noerfjand Stengaard
[14:19:21 INF] [CMD] script a3000_dual_boot.txt
[14:19:21 INF] [CMD] blank WB3000.vhd 32GB
[14:19:21 INF] Creating blank image at 'WB3000.vhd'
[14:19:21 INF] Size '32 GB' (34359738368 bytes)
[14:19:21 INF] Done
[14:19:21 INF] [CMD] rdb init WB3000.vhd --size 99%
[14:19:21 INF] Initializing Rigid Disk Block at 'WB3000.vhd'
[14:19:21 INF] Rigid Disk Block size '31.7 GB' (34015887360 bytes)
[14:19:21 INF] Done
[14:19:21 INF] [CMD] rdb fs import WB3000.vhd c:\Users\Public\Documents\Amiga Files\Shared\adf\amiga-os-310-install.adf --name FastFileSystem --dos-type DOS1
[14:19:21 INF] Importing file systems from 'WB3000.vhd' to Rigid Disk Block at 'c:\Users\Public\Documents\Amiga Files\Shared\adf\amiga-os-310-install.adf'
[14:19:21 INF] Imported file system:
[14:19:21 INF] - DOS type '0x444F5301' (DOS\1)
[14:19:21 INF] - Version '40.1'
[14:19:21 INF] - Size '24 KB' (24588 bytes)
[14:19:21 INF] - File system name 'FastFileSystem'
[14:19:21 INF] Done
[14:19:21 INF] [CMD] rdb fs add WB3000.vhd pfs3aio PFS3
[14:19:21 INF] Adding file system to Rigid Disk Block at 'WB3000.vhd'
[14:19:21 INF] Adding file system:
[14:19:21 INF] - DOS type '0x50465303' (PFS\3)
[14:19:21 INF] - Version '19.2'
[14:19:21 INF] - Size '57.7 KB' (59120 bytes)
[14:19:21 INF] - File system name 'pfs3aio'
[14:19:21 INF] Done
[14:19:21 INF] [CMD] rdb part add WB3000.vhd WB1 PFS3 1GB --max-transfer 0x0001fe00 --mask 0x7ffffffe --buffers 80 --bootable --boot-priority 0
[14:19:21 INF] Adding partition to Rigid Disk Block at 'WB3000.vhd'
[14:19:21 INF] - Partition number '1'
[14:19:21 INF] - Name 'WB1'
[14:19:21 INF] - DOS type 'PFS\3'
[14:19:21 INF] - Size '1023.8 MB' (1073479680 bytes)
[14:19:21 INF] - Low Cyl '2'
[14:19:21 INF] - High Cyl '2081'
[14:19:21 INF] - Reserved '2'
[14:19:21 INF] - PreAlloc '0'
[14:19:21 INF] - Buffers '80'
[14:19:21 INF] - Max Transfer '0x0001FE00' (130560)
[14:19:21 INF] - Mask '0x7FFFFFFE' (2147483646)
[14:19:21 INF] - Bootable 'True'
[14:19:22 INF] - Boot priority '0'
[14:19:22 INF] - No mount 'False'
[14:19:22 INF] - File System Block Size '512'
[14:19:22 INF] Done
[14:19:22 INF] [CMD] rdb part add WB3000.vhd WB2 PFS3 0.015GB --max-transfer 0x0001fe00 --mask 0x7ffffffe --buffers 80 --bootable --boot-priority 1
[14:19:22 INF] Adding partition to Rigid Disk Block at 'WB3000.vhd'
[14:19:22 INF] - Partition number '2'
[14:19:22 INF] - Name 'WB2'
[14:19:22 INF] - DOS type 'PFS\3'
[14:19:22 INF] - Size '15.3 MB' (15998976 bytes)
[14:19:22 INF] - Low Cyl '2082'
[14:19:22 INF] - High Cyl '2112'
[14:19:22 INF] - Reserved '2'
[14:19:22 INF] - PreAlloc '0'
[14:19:22 INF] - Buffers '80'
[14:19:22 INF] - Max Transfer '0x0001FE00' (130560)
[14:19:22 INF] - Mask '0x7FFFFFFE' (2147483646)
[14:19:22 INF] - Bootable 'True'
[14:19:22 INF] - Boot priority '1'
[14:19:22 INF] - No mount 'False'
[14:19:22 INF] - File System Block Size '512'
[14:19:22 INF] Done
[14:19:22 INF] [CMD] rdb part add WB3000.vhd DH0 PFS3 1GB --max-transfer 0x0001fe00 --mask 0x7ffffffe --buffers 80
[14:19:22 INF] Adding partition to Rigid Disk Block at 'WB3000.vhd'
[14:19:22 INF] - Partition number '3'
[14:19:22 INF] - Name 'DH0'
[14:19:22 INF] - DOS type 'PFS\3'
[14:19:22 INF] - Size '1023.8 MB' (1073479680 bytes)
[14:19:22 INF] - Low Cyl '2113'
[14:19:22 INF] - High Cyl '4192'
[14:19:22 INF] - Reserved '2'
[14:19:22 INF] - PreAlloc '0'
[14:19:22 INF] - Buffers '80'
[14:19:22 INF] - Max Transfer '0x0001FE00' (130560)
[14:19:22 INF] - Mask '0x7FFFFFFE' (2147483646)
[14:19:22 INF] - Bootable 'False'
[14:19:22 INF] - Boot priority '0'
[14:19:22 INF] - No mount 'False'
[14:19:22 INF] - File System Block Size '512'
[14:19:22 INF] Done
[14:19:22 INF] [CMD] rdb part add WB3000.vhd DH1 PFS3 * --max-transfer 0x0001fe00 --mask 0x7ffffffe --buffers 80
[14:19:22 INF] Adding partition to Rigid Disk Block at 'WB3000.vhd'
[14:19:22 INF] - Partition number '4'
[14:19:22 INF] - Name 'DH1'
[14:19:22 INF] - DOS type 'PFS\3'
[14:19:22 INF] - Size '29.7 GB' (31851896832 bytes)
[14:19:22 INF] - Low Cyl '4193'
[14:19:22 INF] - High Cyl '65909'
[14:19:22 INF] - Reserved '2'
[14:19:22 INF] - PreAlloc '0'
[14:19:22 INF] - Buffers '80'
[14:19:22 INF] - Max Transfer '0x0001FE00' (130560)
[14:19:22 INF] - Mask '0x7FFFFFFE' (2147483646)
[14:19:22 INF] - Bootable 'False'
[14:19:22 INF] - Boot priority '0'
[14:19:22 INF] - No mount 'False'
[14:19:22 INF] - File System Block Size '512'
[14:19:22 INF] Done
[14:19:22 INF] [CMD] rdb part format WB3000.vhd 1 WB1
[14:19:22 INF] Formatting partition in Rigid Disk Block at 'WB3000.vhd'
[14:19:22 INF] - Name 'WB1'
[14:19:22 INF] - DOS type '0x50465303' (PFS\3)
[14:19:22 INF] - Volume name 'WB1'
[14:19:22 INF] Done
[14:19:22 INF] [CMD] rdb part format WB3000.vhd 2 WB2
[14:19:22 INF] Formatting partition in Rigid Disk Block at 'WB3000.vhd'
[14:19:22 INF] - Name 'WB2'
[14:19:22 INF] - DOS type '0x50465303' (PFS\3)
[14:19:22 INF] - Volume name 'WB2'
[14:19:22 INF] Done
[14:19:22 INF] [CMD] rdb part format WB3000.vhd 3 Workbench
[14:19:22 INF] Formatting partition in Rigid Disk Block at 'WB3000.vhd'
[14:19:22 INF] - Name 'DH0'
[14:19:22 INF] - DOS type '0x50465303' (PFS\3)
[14:19:22 INF] - Volume name 'Workbench'
[14:19:22 INF] Done
[14:19:22 INF] [CMD] rdb part format WB3000.vhd 4 Data
[14:19:22 INF] Formatting partition in Rigid Disk Block at 'WB3000.vhd'
[14:19:22 INF] - Name 'DH1'
[14:19:22 INF] - DOS type '0x50465303' (PFS\3)
[14:19:22 INF] - Volume name 'Data'
[14:19:23 INF] Done
[14:19:23 INF] [CMD] rdb info WB3000.vhd
[14:19:23 INF] Reading Rigid Disk Block information from 'WB3000.vhd'
[14:19:23 INF] Info read from 'WB3000.vhd':

Rigid Disk Block:

Product | Vendor   | Revision |    Size | Cylinders | Heads | Sectors | Block Size | Flags | Host Id | Rdb Block Lo | Rdb Block Hi
--------|----------|----------|---------|-----------|-------|---------|------------|-------|---------|--------------|-------------
WB3000  | HstImage | 0.1      | 31.7 GB |     65910 |    16 |      63 |        512 |     7 |       7 |            0 |         2015

File systems:

# | DOS Type           | Version | Name           |    Size
--|--------------------|---------|----------------|--------
1 | 0x444F5301 (DOS\1) | 40.1    | FastFileSystem |   24 KB
2 | 0x50465303 (PFS\3) | 19.2    | pfs3aio        | 57.7 KB

Partitions:

# | Name |      Size | LowCyl | HighCyl | Reserved | PreAlloc | Block Size | Buffers | DOS Type           | Max Transfer        | Mask                    | Bootable | No Mount | Priority
--|------|-----------|--------|---------|----------|----------|------------|---------|--------------------|---------------------|-------------------------|----------|----------|---------
1 | WB1  | 1023.8 MB |      2 |    2081 |        2 |        0 |        512 |      80 | 0x50465303 (PFS\3) | 0x0001FE00 (130560) | 0x7FFFFFFE (2147483646) | True     | False    |        0
2 | WB2  |   15.3 MB |   2082 |    2112 |        2 |        0 |        512 |      80 | 0x50465303 (PFS\3) | 0x0001FE00 (130560) | 0x7FFFFFFE (2147483646) | True     | False    |        1
3 | DH0  | 1023.8 MB |   2113 |    4192 |        2 |        0 |        512 |      80 | 0x50465303 (PFS\3) | 0x0001FE00 (130560) | 0x7FFFFFFE (2147483646) | False    | False    |        0
4 | DH1  |   29.7 GB |   4193 |   65909 |        2 |        0 |        512 |      80 | 0x50465303 (PFS\3) | 0x0001FE00 (130560) | 0x7FFFFFFE (2147483646) | False    | False    |        0

[14:19:23 INF] Done
roc-eab commented 1 year ago

Works great !

Now it works with two FS in the RDB.

As a side note: Thanks for the two tricks. They are both useful

Many thanks

roc-eab commented 1 year ago

Hi Henrik,

I am running out of ideas, which is good per-se because it means Hst-Imager does everything I need.

Nevertheless, If you need some beta-testing in some other area or could be of any help, just let me know and I am glad to help out.

Thank you for your great tool and the wonderful help.