how do i transfer mtdblock off NVR?

wozzzzza

Getting the hang of it
Joined
Jan 5, 2015
Messages
385
Reaction score
82
I have telnetted to the NVR made a copy of the mtblocks, how do I now get them off the nvr?? I cant seem to connect to my NAS.
 

Dodutils

Pulling my weight
Joined
Dec 10, 2016
Messages
451
Reaction score
166
If you can't connect to external storage from the inside of your NVR then you'll have to retrieve it for the ounside, two ideas :

- copy your file into some WWW access of you NVR web interface (if any) or any place where you can access files for the outside

- depending the size of this "mtblocks" (I don't know what it is) if you NVR has some base64 command line tool, encode it and use any "sendmail" tool if any available or if not toot big simply "cat" it into your telnet session and copy/paste into you telnet's client machine, for example if you are using putty then activate log to file.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
mount a NFS Share, I dont think you have RPCBInd so you'll have to force nfsv3 and a few other things to get it to work
 

wozzzzza

Getting the hang of it
Joined
Jan 5, 2015
Messages
385
Reaction score
82
sounds too hard to me. gotta be another way surely?
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
not really, it dont have ftp binaries or anything.. you could try to transfer a ftp binary over console but thats a bit tricky manually.. have to base64 encode it then paste and then decode it so the binary data transfers over telnet.. I didnt have any luck with an xmodem file transfer

I have a mount point on my NFS with a couple of armv7 static binaries on it and I mount it on the camera, dump the mtd to ramdisk and then copy it to the NFS.. done it several times.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
read the man page for nfs mounts, it covers all the options.. I wrote em down somewhere to save me time but that computer recently crashed and trying to find that in the backups manually would be a chore.. took a few options to get it to work, I know forcing nfsv3 was required and disabling most permissions, work on your google fu and unix skills.. messing about with MTD and stuff requires you actually know what your doing or else your going to have a bad day when you turn this into a brick.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
Code:
cat /proc/kmsg
after attaching USB device and see what device the kernel registers it as; then mount that device.
 

tangent

IPCT Contributor
Joined
May 12, 2016
Messages
4,342
Reaction score
3,524
idk for sure what file systems are supported. You may be able to mount / format a flash drive from the web interface / osd.

The df command is a simple one that will come in handy.
 

wozzzzza

Getting the hang of it
Joined
Jan 5, 2015
Messages
385
Reaction score
82
ok finally done it, stuck in the USB drive, found it at "/mnt/msa" location
then I just used the commands here to copy the files across to the USB

cat /dev/mtdblock0 > /mnt/msa/mtdblock0
cat /dev/mtdblock1 > /mnt/msa/mtdblock1
cat /dev/mtdblock2 > /mnt/msa/mtdblock2

left me with files on my USB drive with the following sizes
mtdblock0 - 192KB
mtdblock1 - 128KB
mtdblock2 - 16,064KB

gee its been 15 years since I studied Linux commands at university as part of my degree, haven't used it since.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
good work, funny because I been using linux every day for more than 15 years, guess I'm that neckbeard that teaches unix now heh.

my 6yr old son's getting his first pc/laptop for xmas this year; with Debian and minecraft on it.. dad wants to lan party again :D
 

wozzzzza

Getting the hang of it
Joined
Jan 5, 2015
Messages
385
Reaction score
82
now I just gotta work out how to create a firmware file I can use to restore system if I fuk up the upgrade, anyone know how I can do this? I cant work out the hiktools advanced stuff
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,930
Reaction score
6,778
Location
Scotland
A worked example:
Code:
E:\hiktools>dir
 Volume in drive E is VBOX_Virtualbox_shared_folder
 Volume Serial Number is 0000-0813

 Directory of E:\hiktools

30/03/2015  15:55        16,449,536 mtdblock2
21/12/2016  09:22        13,308,012 digicap_308.dav
19/06/2015  16:15            16,384 hiktools05R1.exe
               3 File(s)     29,773,932 bytes
               0 Dir(s)  397,764,120,576 bytes free

E:\hiktools>mkdir tmp

E:\hiktools>copy mtdblock2 tmp\cramfs.img
        1 file(s) copied.

E:\hiktools>hiktools05r1 create digicap_308.dav tmp
 HIK firmware header converter 0.5R

Head raw data(108b) :
00000000 E9 9A F7 B6 E9 D1 DD D3 D6 B9 A3 AB BE CB B5 BE    ................
00000010 CC BC FE D6 E0 DD D3 BA 46 5C 54 40 34 4A 41 45    ........F\T@4JAE
00000020 43 01 29 35 22 2C 45 46 5C 54 40 34 B5 BE BA CD    C.)5",EF\T@4....
00000030 FE D6 CA DD D3 BA B9 A3 AB BF CB B5 BE BA CD BC    ................
00000040 B5 B8 BC BE DC CA 8D C2 D2 AC B5 BE BA CD BC FE    ................
00000050 CA DD D3 BA B9 A3 AB BF CB B5 BE BA CD BC FE D6    ................
00000060 B1 D3 BA B9 A3 BB 74 CB 0A 19 94 A8

Head decoded data(108b) :
00000000 53 57 4B 48 3F 1B 00 00 6C 00 00 00 01 00 00 00    SWKH??..l.......
00000010 01 00 00 00 2A 00 00 00 FF FF FF FF FF FF FF FF    ....*...........
00000020 FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00    ................
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000040 63 72 61 6D 66 73 2E 69 6D 67 00 00 00 00 00 00    cramfs.img......
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000060 6C 00 00 00 00 10 CB 00 BF A7 2E 65

Magic number :    0x484B5753
iHeaderCheckSum : 0x00001B3F [6975]
iHeadTotalLen :   0x0000006C [108]
iFileNum :        0x00000001 [1]
iLanguage :       0x00000001 [1] EN/ML
iDeviceClass :    0x0000002A
iOEMCode :        0xFFFFFFFF
iFirmwareVer :    0xFFFFFFFF
iFeature:         0xFFFFFFFF
Calculated CheckSum :        0x00001B3F [6975]


E:\hiktools>
E:\hiktools>dir
 Volume in drive E is VBOX_Virtualbox_shared_folder
 Volume Serial Number is 0000-0813

 Directory of E:\hiktools

21/12/2016  09:28    <DIR>          tmp
21/12/2016  09:29        16,449,644 tmp.dav
30/03/2015  15:55        16,449,536 mtdblock2
21/12/2016  09:22        13,308,012 digicap_308.dav
19/06/2015  16:15            16,384 hiktools05R1.exe
               4 File(s)     46,227,672 bytes
               1 Dir(s)  397,731,180,544 bytes free

E:\hiktools>rename tmp.dav digicap.dav

E:\hiktools>
 

wozzzzza

Getting the hang of it
Joined
Jan 5, 2015
Messages
385
Reaction score
82
makes it look easy. I will try it and see what gives just for fun.
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,930
Reaction score
6,778
Location
Scotland
cat /dev/mtdblock2 > /mnt/msa/mtdblock2
Strictly speaking - it's safer to unmount mtdblock2 before copying it, to safeguard against any conflicts that may give an incomplete file.
Something like:
Code:
umount /dev/mtdblock2
cat /dev/mtdblock2 > /tmp/mtdblock2_save
# copy out method of your choice
mount /dev/mtdblock2 /home/hik
 
Top