View Single Post
Old 06-13-2015, 05:20 PM   #338
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
back up the internal sd with netcat

Some weeks ago in this forum, I promised to show how to back up the internal sd to the pc with KSM and netcat. This can be done via wifi or usbnet. For this example I use the usbnet version, and windows as OS on the pc. With linux it is almost the same. As for making usbnet and telnet work, see the first post of this thread (in the spoiler under "enable USBNet").

I downloaded "Netcat for Windows (without -e)" from there. In order to have short path names, let us suppose that I copied the program files to C:\nc111nt_rodneybeede\ (so that there is now for instance C:\nc111nt_rodneybeede\nc.exe). Do yourself a favour and use only a short path, and file and folder names without spaces or any suspect characters. See for the remaining steps the spoiler.

Spoiler:
On the Kobo remove the external sd if there is one, then
  • select "usb" > "usbnet toggle.sh" (I suppose it was disabled at this point)
  • select "return" in order to go back to the home

On the pc run "cmd" and open a telnet session:
Code:
telnet 192.168.2.101
then log in as "root".
First we have to kill every process that was started from /mnt/onboard. Therefore, we execute ps to see the running processes. (Still on the PC, in telnet window)
Code:
ps
In my case the relevant lines look like this
519 root 0:00 {ksmhome.sh} /bin/sh /mnt/onboard/.adds/kbmenu/onstart/ks
525 root 0:00 /sbin/getty -L ttymxc0 115200 vt100
527 root 0:00 /usr/sbin/inetd -f /etc/inetd.conf.user
849 root 0:00 [flush-179:0]
1088 root 0:00 /mnt/onboard/.adds/vlasovsoft/usbnet/dropbear -E -r /mnt/
1119 root 0:00 {kobomenu.sh} /bin/sh /mnt/onboard/.adds/kbmenu/kobomenu.
1120 root 0:00 /mnt/onboard/.adds/kbmenu/kobomenu info:help toggle_rotat
Next we kill these processes (I include preventfreeze.sh, even though it is not running in this case).
Code:
killall ksmhome.sh; killall kobomenu.sh; killall preventfreeze.sh; killall kobomenu; killall dropbear
List again the running processes with "ps" and check that none process including /mnt/onboard is still running.

Next we umount the user partion, and remount /dev/mmcblk0p1 and / as read-only. (Still on the PC, in telnet window
Code:
umount /mnt/onboard
mount -o remount,noatime,nodiratime,ro /dev/mmcblk0p1 /
If there is no error message, we continue
Code:
nc -l -p 1234 < /dev/mmcblk0
On the PC, open a new cmd window, change to the folder to which you want to save the sd image, and start transferring the data (KT02_20150613.dat is the file name that I chose):
Code:
cd C:\data\kobo_backups
C:\nc111nt_rodneybeede\nc.exe 192.168.2.101 1234 > KT02_20150613.dat
Wait until the transfer is finished (the cursors in the two terminal windows will re-appear).
On the PC, in the telnet window, restore the original mount states:
Code:
mount -o remount,noatime,nodiratime,rw /dev/mmcblk0p1 /
mount -t vfat -o iocharset=utf8 /dev/mmcblk0p3 /mnt/onboard
Now (still from the telnet window) we could restart KSM, but I prefer to reboot:
Code:
reboot
tshering is offline   Reply With Quote