Quote:
Originally Posted by PeterTheGeek 
Okay, it looks like you can resize a drive without changing the *.MAP files. I moved a 40 Gig image to a 80 Gig drive and all 7 titles worked...
|
Thank you very much for taking the time to do this 'Experiment'! 

Quote:
Originally Posted by PeterTheGeek 
...Most of the changes would be done in sectors 4 and 5 in the FB000_00.LST file:
- The drive size needs to be updated in sector 4.
.
- The size of MPG_SEG_MPG_SEGM.DAT need to change from 8 to 16 sectors in FB000_00.LST. New sectors will need to be blanked out in that file after step 3 is done.
.
- Then the AV001_0AV001_00.MPG file will need it's starting location moved, that is add 8 to the current number and it's length changed to the end of the disk in FB000_00.LST. Here is the hard part. You need to move all the data in this file eight sectors up since the MPG_SEG_MPG_SEGM.DAT file grew. Maybe we could move the MPG_SEG_MPG_SEGM.DAT file but that would put it at the end of the AV001_0AV001_00.MPG. That is a long ways for the heads to travel. I would not recommend that. But it could be done for testing only.
Maybe someone could come up with a Linix script file for moving from a 160 Gig to a 500 Gig drive. You would need to know how many sectors there are on the new hard drive. Or you could lowball it and just use most of the drive and leave some small amount unused at the end. Drive Data Structure <--- MUST READ for reference information__________________________________________________
From Post #90 (Drive Data Structure):
Quote:
Originally Posted by PeterTheGeek 
I have been blanking the hard drive will all 0s before starting so there wouldn't be any extra bits turn on that the DVR didn't do. The hard drive format they are using is their own and doesn't have a partition table or boot sector or any computer general file system on it. The drive is just for storing data...
...The header information at sector 4: Post 6
The directory listing at sector 4 and 5: Post 11
I have figured out what most of the file are for. Only two of them change with drive size and that is MPG_SEGMPG_SEGM.DAT and AV001_0AV001_00.MPG...
...I detail the two files that change size with the hard drive: Post 60...
... This file system used on the DVR is based on a 512 byte sector. I can see why the advanced sector format drive is a problem.
I attached my to files for the director listing and the MAP file.
The MPG files starts at sector 2008029.
4.1 SLP start at sector number 2008029 and runs 16 Megabytes
5.1 EP start at sector number 2155485 and runs 24 Megabytes
5.2 LP start at sector number 2221021 and runs 24 Megabytes
11.1 SPP starts at sector number 2270173 and runs 24 Megabytes
|
__________________________________________________
From Post #6 (Header Information):
Quote:
Originally Posted by PeterTheGeek 
... I spent a few hours looking at sector 4 and 5 on my hard disk and I decoded maybe 90% of it.
I included a 1.5K file of the "File" FB000_00.LST from my old drive. I suggest using a hex editor too look at it. It will not look like much otherwise.
I will use hex format a lot in the following. Basically it base 16 so there are 16 symbols used, 0-F. Decimal uses 10 symbols 0-9. Computer people like using hex because two digits is one byte. I will try to say it is hex or start the number with 0x to show it is hex. Microsoft calculator in scientific mode can translate hex to decimal and back again.
This is basically a hard drive map on where they store different data in different spots on the hard drive.
The numbers are in little-endian format so the least significant byte is at the lowest memory location:
The first line is as follows in hex format:
B0 9E A1 12 DF 23 A0 12 CF 7A 01 00 02 00 00 00
Bytes 0 - 3: 0x12A19EB0 => 312,581,808 -- This is the number of sectors on the hard disk. The drive that this came from is a Hitachi HDT721016SLA380 and the link to the data sheet is here.
Bytes 4 - 7: 0x12A023DF => 312,484,831 -- This is the number of sectors referenced in this drive map - 1.
Bytes 8 - 15: I don't know what they mean. Maybe someone else could look at it. It might be some math checks. If you look at it as a formula that needs to add up.
Bytes 8 - 11: 0x00017ACF => 96,975 - Don't know what this might mean.
Bytes 12-15: 0x00000002 => 2 - Don't know what this means.
But 312,581,808 - 312,484,831 - 96975 - 2 = 0.
This might be a sanity check to make sure all the sectors on the disk are accounted for...
|
__________________________________________________
From Post #11 (Hard Drive Map Record):
Quote:
Originally Posted by PeterTheGeek 
The following is the first map record I have on my hard disk, it is in hex format:
02 00 00 00 02 00 00 00 06 00 00 00 00 00 00 00
00 00 00 00 00 00 2e 00 53 59 53 43 54 52 00 44
46 30 30 30 5f 30 30 2e 4c 53 54 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
I'm just going to call these parts of the hard drive as files. They are not really files but more like partitions or something like that. Anyway, I'll include the map of my hard disk.
Bytes 0 - 3:
This is the sector number the file starts at.
0x00000002 = 2
Bytes 4 - 7:
This is the length of the file.
0x00000002 = 2
Byte 8:
0x06 = 6 - Don't know what this means but it is always 6 on my disk image.
Bytes 9 - 21:
Always 0.
Byte 22:
Always 0x2E = 46
Byte 23:
Always 0.
Bytes 24 - 42:
File name, it is justified to the highest byte location and buffered by 0s. In this example there is a 0 in the file name. The space after SYSCTR is a 0 or null and not a ASCII value of space of 32.
The file name is SYSCTR F000_00.LS
Bytes 43 - 63
Always 0. Here is a table of my hard disk map: |
File Name
|
Starting Sector
|
Sector Length
|
| SYSCTR F000_00.LST |
2
|
2
|
| FB000_00.LST |
4
|
3
|
| SYSCTR TR000_00.LS |
7
|
1
|
| FONT_DAFONT_DAT.DAT |
8
|
8193
|
| BU_DVDFBU_DVDFS.DAT |
8201
|
20748
|
| BU_LOG_BU_LOG_D.DAT |
28949
|
24090
|
| VBI_DATVBI_DATA.DAT |
53039
|
8192
|
| TI000_0TI000_00.IFO |
61231
|
394
|
| TM001_0TM001_00.MAP |
61625
|
922200
|
| TC001_0TC001_00.CHP |
983825
|
51000
|
| TM002_0TM002_00.MAP |
1034825
|
922200
|
| TC002_0TC002_00.CHP |
1957025
|
51000
|
| MPG_SEGMPG_SEGM.DAT |
2008025
|
8
|
| AV001_0AV001_00.MPG |
2008033
|
310476800
|
| Last sector used / SUM is: |
312484832
|
312484831
|
|
__________________________________________________
From Post #60 (Table of the 2 Files That Change Size With Different HDD Sizes):
Quote:
Originally Posted by PeterTheGeek 
... the only files that change size with the disk size is the MPG_SEG_MPG_SEGM.DAT and AV001_0AV001_00.MPG: |
File Name
|
40GB Start
|
40GB Length
|
80GB Start
|
80GB Length
|
160GB Start
|
160GB Length
|
500GB Start
|
500GB Length
|
| MPG_SEGMPG_SEGM.DAT |
2008025
|
4
|
2008025
|
4
|
2008025
|
8
|
2008025
|
16
|
| AV001_0AV001_00.MPG |
2008029
|
76103680
|
2008029
|
154238976
|
2008033
|
310476800
|
2008041
|
974553088
|
Looks like the ratio between the MPG_SEG.DAT and the AV001_0.MPG files are changing as the size of the drive gets bigger. I suspect that the allocation size, how big of a block of drive is used at one time, is getting bigger as well. This fact may make resizing a format to a larger drive a non-trivial operation.  
|
|
It's been *YEARS* since I regularly did this kind of low-level stuff in Windows (11+) and, IIRC, I used '
Debug' to re-write bytes here and there, never actually changing the length of the original file(s).
From your post, I understand that I'll have to use Linux for this - possibly one of the
'Burn-ISO-to-DVD' and then 'Run-from-DVD-Without-Installing' versions? Any suggestions on which one might have the necessary low-level tools that I'll need, or do they all come included with *ANY* Linux flavor?
On the subject of low-level tools, I used to be a PeopleSoft Programmer/Analyst, so I was used to coding with SPF/PC on a Windows box and then connecting to the Unix box to send and compile source code, run BASH, IIRC, scripts, etc... Thus, I spent a LOT of time reading MAN texts (~1995-2001). Which Linux utilities would I need? I can probably start reading the MAN texts right from my browser before I even begin the project.

I'll also contact one of the few remaining ReplayTV Gurus, familiar with copying smaller HDDs to larger HDDs and extracting TV shows off a HDD with a corrupt system partition. Maybe there are ReplayTV 'Tools' that I already have that can do the necessary editing and moving. Regarding the moving, would you just 'Do It!' or would you first copy the necessary sectors off to another HDD, then copy them back at a starting address 8 bytes higher? Do I need to zero-fill the original 8 bytes?
Thanks!
NOTE: I re-formatted your original post(s), highlighting what I feel are the critical points (for ME at least), and copied in portions of Posts #90, #6, #11 and #60 for future reference and to be able to PRINT from 'View Single Post'. 
FB000_00.LST.dimg.txt 1.5k . file