brock@arden:~/sysadmin/notes/tryit$ od -j 768 -A d -t a boot.rootdir.img
0000768   B   C   M   2   7   0   ~   4   D   T   B  sp nul   d   $ can
0000784   S   J   S   J nul nul   $ can   S   J   W  ff   |   ; nul nul
0000800   A   C nul   O nul   P nul   Y nul   I nul  si nul dc2   N nul
0000816   G nul   . nul   l nul   i nul   n nul nul nul   u nul   x nul
0000832   C   O   P   Y   I   N   ~   1   L   I   N  sp nul nul   & can
0000848   S   J   S   J nul nul   & can   S   J   [ dle enq   I nul nul
0000864   A   b nul   o nul   o nul   t nul   c nul  si nul enq   o nul
0000880   d nul   e nul   . nul   b nul   i nul nul nul   n nul nul nul
0000896   B   O   O   T   C   O   D   E   B   I   N  sp nul   d   # can
0000912   S   J   S   J nul nul   # can   S   J   M  ff  ff   F nul nul
brock@arden:~/sysadmin/notes/tryit$ od -j 800 -N 64 -A d -t a boot.rootdir.img
0000800   A   C nul   O nul   P nul   Y nul   I nul  si nul dc2   N nul
0000816   G nul   . nul   l nul   i nul   n nul nul nul   u nul   x nul
0000832   C   O   P   Y   I   N   ~   1   L   I   N  sp nul nul   & can
0000848   S   J   S   J nul nul   & can   S   J   [ dle enq   I nul nul
0000864
brock@arden:~/sysadmin/notes/tryit$ od -j 800 -N 64 -A d -t x1 boot.rootdir.img
0000800 41 43 00 4f 00 50 00 59 00 49 00 0f 00 12 4e 00
0000816 47 00 2e 00 6c 00 69 00 6e 00 00 00 75 00 78 00
0000832 43 4f 50 59 49 4e 7e 31 4c 49 4e 20 00 00 26 98
0000848 53 4a 53 4a 00 00 26 98 53 4a 5b 10 05 49 00 00
0000864
brock@arden:~/sysadmin/notes$ cd tryit2
brock@arden:~/sysadmin/notes/tryit2$ dd if=boot.rootdir.img of=copying.linux.direntry.txt bs=1 skip=832 count=32
32+0 records in
32+0 records out
32 bytes (32 B) copied, 0.0311975 s, 1.0 kB/s
brock@arden:~/sysadmin/notes/tryit2$ od -A d -j 26 -N 2 -t d2 copying.linux.direntry.txt 
0000026   4187
0000028
brock@arden:~/sysadmin/notes/tryit2$ od -A d -j 28 -N 4 -t d4 copying.linux.direntry.txt 
0000028       18693
0000032
brock@arden:~/sysadmin/notes/tryit2$ CopyingLinuxCluster1=4187
brock@arden:~/sysadmin/notes/tryit2$ od -A d -j 8300 -t d2 boot.img.fat | head -20
0008300   4151   4152   4153   4154   4155   4156   4157   4158
0008316   4159   4160   4161   4162   4163   4164   4165   4166
0008332   4167   4168   4169   4170   4171   4172   4173   4174
0008348   4175   4176   4177   4178   4179   4180   4181   4182
0008364   4183   4184   4185   4186     -1   4188   4189     -1
0008380   4191   4192   4193   4194   4195   4196     -1     -1
0008396     -1     -1     -1     -1     -1     -1     -1     -1
*
0008476     -1     -1   4241     -1     -1     -1     -1     -1
0008492     -1     -1     -1     -1     -1     -1     -1     -1
*
0008588      0      0      0      0      0      0      0      0
*
0016380      0      0
0016384
brock@arden:~/sysadmin/notes/tryit2$ od -j 832 -N 32 -A d -t d2 boot.rootdir.img 
0000832  20291  22864  20041  12670  18764   8270      0 -26586
0000848  19027  19027      0 -26586  19027   4187  18693      0
0000864
brock@arden:~/sysadmin/notes/tryit2$ od -A d -j 8374 -N 2 -t d2 boot.img.fat
0008374   4188
0008376
brock@arden:~/sysadmin/notes/tryit2$ CopyingLinuxCluster1=4187
brock@arden:~/sysadmin/notes/tryit2$ od -A d -j $(( $CopyingLinuxCluster1 * 2 )) -N 2 -t d2 boot.img.fat
0008374   4188
0008376
brock@arden:~/sysadmin/notes/tryit2$ CopyingLinuxCluster2=4188
brock@arden:~/sysadmin/notes/tryit2$ od -A d -j $(( $CopyingLinuxCluster2 * 2 )) -N 2 -t d2 boot.img.fat
0008376   4189
0008378
brock@arden:~/sysadmin/notes/tryit2$ CopyingLinuxCluster3=4189
brock@arden:~/sysadmin/notes/tryit2$ od -A d -j $(( $CopyingLinuxCluster3 * 2 )) -N 2 -t d2 boot.img.fat
0008378     -1
0008380
brock@arden:~/sysadmin/notes/tryit2$ BPB_SecPerClus=16
brock@arden:~/sysadmin/notes/tryit2$ FirstDataSection=97
brock@arden:~/sysadmin/notes/tryit2$ function DataSector2Cluster()
> {
>    local result=$(( ( ( $1 - 2 ) * $BPB_SecPerClus ) + $FirstDataSector ))
>    echo "$result"
> }
brock@arden:~/sysadmin/notes/tryit2$ FirstDataSector=97
brock@arden:~/sysadmin/notes/tryit2$ DataSector2Cluster $CopyingLinuxCluster1
67057
brock@arden:~/sysadmin/notes/tryit2$ DataSector2Cluster $CopyingLinuxCluster2
67073
brock@arden:~/sysadmin/notes/tryit2$ DataSector2Cluster $CopyingLinuxCluster3
67089
brock@arden:~/sysadmin/notes/tryit2$ dd if=boot.img of=CopyingLinux1 skip=67057 bs=512 count=16
16+0 records in
16+0 records out
8192 bytes (8.2 kB) copied, 0.0257388 s, 318 kB/s
brock@arden:~/sysadmin/notes/tryit2$ dd if=boot.img of=CopyingLinux2 skip=67073 bs=512 count=16
16+0 records in
16+0 records out
8192 bytes (8.2 kB) copied, 0.0349236 s, 235 kB/s
brock@arden:~/sysadmin/notes/tryit2$ dd if=boot.img of=CopyingLinux3 skip=67089 bs=512 count=16
16+0 records in
16+0 records out
8192 bytes (8.2 kB) copied, 0.0333907 s, 245 kB/s
brock@arden:~/sysadmin/notes/tryit2$ cat CopyingLinux? > CopyingLinuxClusters
brock@arden:~/sysadmin/notes/tryit2$ dd if=CopyingLinuxClusters of=COPYING.linux bs=1 count=18693
18693+0 records in
18693+0 records out
18693 bytes (19 kB) copied, 0.0583077 s, 321 kB/s
brock@arden:~/sysadmin/notes/tryit2$ ls -l C*
-rw-r--r-- 1 brock users 18693 Apr 24 22:33 COPYING.linux
-rw-r--r-- 1 brock users  8192 Apr 24 22:30 CopyingLinux1
-rw-r--r-- 1 brock users  8192 Apr 24 22:31 CopyingLinux2
-rw-r--r-- 1 brock users  8192 Apr 24 22:31 CopyingLinux3
-rw-r--r-- 1 brock users 24576 Apr 24 22:32 CopyingLinuxClusters
brock@arden:~/sysadmin/notes/tryit2$ cksum COPYING.linux 
2507618403 18693 COPYING.linux
