Short: Search lost PFS/SFS partitions on a harddisk Uploader: thomas-rapp@t-online.de (Thomas Rapp) Author: thomas-rapp@t-online.de (Thomas Rapp) Type: disk/salv Version: 0.7 WARNING: This program was only tested on my machine with my harddisks. There is no guarantee that it runs on others. I am not responsible for any damage. Use it on your own risk. Use RDBrecov if you lost the RDB (partitioning information) of your harddisk. RDBrecov searches an entire harddisk for partitions. It can handle PFS2, PFS3, AFS and SFS partitions. Since V0.6 it also finds FFS partitions. As FFS needs the partition size for calculating the rootblock position, first all possible FFS bootblocks are stored in a table and in a second pass the rootblock positions are calculated and checked. FFS handling can be switched off by an option. RDBrecov lists the partitions found into the Shell window and optionaly into a log file. With this information you can use HDtoolbox (or another partitioning tool) to reconstruct your partitions. Harddisks larger than 4GB can be accessed, if the device driver is either NSD or TD64 compatible. SCSI-Direct is not supported. Installation ============ Copy the RDBrecov executable onto your Emergency Disk. If you have none, you can use the AmigaOS install disk. With OS3.5 there comes an option to create an Emergency Boot Disk. You should really use it. And make sure, your Emergency Disk works ! Note that you need a partitioning tool (e.g. HDToolBox) too ! As RDBrecov can only be started from Shell, be sure to have a Shell icon on your Emergency Disk. (IIRR the AmigaOS install disk has none). Usage ===== Most important rule after a harddisk crash: DON'T FORMAT ANYTHING !!! Formatting will destroy data. Even if Quick-Format is used. Boot with your Emergency disk. First of all you have to verify some info about your Harddisk. You must know the device name of your harddisk driver. Amiga default is scsi.device. Other manufacturers use other names like cybscsi.device. Please start your favorite partitioning tool (e.g. HDToolBox). You should use the same tool that you used when the harddisk was first partitioned ! Maybe you have to adjust some tooltypes to use the right device driver. Now choose your harddrive from the list. It should be shown as unknown in the list. Remember its Address, this is the unit number needed by RDBrecov. Now enter the install dialog (e.g. click on Install Drive). Ignore requesters stating that this would destroy all data. Let HDToolBox read the configuration from disk (e.g. click on Read Configuration). Now write down the data from the fields Cylinders, Blocks per Cylinder and Bytes per Block. Click on Cancel and leave HDToolbox. You should now have the following information (Example): Device: scsi.device Unit: 0 Cylinders: 7752 Blocks per Cylinders: 1008 Bytes per Block: 512 Now open a Shell window and start RDBrecov. Enter RDBrecov s c cs Example: RDBrecov scsi.device 0 s 512 c 7752 cs 1008 You should get an output like that: Trying to open scsi.device unit 0 SectorSize = 512 (overridden by parameter: 512) Cylinders = 7814016 (overridden by parameter: 7752) CylSectors = 1 (overridden by parameter: 1008) PFS Bootblock found at cylinder 2: Size = 204 cyls DosType=50465301 Name="Workbench" PFS Bootblock found at cylinder 206: Size = 407 cyls DosType=50465301 Name="Prog" PFS Bootblock found at cylinder 613: Size = 417 cyls DosType=50465301 Name="Internet" PFS Bootblock found at cylinder 1030: Size = 894 cyls DosType=50465301 Name="Games" PFS Bootblock found at cylinder 1924: Size = 1016 cyls DosType=50465301 Name="Pictures" PFS Bootblock found at cylinder 2940: Size = 570 cyls DosType=50465301 Name="Graphic" PFS Bootblock found at cylinder 3510: Size = 976 cyls DosType=50465301 Name="Music" PFS Bootblock found at cylinder 4486: Size = 693 cyls DosType=50465301 Name="cache" PFS Bootblock found at cylinder 5179: Size = 1627 cyls DosType=50465301 Name="Work" PFS Bootblock found at cylinder 6806: Size = 611 cyls DosType=50465301 Name="Emulator" PFS Bootblock found at cylinder 7417: Size = 335 cyls DosType=50465301 Name="Temp" Reading cylinder 7752 Complete. Now reenter HDToolBox and install your harddisk. Then use the Partition Drive dialog to recreate your partitions. You can enter the values from "at cylinder" and "Size" directly into the gadgets "Start Cyl" and "Total Cyl". Be sure not to define overlapping partitions ! If you encounter overlappings, you'll have to decide which ranges are correct from your memory. If the "Size =" portion is 0, just subtract the "at cylinder" of this partition from that of the next one. (One trick is to start at the end of the list and only enter the "Start Cyl" value. The size then is calculated by HDToolBox. This assumes that you don't have unused space on the harddisk.) NOTE: as FFS partitions are recognized in a second pass, their infos are behind the others in the log file. You might want to sort the log file before starting to use HDToolBox. If you use PFS or SFS, first follow the instuctions in the corresponding manual in order to install your filesystem on the harddisk and determine which data has to be used for Mask, MaxTransfer, Block size and DosType. Use the DosType listed by RDBrecov only if the DosType from the manual does not work ! Now remove the emergency disk and reboot. Everything should magically be there again. If one ore more partitions don't work, verify if you have installed the right filesystem, DosType, partition borders etc. Again: DO NOT FORMAT ANYTHING ! You may also experiment with the values for cylinders and blocks per cylinder. Different releases of HDtoolBox show different values here. You have to use the same values that were used when the harddisk was first partitioned. HINT: the first partition almost always starts at cylinder 2. Hint for freaks: if all partitions start on cylinder numbers which are divisible by 2, you can duplicate the CylSectors value and half the Cylinders value. By this the harddisk scan will be twice as fast. Remember to duplicate the cylinder numbers when using HDToolBox afterwards. If you encounter problems or mystic error messages you can try to mail me for assistance. But there is no guarantee that I can or want to help you. Parameters ========== DEVICE/A The device driver of your harddisk (e.g. scsi.device) UNIT/A/N The unit of your harddisk (e.g. 0) INFO/S If specified, RDBrecov only shows infos about the harddisk and does not search partitions. FILE Filename of a log file. If specified RDBrecov also writes the partition data into this file. S=SECTORSIZE/N/K Override infos of TD_GETGEOMETRY. May be necessary if C=CYLINDERS/N/K TD_GETGEOMETRY supplies different infos than HDToolBox. CS=CYLSECTORS/N/K NODOS=NOFFS/S Don't list FFS rootblocks. ONLYFFS/S List only FFS rootblocks. MAXPART/N/K Maximum number of partitions. Default is 100. Increase this if you see the message "More partitions than table entries !" START=STARTCYL/N/K Start searching at this cylinder. Can be used if you interrupted the search with CRTL-C or if you have a very large partition and aproximately know where the next one starts. NOTE: you cannot restart RDBrecov if you need FFS partition information ! NSD/S Force using NSD style commands. TD64/S Force using TD64 style commands. Error messages ============== OpenDevice failed The specified device name / unit combination could not be opened. Verify these values. cannot create IORequest cannot create reply port Usualy too less memory. Reboot and retry. device does not support NSD or TD64 for harddisks >4GB Seems that you use a device driver that is not ready for Harddisks larger than 4GB but uses SCSI-Direct for them. As I don't know about SCSI-Direct this is not implemented (yet). If you own OS3.5 or have NSDPatch installed, you can try to make an entry for your device in Devs:NSDPatch.cfg. TD_READ Error = (text) Read error on the disk. is the code returned by the DOS-device. If known, 'text' is a short description of the error. TD_GETGEOMETRY Error = (text) The device does not support the TD_GETGEOMETRY command. is the code returned by the device. If known, 'text' is a short description of the error. not enough memory for buffers RDBrecov needs memory for at least 3 disk blocks. More partitions than table entries ! Use the MAXPART parameter to increase the number of table entries or use the NOFFS switch if you do not need FFS partitions. Restrictions / Bugs =================== - A FFS partition is only recognized if it is immediately followed by another known partition. Otherwise the rootblock cannot be found. (Although those partitions are not logged, the start cylinder is written to the shell window as a possible FFS partition.) History ======= V0.5 Fixed TD_GETGEOMETRY handling. Now using dg_TotalSectors instead of dg_Cylinders. V0.6 RDBrecov can now handle FFS partitions too. V0.7 Errors using TD_GETGEOMETRY are now ignored when all size parameters are given. (If you really follow the above instructions, they are always given.)