|
|
|
Routine to BACKUP and RESTORE key sectors of a FAT32 Hard Disk
Showing all messages in thread #1218129520 Windows Me Annoyances Discussion Forum
The following are all of the messages in this thread (4 in all), shown in chronological order. Click any message subject to view that message by itself or to view the thread hierarchy.
|
Routine to BACKUP and RESTORE key sectors of a FAT32 Hard Disk
Thursday, August 7, 2008 at 10:18 am Posted by Ed
(741 messages posted)
Routine to BACKUP and RESTORE key sectors of a FAT32 Hard Disk
on a system with up to two Hard Disks, each with up to four Partitions
This routine is an essential precaution for anyone using a FAT32 disk
with Windows 9x (Windows 95 OSR2, Windows 98, Windows 98SE, Windows ME)
Build a BATCH file, by selecting the options (below) that are appropriate
for your system, to backup the key sectors of your Hard Disk(s) that hold
the disk's structure information. For most of those sectors, this only
need be done once. But you should make a backup of the FAT (File Allocation
Table) every day, as part of the boot/startup process.
DOS Utilities needed:
Svend's CYLDIR, v5.5: CYLDIR.EXE
Svend's FINDPART for DOS, v4.72: FINDPART.EXE
Odi's LCOPY for long file names, v1.75 (English): LCOPY.EXE
Odi's LDIR for long file names, v1.75 (English): LDIR.EXE
PowerQuest's MBR Utility for DOS, (c) 2002: MBRutilD.EXE
Star-Tools Partition Information program, v1.04: PARTINFO.EXE
PowerQuest's Partition Table Editor for DOS, v1.0: PTEDIT.EXE
Serial Copy, (c) 1996 Future Publishing: SERCOPY.COM
SRCFat v1.3, (c) 2001 The WOrm: SRCFAT.COM
DOS Device Drivers needed:
USB 1.1 drivers for DOS, Panasonic / Motto Hairu: USBASPI.SYS & Di1000DD.SYS
(Further info: Computing.net Forum - USB 2.0 drivers for DOS)
FUNCTION: Save & Restore MBR (BPB, IPL & Partition Table),
Track 1, Partition Boot Records, FATs 1 & 2
*** Set Path ***
Set DOSpath=%PATH%
PATH ;
Set PATH=C:\;C:\WINDOWS;C:\WINDOWS\COMMAND
*** Disk Cache for MS-DOS Mode ***
* To make the routine run faster *
SMARTDRV.EXE 4096 16>nul
SAVE a sector
===============
This routine is designed to work with -
Svend's Utilities: FINDPART for DOS (version 4.72)
Svend's Utilities: FINDPART for Windows (version 4.95 for FAT32)
*** Preparation ***
1. Make an empty directory (C:\SAVED\DATA) to store the output files.
2. Make an empty directory on a USB Disk (at F:\SAVED\DATA) to store
a BACKUP copy of the output files.
Note:
The main directory holding saved sectors is C:\SAVED\DATA
Disk Structure notes
=======================
FILES & CLUSTERS:
Each file occupies 1 cluster. In FAT32 the default cluster size is -
Partition size Cluster size
-------------- ------------
Up to 8 GB 4K
Up to 16 GB 8K
Up to 32 GB 16K
Over 32 GB 32K
The maximum number of valid clusters in a partition is:
((# of Sectors in Partition) - (# of Sectors per Fat * 2) - (# of Reserved Sectors))
/ (# of Sectors per Cluster)
If there is any remainder in the answer to that formula, it just
means there were a few extra sectors at the end of the partition
(not enough to make another cluster).
PARTITION TYPES:
In the Partition Table, ID types for 32-bit FAT -
05(hex) = Extended Partition [Contains logical partitions]
0B(hex) = FAT32 Partition
0C(hex) = FAT32 Extended Partition
(FAT32X) (FAT32, LBA-mapped, Extended-INT13 equivalent of 0B)
0F(hex) = Extended partition, LBA-mapped
(Win9x uses type 0F as the extended-INT13 equivalent of type 05,
but type 0F can cause DATA LOSS, in going back and forth between
DOS and Windows)
1B(hex) = Hidden FAT32 Partition
1C(hex) = Hidden FAT32 Partition, LBA-mapped
(sometimes used in hidden IBM rescue partitions)
LOGICAL BLOCK ADDRESSING (LBA):
LBA = (Sector - 1) + (Head * Total Sectors) + (Cylinder * (Total Heads + 1) * Total
Sectors)
NON-DOS PARTITION:
The first Track on the Disk: 63 sectors (CHS 0-0-1 to 0-0-63).
Track 1 (in Cylinder 0) starts at sector 1 (CHS 0-0-1) and
ends at sector 63 (CHS 0-0-63). This is the hidden 63 sectors
(Non-DOS Partition) at the start of the disk which holds
the Master Boot Record & Partition Table for the entire Disk.
Sector 1 (CHS 0-0-1), Boot Sector or Master Boot Record (MBR):
Initial Program Loader (IPL) code, BIOS Parameter Block (BPB),
and Partition Table. Located at 0000 hex.
All other sectors are usually blank; but special backup software
sometimes stores recovery data in the 60 empty sectors, so it is
prudent to make a backup copy of ALL the 63 sectors of Track 1.
(a) Sector 3 (CHS 0-0-3) (at 0400 hex) may contain data.
(b) Sector 9 (CHS 0-0-9) (at 1000 hex) may be a backup copy of the
MBR sector (CHS 0-0-1), starting with the marker "90 E9 7D".
(c) Sector 62 (CHS 0-0-62) (at 7A00 hex) may contain data.
(d) Sector 63 (CHS 0-0-63) (at 7C00 hex) may contain data.
Partition Table -
The Partition Table (64 bytes) contains four 16-byte entries,
one for each of the four partitions allowed under DOS/Windows.
The format of each 16-byte entry (see PTEDIT.EXE) is:
- Boot indicator and BIOS drive number
(1 byte, must be 00 or greater than 80)
- Starting head number (1 byte, 0 to 255)
- Starting cylinder number (10 bits, 0 to 1023) and
starting sector number (6 bits, 1 to 63, 0 being invalid)
- System indicator (1 byte)
- Ending head number (1 byte, 0 to 255)
- Ending cylinder number (10 bits, 0 to 1023) and
ending sector number (6 bits, 1 to 63, 0 being invalid)
- Starting sector, relative to beginning of disk (4 bytes)
- Number of sectors in the partition (4 bytes)
The four partitions are scattered along the disk, connected by
a linked list of partition table sectors, starting with the MBR.
The 'Ending cylinder number' is meaningless. 'Starting sector'
and 'Number of sectors in the partition' are enough to identify
the partition: System Indicator type 0F uses INT 13 Extensions
which use those two numbers as LBA addresses and don't use the
other INT 13 CHS numbers.
PRIMARY PARTITION:
The first partition on the Disk that is recognisable by DOS
and Windows. Starts at sector 64 (CHS 0-1-1) (LBA sector 63).
NB: The LBA sector numbering starts at 0, whereas CHS sector
numbering starts at 1; hence there is a discrepancy of 1.
Sector 64 (at 7E00 hex) (the Boot Record):
This sector (CHS 0-1-1) is the start of Track 2, and also
the start of the Primary Partition (as defined at CHS 0-0-1).
This sector contains the Boot Record for the partition (even
if this partition is not set as the active bootable partition
in the Partition Table in sector 0-0-1).
NB: Only the Primary Partition is bootable. A Logical Partition
can *NOT* be set as "active" (i.e. bootable).
Sector 65 (at 8000 hex) (FS Info Sector):
This sector (CHS 0-1-2) is the File System Information Sector.
NB: The MBR (at CHS 0-0-1) provides that the Root Directory
starts in the first sector of cluster 2. This is that sector:
there are 64 sectors per cluster, as a partition exceeding
32GB must use 32K clusters, and 1 sector = 0.5K (512 bytes).
Sector 66 (at 8200 hex) (the 3rd sector of this partition)
contains data (starting with the marker "FA 66 OF").
Sector 70 (at 8A00 hex) (the 7th sector of this partition)
contains a BACKUP copy of sector 64.
Sector 71 (at 8C00 hex) (the 8th sector of this partition)
contains a BACKUP copy of sector 65.
Sector 72 (at 8E00 hex) (the 9th sector of this partition)
contains a BACKUP copy of sector 66. Sectors 73 to 95 are blank.
The 1st FAT starts at sector 96 (CHS 0-1-33) (at BE00 hex),
with a 4-byte marker "F8 FF FF FF".
Boot Record:
The extended BPB (BIOS Parameter Block) structure under FAT32
in the 1st sector of the Primary Partition (CHS 0-1-1):
Size Comment Example
------- --------------------------------------------- --------
2 bytes Jump instruction (jump to IPL boot code) EB58
1 byte NOP instruction 90
8 bytes OEM ID - Name of formatting Operating System MSWIN4.1
(start of BPB in FAT32)
2 bytes Bytes per sector [200(hex) = 512] 200h
1 byte Sectors per cluster [40(hex) = 64 (i.e.32KB)] 40h
2 bytes Number of reserved sectors: number of sectors 20h
before first FAT (not all are used on current
implementations). Two sectors are used for
primary boot sector, two sectors are used for
a backup copy of the boot sector, and other
sectors may be used for an FS Info Sector.
[NB: 20(hex) = 32 sectors]
1 byte Number of File Allocation Tables (usually 2) 2h
2 bytes No. of Root Directory entries (N/A in FAT32) 0000
2 bytes Total number of sectors (Not used in FAT32) 0000
1 byte Media Descriptor (F8 in FAT32) F8h
2 bytes Number of Sectors per FAT (Not used in FAT32) 0000
2 bytes Number of Sectors per Track [3F(hex) = 63] 3Fh
2 bytes Number of Heads [FF(hex) = 255] FFh
4 bytes Number of hidden sectors [3F(hex) = 63] 3Fh
[NB: Sectors CHS 0-0-1 to 0-0-63, i.e. Track 1]
4 bytes Big Number of Sectors (The number of sectors
in this partition)
4 bytes Big Number of Sectors per FAT (The number of
sectors per FAT)
2 bytes FAT handling flag (Enables FAT mirroring, 0000h
if set. If mirroring is enabled, all copies
(i.e. both copies) of the FAT are updated)
2 bytes File system version 0000h
4 bytes Start cluster of root directory (usually 2) 2h
2 bytes File system info sector (FS Info Sector) 0002h
2 bytes Backup boot sector 0006h
12 bytes Reserved 00 (all)
(end of BPB in FAT32)
(start of Extended BPB)
1 byte Drive number (80h = Drive C:) (81h = Drive D:) 80h
1 byte Reserved 00h
1 byte Boot signature (29h if it's an extended boot 29h
signature record)
4 bytes Boot sector Volume ID EE5h
11 bytes Disk Volume ID (Some bytes may be spaces, 20h) DRIVE C
8 bytes File system type FAT32
(end of Extended BPB)
Total = 90 bytes (Address 00h to 59h, inclusive)
The final 420 bytes is the IPL (Initial Program Loader) boot code
(which passes control to the Operating System installed in the
active Partition), the Partition Table, and the 2 signature bytes
(AA55h) that mark the end of the Boot Record.
Note: Wherever an entry comprises 2 or more bytes, as usual
these are read from right-to-left (i.e. little endian).
Jump Instruction (2 bytes):
Instructs computer to jump over the BPB (Bios Parameter Block) to
the first byte of executable code (the first byte after the BPB
and Extended BPB). The jump is 88 bytes (58 hex), to byte 5A(hex),
the first byte of the Initial Program Loader code.
FS Info Sector:
File System Information Sector (FS Info Sector) (CHS 0-1-2)
Usually the second sector of the partition. There is a reference
in the partition's Boot Record identifying its location.
Offset Description Size
------ -------------------------------------------- ---------
00h First Signature (52h 52h 61h 41h) 4 bytes
04h Unknown or Null (all 00h) 480 bytes
1E4h Signature of FSInfo Sector (72h 72h 41h 61h) 4 bytes
1E8h Number of Free Clusters (-1 if unknown) 4 bytes
1ECh Cluster # of cluster most recently allocated) 4 bytes
1F0h Reserved (all 00h) 12 bytes
1FCh Unknown or Null (00h 00h) 2 bytes
1FEh Boot Record Signature (55h AAh) 2 bytes
Example: 80GB HDD
FAT size for an 80GB partition = e.g. 19,075 sectors
Thus FATs 1 and 2 = 19,075 x 2 = 38,150 sectors (or 19,075K)
The 1st FAT begins at CHS 0-1-33. This address is calculated
by taking the address of the first sector in the partition and
adding the number of hidden sectors for the partition.
The 2nd FAT begins at sector 19,171 (CHS 1-49-19) (95C400 hex)
because 19,075 + 95 = 19,170 (as there are 95 sectors before
the 1st FAT).
The 2nd FAT ends at sector 38,150 + 95 = sector 38,245
Thus file data could begin at sector 38,246 (12ACC00 hex).
File data actually begins at sector 38,310 (at 12B4A00 hex),
i.e. 65 sectors later, leaving 64 empty sectors (1 cluster)
separating the end of the 2nd FAT from the start of file data.
So it would be prudent to make a backup of sectors 1 to 38,309.
More file data starts at 12C4A00 hex: i.e. a file is beginning
every 65,536 bytes (10000 hex), i.e. every 64K (2 Clusters).
SYNTAX of FINDPART.EXE -
First is the number of the Disk (numbered from 1), e.g. 1
Next is the CHS number, e.g. 0 0 1
Next is the number of sectors to save, e.g. 1
Next specify a destination file, e.g. on Drive A: (floppy)
The option NOHEADER means only the actual data will be written,
not the identifying fileheader added by the GETSECT program
The option BADF6 means the program will write character F6 (hex)
for all bytes that can't be read (something that will only occur
if the Disk is physically damaged)
DISK 1
=======
NON-DOS PARTITION:
*** Saves Sector 0-0-1 (Master Boot Record & Partition Table) **
FINDPART GETSECT 1 0 0 1 1 0-0-1.D1 noheader badf6
*** Saves Sector 0-0-3 (Sector 3 of Track 1) ***
FINDPART GETSECT 1 0 0 3 1 0-0-3.D1 noheader badf6
*** Saves Sector 0-0-62 (Sector 62 of Track 1) ***
FINDPART GETSECT 1 0 0 62 1 0-0-62.D1 noheader badf6
*** Saves Sector 0-0-63 (Sector 63 of Track 1) ***
FINDPART GETSECT 1 0 0 63 1 0-0-63.D1 noheader badf6
*** Saves Sector 0-0-1 to 0-0-63 (Hidden Non-DOS Partition) ***
FINDPART GETSECT 1 0 0 1 63 0-0-1-63.D1 noheader badf6
NB: The above sectors only need to be saved ONCE **
as their values are permanent! **
PRIMARY PARTITION:
*** Saves Sector 0-1-1 (Boot Record) ***
FINDPART GETSECT 1 0 1 1 1 0-1-1.D1 noheader badf6
*** Saves Sector 0-1-2 (FS Info Sector) ***
FINDPART GETSECT 1 0 1 2 1 0-1-2.D1 noheader badf6
*** Saves Sector 0-1-3 (Root Directory) ***
FINDPART GETSECT 1 0 1 3 1 0-1-3.D1 noheader badf6
*** Saves Sector 0-1-1 to 0-1-32 (First 32 sectors) ***
FINDPART GETSECT 1 0 1 1 32 0-1-1-32.D1 noheader badf6
NB: The above sectors only need to be saved ONCE
as their values are permanent!
*** Saves Sector 96 onward: FAT 1 & 2 ***
** Number of sectors to save = Big Sectors Per FAT **
The value of "Big Sectors Per FAT" is displayed by
the 32bit version of PowerQuest Partition Table Editor)
- Check this value in DOS with PTEDIT.EXE (the earlier
version, PowerQuest Partition Table Editor for DOS v1.0)
(e.g. ST380011A HDD = 19,075)
- Check start sector (CHS) of 2nd FAT with FINDPART.EXE
** Needs to be saved daily, as FAT details change constantly **
** This will be a BIG file, so do NOT save it to floppy **
FINDPART GETSECT 1 0 1 33 19075 FAT1.D1 noheader badf6
FINDPART GETSECT 1 1 49 19 19075 FAT2.D1 noheader badf6
*** PowerQuest Partition Table Editor for DOS ***
*** Check value of "Big Sectors Per FAT" ***
MOUSE.EXE
PTEDIT.EXE
*** Find start sector of 2nd FAT (Primary Partition only) ***
FINDPART FINDFAT 1 0 1 FAT_CHS1.TXT
DISK 2
=======
NON-DOS PARTITION:
*** Saves Sector 0-0-1 (Master Boot Record & Partition Table) **
FINDPART GETSECT 2 0 0 1 1 0-0-1.D2 noheader badf6
*** Saves Sector 0-0-3 (Sector 3 of Track 1) ***
FINDPART GETSECT 2 0 0 3 1 0-0-3.D2 noheader badf6
*** Saves Sector 0-0-62 (Sector 62 of Track 1) ***
FINDPART GETSECT 2 0 0 62 1 0-0-62.D2 noheader badf6
*** Saves Sector 0-0-63 (Sector 63 of Track 1) ***
FINDPART GETSECT 2 0 0 63 1 0-0-63.D2 noheader badf6
*** Saves Sector 0-0-1 to 0-0-63 (Hidden Non-DOS Partition) ***
FINDPART GETSECT 2 0 0 1 63 0-0-1-63.D2 noheader badf6
NB: The above sectors only need to be saved ONCE **
as their values are permanent! **
PRIMARY PARTITION:
*** Saves Sector 0-1-1 (Boot Record) ***
FINDPART GETSECT 2 0 1 1 1 0-1-1.D2 noheader badf6
*** Saves Sector 0-1-2 (FS Info Sector) ***
FINDPART GETSECT 2 0 1 2 1 0-1-2.D2 noheader badf6
*** Saves Sector 0-1-3 (Root Directory) ***
FINDPART GETSECT 2 0 1 3 1 0-1-3.D2 noheader badf6
*** Saves Sector 0-1-1 to 0-1-32 (First 32 sectors) ***
FINDPART GETSECT 2 0 1 1 32 0-1-1-32.D2 noheader badf6
NB: The above sectors only need to be saved ONCE **
as their values are permanent! **
*** Saves Sector 96 onward: FAT 1 & 2 ***
** Number of sectors to save = Big Sectors Per FAT **
The value of "Big Sectors Per FAT" is displayed by
the 32bit version of PowerQuest Partition Table Editor)
- Check this value in DOS with PTEDIT.EXE (the earlier
version: PowerQuest Partition Table Editor for DOS)
(e.g. 9,264)
- Check start sector (CHS) of 2nd FAT with FINDPART.EXE
** Needs to be saved daily, as FAT details change constantly **
** This will be a BIG file, so do NOT save it to floppy **
FINDPART GETSECT 2 0 1 33 9264 FAT1.D2 noheader badf6
FINDPART GETSECT 2 0 148 36 9264 FAT2.D2 noheader badf6
*** PowerQuest Partition Table Editor for DOS ***
*** Check value of "Big Sectors Per FAT" ***
MOUSE.EXE
PTEDIT.EXE
*** Svend's FINDPART: FindFAT Option ***
*** Find start sector of 2nd FAT (Primary Partition only) ***
FINDPART FINDFAT 2 0 1 FAT_CHS2.TXT
/---------------------------------------------------------------/
EXTENDED partition notes
===========================
A FAT32 disk has a MAXIMUM of four partitions:
1 x Primary DOS Partition
1 x Extended Partition, containing up to 3 Logical Partitions
On a FAT32 disk, the second entry in the MBR Partition Table
at CHS 0-0-1 shows where the Extended Partition is.
Go to the start of the Extended Partition, and read its first
sector. This acts just like the MBR in sector 0-0-1, but has
blanks instead of code in some locations. Where the Partition
Table should be, the first entry is the 1st Logical partition.
If there are any more partitions, the second entry points to
another Extended Partition. All references to Sector Numbers
use the MBR sector of the Extended Partition as the start point.
A Logical Partition is structured like the Primary Partition:
- Sector 1 is the Boot Record
- Sector 2 is the File System Information Sector
- Sector 3 is the Root Directory
Logical drives are not bootable.
EXTENDED Partition
====================
DISK 1
=======
1st Logical Partition -
*** Save Boot Record ***
** User must insert CHS value (from sector 0-0-1) of 1st sector **
FINDPART GETSECT 1 _____ ___ __ 1 L1_1st.D1 noheader badf6
*** Save FS Info Sector ***
** User must insert CHS value of 2nd sector of this Partition **
FINDPART GETSECT 1 _____ ___ __ 1 L1_2nd.D1 noheader badf6
*** Save Root Directory ***
** User must insert CHS value of 3rd sector of this Partition **
FINDPART GETSECT 1 _____ ___ __ 1 L1_3rd.D1 noheader badf6
*** Save first 32 sectors of Partition ***
** User must insert CHS value (from sector 0-0-1) of 1st sector **
FINDPART GETSECT 1 _____ ___ __ 32 L1_1-32.D1 noheader badf6
NB: The above sectors only need to be saved ONCE **
as their values are permanent! **
*** Saves Sector 96 onward: FAT 1 & 2 ***
** Number of sectors to save = Big Sectors Per FAT **
The value of "Big Sectors Per FAT" is displayed by
the 32bit version of PowerQuest Partition Table Editor)
- Check this value in DOS with PTEDIT.EXE (the earlier
version: PowerQuest Partition Table Editor for DOS)
** User must insert CHS value of 33rd sector of this Partition **
FINDPART GETSECT 1 _____ ___ 33 _____ L1_FAT1.D1 noheader badf6
** User must find CHS start sector of 2nd FAT with FINDPART.EXE
FINDPART GETSECT 1 _____ ___ __ _____ L1_FAT2.D1 noheader badf6
** Need to be saved daily, as FAT details change constantly **
** These will be BIG files, so do NOT save them to floppy! **
*** PowerQuest Partition Table Editor for DOS ***
*** Check value of "Big Sectors Per FAT" ***
MOUSE.EXE
PTEDIT.EXE
*** Find CHS start sector of 2nd FAT with FINDPART.EXE ***
** Reports starting sector (CHS) and size (sectors) **
** of all FATs on the Disk (Primary & Logical) **
FINDPART FINDFAT 1 comprehensive FAT_DSK1.TXT
FINDPART FINDFAT 2 comprehensive FAT_DSK2.TXT
2nd Logical Partition -
*** Save Boot Record ***
** User insert CHS value from 1st sector of 1st Logical Partition *
FINDPART GETSECT 1 _____ ___ __ 1 L2_1st.D1 noheader badf6
*** Save FS Info Sector ***
** User must insert CHS value of 2nd sector of this Partition **
FINDPART GETSECT 1 _____ ___ __ 1 L2_2nd.D1 noheader badf6
*** Save Root Directory ***
** User must insert CHS value of 3rd sector of this Partition **
FINDPART GETSECT 1 _____ ___ __ 1 L2_3rd.D1 noheader badf6
*** Save first 32 sectors of Partition ***
** User insert CHS value from 1st sector of 1st Logical Partition *
FINDPART GETSECT 1 _____ ___ __ 32 L2_1-32.D1 noheader badf6
NB: The above sectors only need to be saved ONCE **
as their values are permanent! **
*** Saves Sector 96 onward: FAT 1 & 2 ***
** Number of sectors to save = Big Sectors Per FAT **
The value of "Big Sectors Per FAT" is displayed by
the 32bit version of PowerQuest Partition Table Editor)
- Check this value in DOS with PTEDIT.EXE (the earlier
version: PowerQuest Partition Table Editor for DOS)
** User must insert CHS value of 33rd sector of this Partition **
FINDPART GETSECT 1 _____ ___ 33 _____ L2_FAT1.D1 noheader badf6
** User must find CHS start sector of 2nd FAT with FINDPART.EXE
FINDPART GETSECT 1 _____ ___ __ _____ L2_FAT2.D1 noheader badf6
** Need to be saved daily, as FAT details change constantly **
** These will be BIG files, so do NOT save them to floppy! **
*** PowerQuest Partition Table Editor for DOS ***
*** Check value of "Big Sectors Per FAT" ***
MOUSE.EXE
PTEDIT.EXE
*** Find CHS start sector of 2nd FAT with FINDPART.EXE ***
** Reports starting sector (CHS) and size (sectors) **
** of all FATs on the Disk (Primary & Logical) **
FINDPART FINDFAT 1 comprehensive FAT_DSK1.TXT
FINDPART FINDFAT 2 comprehensive FAT_DSK2.TXT
3rd Logical Partition -
*** Save Boot Record ***
** User insert CHS value from 1st sector of 2nd Logical Partition *
FINDPART GETSECT 1 _____ ___ __ 1 L3_1st.D1 noheader badf6
*** Save FS Info Sector ***
** User must insert CHS value of 2nd sector of this Partition **
FINDPART GETSECT 1 _____ ___ __ 1 L3_2nd.D1 noheader badf6
*** Save Root Directory ***
** User must insert CHS value of 3rd sector of this Partition **
FINDPART GETSECT 1 _____ ___ __ 1 L3_3rd.D1 noheader badf6
*** Save first 32 sectors of Partition ***
** User insert CHS value from 1st sector of 2nd Logical Partition *
FINDPART GETSECT 1 _____ ___ __ 32 L3_1-32.D1 noheader badf6
NB: The above sectors only need to be saved ONCE **
as their values are permanent! **
*** Saves Sector 96 onward: FAT 1 & 2 ***
** Number of sectors to save = Big Sectors Per FAT **
The value of "Big Sectors Per FAT" is displayed by
the 32bit version of PowerQuest Partition Table Editor)
- Check this value in DOS with PTEDIT.EXE (the earlier
version: PowerQuest Partition Table Editor for DOS)
** User must insert CHS value of 33rd sector of this Partition **
FINDPART GETSECT 1 _____ ___ 33 _____ L3_FAT1.D1 noheader badf6
** User must find CHS start sector of 2nd FAT with FINDPART.EXE
FINDPART GETSECT 1 _____ ___ __ _____ L3_FAT2.D1 noheader badf6
** Need to be saved daily, as FAT details change constantly **
** These will be BIG files, so do NOT save them to floppy! **
*** PowerQuest Partition Table Editor for DOS ***
*** Check value of "Big Sectors Per FAT" ***
MOUSE.EXE
PTEDIT.EXE
*** Find CHS start sector of 2nd FAT with FINDPART.EXE ***
** Reports starting sector (CHS) and size (sectors) **
** of all FATs on the Disk (Primary & Logical) **
FINDPART FINDFAT 1 comprehensive FAT_DSK1.TXT
FINDPART FINDFAT 2 comprehensive FAT_DSK2.TXT
DISK 2
=======
1st Logical Partition -
*** Save Boot Record ***
** User must insert CHS value (from sector 0-0-1) of 1st sector **
FINDPART GETSECT 2 _____ ___ __ 1 L1_1st.D2 noheader badf6
*** Save FS Info Sector ***
** User must insert CHS value of 2nd sector of this Partition **
FINDPART GETSECT 2 _____ ___ __ 1 L1_2nd.D2 noheader badf6
*** Save Root Directory ***
** User must insert CHS value of 3rd sector of this Partition **
FINDPART GETSECT 2 _____ ___ __ 1 L1_3rd.D2 noheader badf6
*** Save first 32 sectors of Partition ***
** User must insert CHS value (from sector 0-0-1) of 1st sector **
FINDPART GETSECT 2 _____ ___ __ 32 L1_1-32.D2 noheader badf6
NB: The above sectors only need to be saved ONCE **
as their values are permanent! **
*** Saves Sector 96 onward: FAT 1 & 2 ***
** Number of sectors to save = Big Sectors Per FAT **
The value of "Big Sectors Per FAT" is displayed by
the 32bit version of PowerQuest Partition Table Editor)
- Check this value in DOS with PTEDIT.EXE (the earlier
version: PowerQuest Partition Table Editor for DOS)
** User must insert CHS value of 33rd sector of this Partition **
FINDPART GETSECT 2 _____ ___ 33 _____ L1_FAT1.D2 noheader badf6
** User must find CHS start sector of 2nd FAT with FINDPART.EXE
FINDPART GETSECT 2 _____ ___ __ _____ L1_FAT2.D2 noheader badf6
** Need to be saved daily, as FAT details change constantly **
** These will be BIG files, so do NOT save them to floppy! **
*** PowerQuest Partition Table Editor for DOS ***
*** Check value of "Big Sectors Per FAT" ***
MOUSE.EXE
PTEDIT.EXE
*** Find CHS start sector of 2nd FAT with FINDPART.EXE ***
** Reports starting sector (CHS) and size (sectors) **
** of all FATs on the Disk (Primary & Logical) **
FINDPART FINDFAT 1 comprehensive FAT_DSK1.TXT
FINDPART FINDFAT 2 comprehensive FAT_DSK2.TXT
2nd Logical Partition -
*** Save Boot Record ***
** User insert CHS value from 1st sector of 1st Logical Partition *
FINDPART GETSECT 2 _____ ___ __ 1 L2_1st.D2 noheader badf6
*** Save FS Info Sector ***
** User must insert CHS value of 2nd sector of this Partition **
FINDPART GETSECT 2 _____ ___ __ 1 L2_2nd.D2 noheader badf6
*** Save Root Directory ***
** User must insert CHS value of 3rd sector of this Partition **
FINDPART GETSECT 2 _____ ___ __ 1 L2_3rd.D2 noheader badf6
*** Save first 32 sectors of Partition ***
** User insert CHS value from 1st sector of 1st Logical Partition *
FINDPART GETSECT 2 _____ ___ __ 32 L2_1-32.D2 noheader badf6
NB: The above sectors only need to be saved ONCE **
as their values are permanent! **
*** Saves Sector 96 onward: FAT 1 & 2 ***
** Number of sectors to save = Big Sectors Per FAT **
The value of "Big Sectors Per FAT" is displayed by
the 32bit version of PowerQuest Partition Table Editor)
- Check this value in DOS with PTEDIT.EXE (the earlier
version: PowerQuest Partition Table Editor for DOS)
** User must insert CHS value of 33rd sector of this Partition **
FINDPART GETSECT 2 _____ ___ 33 _____ L2_FAT1.D2 noheader badf6
** User must find CHS start sector of 2nd FAT with FINDPART.EXE
FINDPART GETSECT 2 _____ ___ __ _____ L2_FAT2.D2 noheader badf6
** Need to be saved daily, as FAT details change constantly **
** These will be BIG files, so do NOT save them to floppy! **
*** PowerQuest Partition Table Editor for DOS ***
*** Check value of "Big Sectors Per FAT" ***
MOUSE.EXE
PTEDIT.EXE
*** Find CHS start sector of 2nd FAT with FINDPART.EXE ***
** Reports starting sector (CHS) and size (sectors) **
** of all FATs on the Disk (Primary & Logical) **
FINDPART FINDFAT 1 comprehensive FAT_DSK1.TXT
FINDPART FINDFAT 2 comprehensive FAT_DSK2.TXT
3rd Logical Partition -
*** Save Boot Record ***
** User insert CHS value from 1st sector of 2nd Logical Partition *
FINDPART GETSECT 2 _____ ___ __ 1 L3_1st.D2 noheader badf6
*** Save FS Info Sector ***
** User must insert CHS value of 2nd sector of this Partition **
FINDPART GETSECT 2 _____ ___ __ 1 L3_2nd.D2 noheader badf6
*** Save Root Directory ***
** User must insert CHS value of 3rd sector of this Partition **
FINDPART GETSECT 2 _____ ___ __ 1 L3_3rd.D2 noheader badf6
*** Save first 32 sectors of Partition ***
** User insert CHS value from 1st sector of 2nd Logical Partition *
FINDPART GETSECT 2 _____ ___ __ 32 L3_1-32.D2 noheader badf6
NB: The above sectors only need to be saved ONCE **
as their values are permanent! **
*** Saves Sector 96 onward: FAT 1 & 2 ***
** Number of sectors to save = Big Sectors Per FAT **
The value of "Big Sectors Per FAT" is displayed by
the 32bit version of PowerQuest Partition Table Editor)
- Check this value in DOS with PTEDIT.EXE (the earlier
version: PowerQuest Partition Table Editor for DOS)
** User must insert CHS value of 33rd sector of this Partition **
FINDPART GETSECT 2 _____ ___ 33 _____ L3_FAT1.D2 noheader badf6
** User must find CHS start sector of 2nd FAT with FINDPART.EXE
FINDPART GETSECT 2 _____ ___ __ _____ L3_FAT2.D2 noheader badf6
** Need to be saved daily, as FAT details change constantly **
** These will be BIG files, so do NOT save them to floppy! **
*** PowerQuest Partition Table Editor for DOS ***
*** Check value of "Big Sectors Per FAT" ***
MOUSE.EXE
PTEDIT.EXE
*** Find CHS start sector of 2nd FAT with FINDPART.EXE ***
** Reports starting sector (CHS) and size (sectors) **
** of all FATs on the Disk (Primary & Logical) **
FINDPART FINDFAT 1 comprehensive FAT_DSK1.TXT
FINDPART FINDFAT 2 comprehensive FAT_DSK2.TXT
/---------------------------------------------------------------/
To be continued ...
[Reply or follow-up to this message]
| |
re: Routine to BACKUP and RESTORE key sectors of a FAT32 Hard Disk
Thursday, August 7, 2008 at 10:48 am Posted by Ed
(741 messages posted)
Routine to BACKUP and RESTORE key sectors of a FAT32 Hard Disk
on a system with up to two Hard Disks, each with up to four Partitions
Continued...
RESTORE a Sector
==================
Svend's Utilities: FINDPART for DOS (version 4.72)
NB: PUTSECT is a switch (i.e. option) in this version of FINDPART.EXE,
not a seperate program!
RECOVERY PROCEDURE:
The quickest way to recover is -
1) Boot to the DOS prompt (with a Win9x bootable floppy disk)
2) Rebuild the partition table (CHS 0-0-1) (from backup)
3) Rebuild the boot sector (CHS 0-1-1) (from backup)
4) Restore FAT1 (from backup)
Note: If FAT2 is undamaged, set the first 4 bytes of the first FAT
to 00000000. When Windows 9x detects that the first FAT is corrupt
it automagically uses the second FAT.
Write contents of a 512-byte file to Disk
==============================================
*** Set the FINDPART environment variable ***
*** ALL PUTSECT OPERATIONS WILL FAIL IF THIS IS NOT SET ***
SET FINDPART=EDIT
SYNTAX of PUTSECT -
Writes a 512 byte file to a (512 byte) disk sector
(NB: The program will ONLY write a 512 byte file!)
First is the number of the Disk (numbered from 1), e.g. 1
(NB: Valid disk numbers are from 1 to 8)
Next is the sector's CHS number: e.g. 0 0 1
Next is the FILENAME of the source file
Next is the number of cylinders on the disk, a 4-digit number
(NB: Get this number with PARTINFO.EXE - a DECIMAL number)
Next is the hash number of the source file, an 8-digit number
(To find that number: FINDPART PUTSECT GETHASH FILENAME.TYP)
(Or HASH can be entered as 00000000 if FORCE added to command)
*** Identify number of Cylinders on the Disk with PARTINFO ***
** Identifies CHS values for ALL Disks present **
PARTINFO > PARTINFO.txt
Notes:
PUTSECT can only write a 512 byte file, but -
1. The program MBRutilD.EXE can save and restore the entire
TRACK 1 (CHS 0-0-1 to 0-0-63), but ONLY for Disk 1
2. The program SRCFAT.COM can save and restore an entire FAT
*** Display the Help screen ***
FINDPART PUTSECT /?
*** Save the Help screen to a file ***
FINDPART PUTSECT /? > PUTSECT.TXT
DISK 1 [____ cylinders (decimal)]
=======
NON-DOS PARTITION:
*** Write Sector 0-0-1 (MBR Sector) ***
FINDPART PUTSECT 1 0 0 1 0-0-1.D1 ____ 00000000 FORCE
*** Write Sector 0-0-3 (Third Sector) ***
FINDPART PUTSECT 1 0 0 3 0-0-3.D1 ____ 00000000 FORCE
*** Write Sector 0-0-9 (Backup MBR Sector) ***
FINDPART PUTSECT 1 0 0 9 0-0-1.D1 ____ 00000000 FORCE
*** Write Sector 0-0-62 (Sector 62) ***
FINDPART PUTSECT 1 0 0 62 0-0-62.D1 ____ 00000000 FORCE
*** Write Sector 0-0-63 (Sector 63) ***
FINDPART PUTSECT 1 0 0 63 0-0-63.D1 ____ 00000000 FORCE
*** MBRutilD Copyright (c) 2002 PowerQuest Corporation ***
** MBRutil.exe [/?] [/S[H]=filename] [/R[H]=filename] **
** /S Save MBR (sector 1 only) to filename **
** /SH Save entire first head to filename **
** /R Restore MBR (sector 1 only) from filename **
** /RH Restore entire first head from filename **
MBRUtilD.exe /RH=0-0-1-63.D1
PRIMARY PARTITION:
*** Write Sector 0-1-1 (Boot Record) ***
FINDPART PUTSECT 1 0 1 1 0-1-1.D1 ____ 00000000 FORCE
*** Write Sector 0-1-2 (FS Info Sector) ***
FINDPART PUTSECT 1 0 1 2 0-1-2.D1 ____ 00000000 FORCE
*** Write Sector 0-1-3 (Root Directory) ***
FINDPART PUTSECT 1 0 1 3 0-1-3.D1 ____ 00000000 FORCE
*** Write Sector 0-1-7 (Backup Boot Record) ***
FINDPART PUTSECT 1 0 1 7 0-1-1.D1 ____ 00000000 FORCE
*** Write Sector 0-1-8 (Backup FS Info Sector) ***
FINDPART PUTSECT 1 0 1 8 0-1-2.D1 ____ 00000000 FORCE
*** Write Sector 0-1-9 (Backup Root Directory) ***
FINDPART PUTSECT 1 0 1 9 0-1-3.D1 ____ 00000000 FORCE
*** Write all zero's to a sector ***
** This command replaces the filename with a special value **
Most other sectors in Track 1 and in the first 33 sectors
of each Partition are empty, i.e. filled with zero's, and may
need to be set to zero if overwritten with garbage by a crash
FINDPART PUTSECT 1 _____ ___ __ !zero ____ 00000000 FORCE
DISK 2 [____ cylinders (decimal)]
=======
NON-DOS PARTITION:
*** Write Sector 0-0-1 (MBR Sector) ***
FINDPART PUTSECT 2 0 0 1 0-0-1.D2 ____ 00000000 FORCE
*** Write Sector 0-0-3 (Third Sector) ***
FINDPART PUTSECT 2 0 0 3 0-0-3.D2 ____ 00000000 FORCE
*** Write Sector 0-0-9 (Backup MBR Sector) ***
FINDPART PUTSECT 2 0 0 9 0-0-1.D2 ____ 00000000 FORCE
*** Write Sector 0-0-62 (Sector 62) ***
FINDPART PUTSECT 2 0 0 62 0-0-62.D2 ____ 00000000 FORCE
*** Write Sector 0-0-63 (Sector 63) ***
FINDPART PUTSECT 2 0 0 63 0-0-63.D2 ____ 00000000 FORCE
PRIMARY PARTITION:
*** Write Sector 0-1-1 (Boot Record) ***
FINDPART PUTSECT 2 0 1 1 0-1-1.D2 ____ 00000000 FORCE
*** Write Sector 0-1-2 (FS Info Sector) ***
FINDPART PUTSECT 2 0 1 2 0-1-2.D2 ____ 00000000 FORCE
*** Write Sector 0-1-3 (Root Directory) ***
FINDPART PUTSECT 2 0 1 3 0-1-3.D2 ____ 00000000 FORCE
*** Write Sector 0-1-7 (Backup Boot Record) ***
FINDPART PUTSECT 2 0 1 7 0-1-1.D2 ____ 00000000 FORCE
*** Write Sector 0-1-8 (Backup FS Info Sector) ***
FINDPART PUTSECT 2 0 1 8 0-1-2.D2 ____ 00000000 FORCE
*** Write Sector 0-1-9 (Backup Root Directory) ***
FINDPART PUTSECT 2 0 1 9 0-1-3.D2 ____ 00000000 FORCE
*** Write all zero's to a sector ***
** This command replaces the filename with a special value **
Most other sectors in Track 1 and in the first 33 sectors
of each Partition are empty, i.e. filled with zero's, and may
need to be set to zero if overwritten with garbage by a crash
FINDPART PUTSECT 2 _____ ___ __ !zero ____ 00000000 FORCE
EXTENDED Partition
====================
DISK 1 [____ cylinders (decimal)]
======
1st Logical Partition -
*** Write Boot Record ***
** User must insert CHS value (from sector 0-0-1) of 1st sector **
FINDPART PUTSECT 1 _____ ___ __ L1_1st.D1 ____ 00000000 FORCE
*** Write FS Info Sector ***
** User must insert CHS value of 2nd sector of this Partition **
FINDPART PUTSECT 1 _____ ___ __ L1_2nd.D1 ____ 00000000 FORCE
*** Write Root Directory ***
** User must insert CHS value of 3rd sector of this Partition **
FINDPART PUTSECT 1 _____ ___ __ L1_3rd.D1 ____ 00000000 FORCE
*** Write Backup Boot Record ***
** User must insert CHS value of 7th sector of this Partition **
FINDPART PUTSECT 1 _____ ___ __ L1_1st.D1 ____ 00000000 FORCE
*** Write Backup FS Info Sector ***
** User must insert CHS value of 8th sector of this Partition **
FINDPART PUTSECT 1 _____ ___ __ L1_2nd.D1 ____ 00000000 FORCE
*** Write Backup Root Directory ***
** User must insert CHS value of 9th sector of this Partition **
FINDPART PUTSECT 1 _____ ___ __ L1_3rd.D1 ____ 00000000 FORCE
*** Write all zero's to a sector ***
** This command replaces the filename with a special value **
FINDPART PUTSECT 1 _____ ___ __ !zero ____ 00000000 FORCE
2nd Logical Partition -
*** Write Boot Record ***
** User must insert CHS value from 1st Logical Partition **
FINDPART PUTSECT 1 _____ ___ __ L2_1st.D1 ____ 00000000 FORCE
*** Write FS Info Sector ***
** User must insert CHS value of 2nd sector of this Partition **
FINDPART PUTSECT 1 _____ ___ __ L2_2nd.D1 ____ 00000000 FORCE
*** Write Root Directory ***
** User must insert CHS value of 3rd sector of this Partition **
FINDPART PUTSECT 1 _____ ___ __ L2_3rd.D1 ____ 00000000 FORCE
*** Write Backup Boot Record ***
** User must insert CHS value of 7th sector of this Partition **
FINDPART PUTSECT 1 _____ ___ __ L2_1st.D1 ____ 00000000 FORCE
*** Write Backup FS Info Sector ***
** User must insert CHS value of 8th sector of this Partition **
FINDPART PUTSECT 1 _____ ___ __ L2_2nd.D1 ____ 00000000 FORCE
*** Write Backup Root Directory ***
** User must insert CHS value of 9th sector of this Partition **
FINDPART PUTSECT 1 _____ ___ __ L2_3rd.D1 ____ 00000000 FORCE
*** Write all zero's to a sector ***
** This command replaces the filename with a special value **
FINDPART PUTSECT 1 _____ ___ __ !zero ____ 00000000 FORCE
3rd Logical Partition -
*** Write Boot Record ***
** User must insert CHS value from 2nd Logical Partition **
FINDPART PUTSECT 1 _____ ___ __ L3_1st.D1 ____ 00000000 FORCE
*** Write FS Info Sector ***
** User must insert CHS value of 2nd sector of this Partition **
FINDPART PUTSECT 1 _____ ___ __ L3_2nd.D1 ____ 00000000 FORCE
*** Write Root Directory ***
** User must insert CHS value of 3rd sector of this Partition **
FINDPART PUTSECT 1 _____ ___ __ L3_3rd.D1 ____ 00000000 FORCE
*** Write Backup Boot Record ***
** User must insert CHS value of 7th sector of this Partition **
FINDPART PUTSECT 1 _____ ___ __ L3_1st.D1 ____ 00000000 FORCE
*** Write Backup FS Info Sector ***
** User must insert CHS value of 8th sector of this Partition **
FINDPART PUTSECT 1 _____ ___ __ L3_2nd.D1 ____ 00000000 FORCE
*** Write Backup Root Directory ***
** User must insert CHS value of 9th sector of this Partition **
FINDPART PUTSECT 1 _____ ___ __ L3_3rd.D1 ____ 00000000 FORCE
*** Write all zero's to a sector ***
** This command replaces the filename with a special value **
FINDPART PUTSECT 1 _____ ___ __ !zero ____ 00000000 FORCE
DISK 2 [____ cylinders (decimal)]
======
1st Logical Partition -
*** Write Boot Record ***
** User must insert CHS value (from sector 0-0-1) of 1st sector **
FINDPART PUTSECT 2 _____ ___ __ L1_1st.D2 ____ 00000000 FORCE
*** Write FS Info Sector ***
** User must insert CHS value of 2nd sector of this Partition **
FINDPART PUTSECT 2 _____ ___ __ L1_2nd.D2 ____ 00000000 FORCE
*** Write Root Directory ***
** User must insert CHS value of 3rd sector of this Partition **
FINDPART PUTSECT 2 _____ ___ __ L1_3rd.D2 ____ 00000000 FORCE
*** Write Backup Boot Record ***
** User must insert CHS value of 7th sector of this Partition **
FINDPART PUTSECT 2 _____ ___ __ L1_1st.D2 ____ 00000000 FORCE
*** Write Backup FS Info Sector ***
** User must insert CHS value of 8th sector of this Partition **
FINDPART PUTSECT 2 _____ ___ __ L1_2nd.D2 ____ 00000000 FORCE
*** Write Backup Root Directory ***
** User must insert CHS value of 9th sector of this Partition **
FINDPART PUTSECT 2 _____ ___ __ L1_3rd.D2 ____ 00000000 FORCE
*** Write all zero's to a sector ***
** This command replaces the filename with a special value **
FINDPART PUTSECT 2 _____ ___ __ !zero ____ 00000000 FORCE
2nd Logical Partition -
*** Write Boot Record ***
** User must insert CHS value from 1st Logical Partition **
FINDPART PUTSECT 2 _____ ___ __ L2_1st.D2 ____ 00000000 FORCE
*** Write FS Info Sector ***
** User must insert CHS value of 2nd sector of this Partition **
FINDPART PUTSECT 2 _____ ___ __ L2_2nd.D2 ____ 00000000 FORCE
*** Write Root Directory ***
** User must insert CHS value of 3rd sector of this Partition **
FINDPART PUTSECT 2 _____ ___ __ L2_3rd.D2 ____ 00000000 FORCE
*** Write Backup Boot Record ***
** User must insert CHS value of 7th sector of this Partition **
FINDPART PUTSECT 2 _____ ___ __ L2_1st.D2 ____ 00000000 FORCE
*** Write Backup FS Info Sector ***
** User must insert CHS value of 8th sector of this Partition **
FINDPART PUTSECT 2 _____ ___ __ L2_2nd.D2 ____ 00000000 FORCE
*** Write Backup Root Directory ***
** User must insert CHS value of 9th sector of this Partition **
FINDPART PUTSECT 2 _____ ___ __ L2_3rd.D2 ____ 00000000 FORCE
*** Write all zero's to a sector ***
** This command replaces the filename with a special value **
FINDPART PUTSECT 2 _____ ___ __ !zero ____ 00000000 FORCE
3rd Logical Partition -
*** Write Boot Record ***
** User must insert CHS value from 2nd Logical Partition **
FINDPART PUTSECT 2 _____ ___ __ L3_1st.D2 ____ 00000000 FORCE
*** Write FS Info Sector ***
** User must insert CHS value of 2nd sector of this Partition **
FINDPART PUTSECT 2 _____ ___ __ L3_2nd.D2 ____ 00000000 FORCE
*** Write Root Directory ***
** User must insert CHS value of 3rd sector of this Partition **
FINDPART PUTSECT 2 _____ ___ __ L3_3rd.D2 ____ 00000000 FORCE
*** Write Backup Boot Record ***
** User must insert CHS value of 7th sector of this Partition **
FINDPART PUTSECT 2 _____ ___ __ L3_1st.D2 ____ 00000000 FORCE
*** Write Backup FS Info Sector ***
** User must insert CHS value of 8th sector of this Partition **
FINDPART PUTSECT 2 _____ ___ __ L3_2nd.D2 ____ 00000000 FORCE
*** Write Backup Root Directory ***
** User must insert CHS value of 9th sector of this Partition **
FINDPART PUTSECT 2 _____ ___ __ L3_3rd.D2 ____ 00000000 FORCE
*** Write all zero's to a sector ***
** This command replaces the filename with a special value **
FINDPART PUTSECT 2 _____ ___ __ !zero ____ 00000000 FORCE
/--------------------------------------------------------------/
Utilities for FAT
===================
Svend's Utilities: FINDPART for DOS (version 4.72)
NB: FINDFAT is a switch (i.e. option) in this version of FINDPART.EXE,
not a seperate program!
These can be used for two purposes:
1. To identify the starting sector of the 1st or 2nd FAT
on a working Disk, so as to BACKUP that FAT.
2. To locate a lost or damaged FAT on a damaged Disk.
*** Report starting sector (CHS) and size (sectors) ***
*** of both FAT 1 & FAT 2 (saves report to file) ***
** 1: Search Primary Partition only (Cylinders 0 & 1) **
FINDPART FINDFAT 1 0 1 A:\FAT_DSK1.TXT
FINDPART FINDFAT 2 0 1 A:\FAT_DSK2.TXT
FINDPART FINDFAT ALL 0 1 A:\FAT_ALL.TXT
** 2: Search Primary & Extended Partitions **
FINDPART FINDFAT ALL comprehensive A:\FAT_ALL.TXT
*** Find lost FAT on Disk 1 ***
** Saves the report to a file **
FINDFAT 1 comprehensive A:\FAT_DSK1.TXT
FINDPART FINDFAT 1 comprehensive A:\FAT_DSK1.TXT
*** Find lost FAT on Disk 2 ***
** Saves the report to a file **
FINDFAT 2 comprehensive A:\FAT_DSK2.TXT
FINDPART FINDFAT 2 comprehensive A:\FAT_DSK2.TXT
** Find lost FAT on ALL Disks **
** Saves the report to a file **
FINDFAT ALL comprehensive A:\FAT_ALL.TXT
FINDPART FINDFAT ALL comprehensive A:\FAT_ALL.TXT
SRCFAT.COM
SRCFat v1.3(c)2001 - The W0rm
Usage: SRCFat {drive:} {filename} {switch}
Program to RESTORE the 1st or 2nd FAT
SRCFat can SAVE, RESTORE and CHECK the FAT on a FAT32 Disk
(NB: Replaces older utilities that don't support FAT32)
The program can save and restore the first or second FAT,
or both; and can restore the 2nd FAT over a damaged 1st FAT
(i.e. restore the second FAT to the first), or vice versa.
Switches:
/S - Save FAT table to file
/R - Restore FAT table from file
/C - Compare FAT table to file
/2 - Use the second FAT copy
Note:
This program can *also* restore a FAT which was saved by
a DIFFERENT program (e.g. one saved by FINDPART.EXE)
A: BACKUP THE FAT
** Save 1st FAT **
SRCFAT C: F:\SAVED\SRC_FAT1.C /S
SRCFAT D: F:\SAVED\SRC_FAT1.D /S
** Save 2nd FAT **
SRCFAT C: F:\SAVED\SRC_FAT2.C /S /2
SRCFAT D: F:\SAVED\SRC_FAT2.D /S /2
** In practice, the following Backup routine is preferable **
** This saves 3 backup copies instead of only a single one **
** using the Serial Copy program SERCOPY.COM **
** (For saving files to USB Disk in F:, see below) **
** Save 1st FAT on Drive C: **
SRCFAT C: C:\SAVED\C_FAT1.BIN /S
SERCOPY C:\SAVED\C_FAT1.BIN F:\SAVED /L:3
** Save 1st FAT on Drive D: **
SRCFAT D: D:\SAVED\D_FAT1.BIN /S
SERCOPY D:\SAVED\D_FAT1.BIN F:\SAVED /L:3
** Save 2nd FAT on Drives C: & D: **
SRCFAT C: F:\SAVED\C_FAT2.001 /S /2
SRCFAT D: F:\SAVED\D_FAT2.001 /S /2
B: RESTORE THE FAT
*** Help Screen Operations ***
** Display Help screen **
SRCFAT /?
** Save Help screen to file **
SRCFAT /? > SRCFAT.txt
*** Operations on 1st FAT ***
** Compare 1st FAT to Backup file **
SRCFAT C: F:\SAVED\SRC_FAT1.C /C
SRCFAT D: F:\SAVED\SRC_FAT1.D /C
** Restore 1st FAT from Backup file **
** Firstly, save a backup of damaged 1st FAT **
** (NB: Depending on degree of file system damage **
** may report "Error, could not read sector") **
SRCFAT C: F:\SAVED\BAD_FAT1.C /S
SRCFAT D: F:\SAVED\BAD_FAT1.D /S
** Secondly, write 1st FAT backup file to Disk **
SRCFAT C: F:\SAVED\SRC_FAT1.C /R
SRCFAT D: F:\SAVED\SRC_FAT1.D /R
*** Operations on 2nd FAT ***
** Compare 2nd FAT to Backup file **
SRCFAT C: F:\SAVED\SRC_FAT2.C /C /2
SRCFAT D: F:\SAVED\SRC_FAT2.D /C /2
** Restore 2nd FAT from Backup file **
** Firstly, save a backup of damaged 2nd FAT **
** (NB: May give error: "Error, could not read sector") **
SRCFAT C: F:\SAVED\BAD_FAT2.C /S /2
SRCFAT D: F:\SAVED\BAD_FAT2.D /S /2
** Secondly, write 2nd FAT backup file to Disk **
SRCFAT C: F:\SAVED\SRC_FAT2.C /R /2
SRCFAT D: F:\SAVED\SRC_FAT2.D /R /2
*** Replace 1st FAT with 2nd FAT ***
** Compare 1st FAT to backup file of 2nd FAT **
SRCFAT C: F:\SAVED\SRC_FAT2.C /C
SRCFAT D: F:\SAVED\SRC_FAT2.D /C
** Restore 1st FAT from backup file of 2nd FAT **
** Firstly, save a backup of damaged 1st FAT **
** (NB: May give error: "Error, could not read sector") **
SRCFAT C: F:\SAVED\BAD_FAT1.C /S
SRCFAT D: F:\SAVED\BAD_FAT1.D /S
** Secondly, write 2nd FAT backup file to Disk **
SRCFAT C: F:\SAVED\SRC_FAT2.C /R
SRCFAT D: F:\SAVED\SRC_FAT2.D /R
Note:
If the first 8 bytes of the 1st FAT are replaced with 00000000
Win9x will automatically default to using the 2nd FAT instead
(i.e. treats the 1st FAT as corrupt). This might be tried
*before* attempting to replace the 1st FAT with the 2nd!
*** Replace 2nd FAT with 1st FAT ***
** Compare 2nd FAT to backup file of 1st FAT **
SRCFAT C: F:\SAVED\SRC_FAT1.C /C /2
SRCFAT D: F:\SAVED\SRC_FAT1.D /C /2
** Restore 2nd FAT from backup file of 1st FAT **
** Firstly, save a backup of damaged 2nd FAT **
** (NB: May give error: "Error, could not read sector") **
SRCFAT C: F:\SAVED\BAD_FAT2.C /S /2
SRCFAT D: F:\SAVED\BAD_FAT2.D /S /2
** Secondly, write 1st FAT backup file to Disk **
SRCFAT C: F:\SAVED\SRC_FAT1.C /R /2
SRCFAT D: F:\SAVED\SRC_FAT1.D /R /2
Note:
This procedure should normally only be necessary if
BOTH copies of the FAT are corrupted on a damaged Disk
*and* the backup copy of the 1st FAT is ALSO corrupted.
In theory, that situation can never arise! The backup copy
should be on a different Disk (i.e. at F:\SAVED).
CONTENTS OF THE FAT:
A cluster is a group of sectors holding user data.
Examples: A 4K cluster has 8 sectors in it (512*8=4,096)
A 16K cluster has 32 sectors in it (512*32=16,384)
The data area in a Partition starts at cluster #2. This leaves
the first two entries in the FAT unused. In the first entry,
the first byte is a copy of the media descriptor (F8); and
the last 3 bytes are 0F FF FF (written backwards as FF FF 0F).
The second entry is the end-of-cluster-chain marker (0F FF FF FF,
written backwards as FF FF FF 0F). This is the Dirty Shutdown
flag: its value changes if the last shutdown was not clean,
or if a disk I/O error was detected last session.
NB: In *all* Disks I have inspected, the second entry in the FAT
is actually 07 FF FF FF (written as FF FF FF 07)!
Each cluster has a 4-byte entry in the FAT. The entry tells you
whether the cluster has data in it (if the entry is 0, there is
no data in that cluster); and whether it is the end of the data
in the file (if the entry is 0FFFFFFFh it's the final entry
in the chain).
NB: On disk the bytes are (as always) written BACKWARDS,
so for instance 0FFFFFFFh reads on disk as FF FF FF 0F
Value Description
----- -----------
00000000 Free cluster (No data in it)
00000001 Reserved cluster, do not use
00000002 - 0FFFFFEF Number of the next cluster
0FFFFFF0 - 0FFFFFF6 Reserved cluster, do not use
0FFFFFF7 Bad sector in cluster or reserved cluster
0FFFFFF8 - 0FFFFFFF Last cluster in file (written FF FF FF 0F)
FILENAMES:
In FAT32, filenames (in 8.3 format) are stored in the Directory Table,
*not* in the FAT. Each 8.3 file entry is 32 bytes long. LFNs are
also stored in the Directory Table, alongside the 8.3 filename.
Directory Table format (8.3 filename entry):
Size Description
---- -----------
8 bytes Filename
3 bytes Extension
1 byte Attribute: 0 = unused; A = archive; R = read-only;
S = system; D = directory; V = volume
1 byte Reserved (00h)
1 byte Time Created (Seconds)
2 bytes Time Created (Hour & Minute)
2 bytes Date Created
2 bytes Date Last Accessed
2 bytes Reserved (00h)
2 bytes Time
2 bytes Date
2 bytes Cluster (Location of beginning of file)
4 bytes File Size
Total = 32 bytes
An additional 640 bytes are occupied by the LFN (Long FileName),
making each entry 672 bytes long (32 bytes + 640 bytes).
The Directory Table is not stored in a fixed location, nor does
it have a fixed size. Each directory (folder) has such a table,
which is just a file, but with a special (Directory) attribute.
:: /--------------------------------------------------------------/
DIRECTORIES
============
ROOT DIRECTORY
The Root Directory can be stored anywhere in the partition.
Unlike FAT16, it does NOT immediately follow the 2nd FAT.
SUB-DIRECTORIES
Svend's Utilities: FINDPART for DOS (version 4.72)
Searches for subdirectories, and calculates the estimated
location of cluster number two and cluster size.
Disks are numbered from 1.
The report can be written to a file. File extension must be .txt
** Display the Help screen **
FINDPART FINDDIR
** Save the Help screen to a file **
FINDPART FINDDIR > FINDDIR.TXT
** Search Disk 1 for Subdirectories **
** Saves report to a file **
FINDPART FINDDIR 1 FINDDIR1.txt
** Search Disk 2 for Subdirectories **
** Saves report to a file **
FINDPART FINDDIR 2 FINDDIR2.txt
FIND LOST DIRECTORIES
CYLDIR, version 5.5
Copyright Svend Olaf Mikkelsen, 2004
Lists lost (and deleted) directories found in a FAT32 partition.
Displays file names.
The correct DOS codepage must be loaded, before searching for or
copying files. [NB: DOS codepage for UK (country 044) is 850]
SET CODEPAGE=850
Usage: Cyldir {disk number} {cylinder} {head} {sector} {FAT size}
{cluster size} {root} [copyfiles {directory cluster}] [{logfile}]
{FAT size} in sectors (see Ranish Partition Manager: RPM.exe)
{cluster size} in KB (NB: If disk exceeds 32GB, must be 32KB)
{root} root cluster for FAT32 (NB: Usually cluster 2)
{logfile} extension must be .txt
A: List the Lost Files
To list the lost (or deleted) files in Partition 1 on Disk 1
where the Partition uses 32K clusters (i.e. exceeds 32GB):
CYLDIR 1 0 1 1 ____ 32 2 CDIR.TXT
Example:
From FINDPART FINDFAT you have this result for disk 1 -
-----FAT CHS -Size Cl --Root -Good -Rep. Maybe --Bad YYMMDD DataMB
260 0 33 1204 4 2 1204 0 0 0 981124
516
The CYLDIR command line to list the files to CDIR.TXT is the
disk number, followed by the first 6 numbers in the above line,
followed by the file name CDIR.TXT:
cyldir 1 260 0 33 1204 4 2 cdir.txt
B: Copy the Lost Files
Run CYLDIR.EXE from a floppy disk or an undamaged partition.
If the option COPYFILES is used, it copies files from a lost
directory. The cluster numbers are saved in the log file.
The current directory must be empty, unless it's the Root
directory. NB: Copied files *cannot* be expected to be okay!
** To speed up file copying, load HIMEM.SYS and SMARTDRV.EXE **
** 1: Load HIMEM.SYS in CONFIG.SYS **
** Syntax: device=himem.sys **
** 2: Load SMARTDRV.EXE before running CYLDIR **
SMARTDRV.EXE 4096 16>nul
CYLDIR 1 0 1 1 ____ 32 2 COPYFILES ____ CDIR.TXT
Note: Files are copied using their short file names. A file,
LONGNAME.BAT, for renaming them to Long File Names,
will automatically be created. A file named CYLDIR.LOG
records the names of files that are not readable or are
FDISK damaged. Files bigger than 2 GB cannot be copied.
Copying, Alternate usage:
Syntax:
Cyldir {directory cluster} dir [{copy logfile}]
Cyldir {directory cluster} tree [{copy logfile}]
Two additional ways to copy files from a lost partition.
Directories are relative to the current directory.
If 'tree' is specified, files in any subdirectories are copied.
If the target subdirectories already exist, they must be empty.
The main thing is to be certain that no copy of the lost files
is in the target partition. This could occur if partitions
overlap, or if old deleted copies of the lost files exist.
The logfile CDIR.TXT must exist in the current directory, or
in the Root of current partition. (Suggestion: Put CDIR.TXT
and CYLDIR.EXE in an empty directory and work from there.)
Up to ten {directory cluster}'s can be entered. If the Root
directory cluster number is entered with the 'tree' option, you
can add '+lost' to the command line to include lost directories,
beginning with ? in CDIR.TXT
CYLDIR ____ tree +lost COPYLOG.TXT
To stop the copy after the current directory, press ESC.
If run in pure DOS, a file LONGNAME.BAT for recreating long file
names is created in each directory. Must be enough free space.
To write a directory listing to CDIR.LST, use:
CYLDIR LIST
Choose some directory cluster numbers in CDIR.TXT; or do
'cyldir list' and find the numbers in CDIR.LST.
Example: To copy a single directory, whose cluster number is e.g. 117:
cyldir 117 dir
CYLDIR ___ DIR
Example: To copy an entire tree, whose cluster number is e.g. 117:
cyldir 117 tree
CYLDIR ___ TREE
Example -
Disk: 1 Cylinders: 9729 Heads: 255 Sectors: 63 MB: 76317
-PCyl N ID -----Rel -----Num ---MB -Start CHS- --End CHS-- BS CHS
0 - 0C 63 42973812 20983 0 1 1 2674 254 63 B OK
2675 1 0B 63113322447 55333 2675 1 1 9728 254 63 R0 OK
0 - 0B 42973938113322447 55333 2675 1 1 9728 254 63 B OK
6200 1 0B 63 56661192 27666 6200 1 1 9726 254 63 R0 OK
0 - 0B 99603063 56661192 27666 6200 1 1 9726 254 63 B OK
-----FAT CHS -Size Cl --Root -Good -Rep. Maybe --Bad YYMMDD DataMB
2675 1 33 13832 32 2 13832 0 0 0 080206
11160
6200 1 33 13830 16* 2*13830 0 0 0
2
Syntax:
CYLDIR + Disk number + first 6 numbers from lower table + CDIR.txt
** Disk 1, Partition 2 (Example) **
cyldir 1 2675 1 33 13832 32 2 cdir.txt
** Disk 1, Partition 4 (Example) **
cyldir 1 6200 1 33 13830 16 2 cdir.txt
/--------------------------------------------------------------/
Utilities for writing MULTIPLE sectors
==========================================
MBRUTILD.EXE
MBRUTILD.EXE: PowerQuest's MBR Utility for DOS
Backup and restore MBR Sector & Track 1 on Disk 1
NB: The program only works on Disk 1, not on Disks 2 or 3.
Saves and restores the entire Track 1 (CHS 0-0-1 to 0-0-63)
(i.e. all 63 sectors at once). This is the DOS version of
the MBR manager program: MBRutil.exe.
It might be made to work on *any* Hard Disk, by setting the
disk as Primary Master on the IDE cables. But that might be
impractical, as the disk to be restored will inevitably
be damaged and not bootable.
** Save the MBR (Sector 0-0-1) to a file **
MBRutilD /S=MBR_MBR.D1
** Restore the MBR (Sector 0-0-1) from a file **
MBRutilD /R=MBR_MBR.D1
** Save the entire first Track to a file **
** (Save sectors 0-0-1 to 0-0-63: all 63 sectors of first Track) **
MBRutilD /SH=MBR_TRK1.D1
** Restore the entire first Track from a file **
** (Restore sectors 0-0-1 to 0-0-63 from a backup file) **
MBRutilD /RH=MBR_TRK1.D1
/--------------------------------------------------------------/
LONG FILE NAME Utils
=======================
*** Set PATH to include LFN Utils Directory ***
** Example: Put the utils in the root directory of Drive F: **
SET PATH=%PATH%;F:\
*** LDIR.EXE: Directory Listing with Long File Names ***
** Pauses after each screen **
LDIR.EXE /P
*** LCOPY.EXE: Long filename version of COPY.EXE ***
** Copy file in DOS preserving its Long File Name **
Syntax:
LCOPY "[Source]" "[Destination]"
Example:
LCOPY "C:\PROGRA~1\TELEVI*" "A:\DATA"
1. The file LCOPY.EXE must be located in the DOS path.
(Set the PATH in autoexec.bat, e.g. SET PATH=A:\;F:\)
2. The destination directory must already exist, and
must be a valid DOS directory name (i.e. in 8.3 format).
3. It is NOT necessary to define a name for the file in the
destination instruction.
4. If the long file name contains spaces, the source and the
destination must BOTH be enclosed in quotation marks.
5. The DOS wildcard *.* is not valid. The wildcard * must be
used instead.
6. The wildcard * must come BEFORE the first space in the long
file name for the source to be valid.
7. The switch /A copies ALL files, including HIDDEN files.
8. To copy only directory structure use: LCOPY . {dest} /S
NB: The destination {dest} must be a valid path, e.g. F:\
*** Copy all files in current directory to Floppy Disk in A: ***
** Use of LCOPY.EXE preserves the Long File Names **
*** Copy ALL files in current directory ***
LCOPY.EXE "*" A:\ /A
*** Include all SUBDIRECTORIES of current (the /S switch) ***
LCOPY.EXE "*" A:\ /A /S
*** Copy all files in current directory to RAM disk in E: ***
** Use of LCOPY.EXE preserves the Long File Names **
*** Copy ALL files in current directory ***
LCOPY.EXE "*" E:\ /A
*** Include all SUBDIRECTORIES of current (the /S switch) ***
LCOPY.EXE "*" E:\ /A /S
Note:
To provide RAM disk in DOS, add this to CONFIG.SYS:
device=ramdrive.sys /E 16384
Note: RAMDRIVE.SYS is included on WinME's Emergency Boot Disk
*** Copy all files in current directory to USB disk in F: ***
** Use of LCOPY.EXE preserves the Long File Names **
*** Copy ALL files in current directory ***
LCOPY.EXE "*" F:\ /A
*** Include all SUBDIRECTORIES of current (the /S switch) ***
LCOPY.EXE "*" F:\ /A /S
USBASPI.SYS:
USBASPI.SYS merely maps USB devices to an ASPI device. An
additional driver, the "Motto Hairu" driver DI1000DD.SYS, is needed to
map the ASPI mass storage to a DOS drive letter.
Switches for the Panasonic USBASPI.SYS driver, v2.06:
device=USBASPI.SYS [/e] [/o] [/u] [/v] [/w] [/r] [/l[#]] [/slow] [/nocbc]
/e EHCI, for enabling only USB 2.0 controller
/o OHCI, for enabling only add-on/onboard USB 1.1 controller
/u UHCI, for enabling integrated USB 1.1 controller
/v Verbose mode, useful for troubleshooting
/w Wait, displays message to prompt attaching of USB device
/r Resident, load as memory resident if USB floppy detected
/l# Luns, specify highest number of LUN assigned: default /L0
/slow Use SLOW mode, gives longer delays on scanning USB ports
/nocbc No CardBus Controller, disable detection on CardBus slots
You can specify more than one controller type (e.g. /e /u). Use
this feature to specify which port types to enable: limiting
the port types scanned for results in a faster startup.
Specifying /u or /o and omitting /e forces USB 1.1 mode on USB 2.0 devices.
To connect both a USB 2.0 CD drive AND external USB 2.0 hard disk simultaneously
-
(a) Include the following lines in CONFIG.SYS:
device=USBASPI.SYS /e
device=USBCD.SYS /d:USBCD001
device=DI1000DD.SYS
(b) Include the following line in AUTOEXEC.BAT:
MSCDEX /d:USBCD001
To provide USB Support in DOS, add these lines to CONFIG.SYS:
device=USBASPI.SYS /e /o /u /v
device=DI1000DD.SYS
NOTES:
1. If the files to be recovered are too large for a floppy,
or a USB pen drive, attach a second HDD to an IDE cable
2. LCOPY.EXE and other LFN utils could be held on Drive E:,
a RAM disk where rescue utils are stored while carrying out
data recovery on an IDE Hard Disk
/--------------------------------------------------------------/
DOSKEY
=======
*** Set PATH to include DOSKEY ***
SET PATH=%PATH%;C:\WINDOWS\COMMAND
*** Run DOSKEY ***
DOSKEY
Useful DOSKEY commands:
F7 : Lists command history in current session
UP & DOWN ARROWS : Recall previous/next commands
SAVE FILES TO DRIVE F:
========================
*** Save output data to Drive F: (USB Pen Drive) ***
** NB: Check that the USB disk is Drive F: **
** STEP 1: Make a destination directory at Drive F: **
MD F:\SAVED\DATA
** STEP 2: Copy all output files to Drive F: **
** Options -
** /V Verify file was written correctly
** /Y Suppress prompt to overwrite if file already exists
COPY *.* F:\SAVED\DATA /V /Y
PATH
=====
*** Restore the original PATH settings ***
PATH ;
Set PATH=%DOSpath%
[Reply or follow-up to this message]
|
re: Routine to BACKUP and RESTORE key sectors of a FAT32 Hard Disk
Friday, August 29, 2008 at 7:48 am Posted by Ed
(741 messages posted)
For general management of a Hard Disk, here is a link to further information and
some useful programs: Archer's
Hard Disk Management
Ed
[Reply or follow-up to this message]
|
Disk Repair and Data Recovery for a FAT32 Hard Disk
Sunday, April 12, 2009 at 8:08 am Posted by Ed
(741 messages posted)
Data Recovery help in an MS-DOS Batch file (350KB):
Recovery Instructions
and Utilities
The batch file in the link contains detailed instructions on how to backup and restore
the key sectors of a FAT32 hard disk (for any size of FAT32 hard disk from 8 GB to
137 GB).
Included are detailed instructions on how to use those backups to recover from a
hard disk crash, and on how to recover from a disk crash even if you do not have
those backups (a rather more difficult problem).
A great deal of information about the disk structure of a FAT32 hard disk is provided
in the file, which attempts to provide an all-purpose DIY solution to both disk repair
and data recovery.
In terms of disk repair, it tackles both repairing the data structure of a working
disk which has suffered only data corruption (due to data being written to the system
area, overwriting the MBR, Boot Sector or FAT), and fixing broken hardware (including
repairing bad sectors).
In terms of data recovery, it explains how to safely copy files from a broken disk
to a new disk (including how to install a new working hard disk), with details of
how to clone the entire broken disk and of how to copy individual files (one-by-one
or en mass).
Instructions are also included on recovering from common file system errors, such
as the "Blue Screen Of Death". Many other error messages generated by the WinME Operating
System are also tackled.
Each section in the batch file includes recommendations on which software to use,
and details of how to use it most effectively. The software is mostly DOS programs,
to enable you to carry out the work even where Windows can't load.
Included at the end of the batch file are downloads links to enable you to obtain
on-line the software mentioned in the file.
You do not need to be an expert on MS-DOS batch files. You only need to know
a little about them: for example that if you execute (i.e. run) the file, it won't
execute any line which *begins* with "rem" or with a double colon "::" as those are
used to disable ("comment out") a line.
The file contains many different solutions; so it is probably best to make a copy
of it, and delete the sections which are not applicable to your particular problem.
I happened across this file by chance. I'm not offering any support for it here:
it seems to me to be self-explanatory, so if you read it but don't understand it
then there's nothing I can usefully add.
It gives a crash-course (no pun intended!) in how to survive a disk crash. Read it
carefully before taking any steps: then read it again! Make
sure you understand what has gone wrong with your hard disk before you attempt
any recovery action.
You will need a basic understanding of the structure of a FAT32 disk. You may have
one which has only a single partition (e.g. Drive C:), or you may have one which
has more than one partition (e.g. Drive C: and Drive D:). The batch file tries to
provide the necessary basic understanding, but you will find it helpful to also read
up on the subject through Google (e.g. search for information on both FAT32 and MBR).
A disk is divided into sectors (millions of them). Each sector is usually 512 bytes
long. Two sectors thus total 1024 bytes, or 1 KB (kilobyte). Depending on the size
of the disk, usually either 32 sectors or 64 sectors make 1 cluster. The disk stores
information (files) in a cluster: so a file might only be 200 bytes of information,
but will still be alloted 1 cluster all to itself (even though 1 cluster is typically
64 sectors, i.e. 64 multiplied by 512 bytes), so a cluster can contain a vast amount
of empty space, in addition to your file's data. A file is alloted as many clusters
as it needs: and each cluster is recorded in the File Allocation Table (FAT).
A disk may contain more than one Partition; and all Partitions begin with a Partition
Table sector (e.g. the MBR, or Master Boot Record, which is the first sector on the
disk), which is typically followed 63 sectors later by the Boot Sector, which is
typically followed 32 sectors later by the first sector of the FAT (File Allocation
Table). The FAT might be 20,000 sectors (or longer), depending on the partition's
size. A second copy (i.e. a backup copy) of the FAT typically follows immediately
after the first FAT. The Root Directory table then typically follows immediately
after the second copy of the FAT. The rest of the Partition contains your files.
This batch file provides routines for making a backup copy of all of these vital
data structures: MBR, Boot Sector, FAT, and Root Directory table. It also explains
how to reconstruct them if you don't have a backup copy of them. And it tells you
where to find the tools to use to automate as much as possible of the recovery process
if you don't have the necessary backup copies of those key sectors.
The most useful tool for gaining a practical working understanding of disk structure
is probably Norton's DiskEdit (DISKEDIT.EXE). The 2001 and 2002 versions (or later)
are needed for a FAT32 disk (because earlier versions either don't work at all for
FAT32, or only work if the disk is smaller than 8 GB). Norton DiskEdit includes tools
which will find for you the starting sector of the various data structures: such
as the Partition Table, Boot Sector, and FATs.
Ed
[Reply or follow-up to this message]
| |
| |
Tip: Use one of the [Reply or follow-up to this message] links above to add a message to this thread
| |
Return to the Windows Me Discussion Forum
|
|
|
|