maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N800 (https://talk.maemo.org/forumdisplay.php?f=25)
-   -   *really* backing up an n800? (https://talk.maemo.org/showthread.php?t=17562)

Quartz 2008-03-05 19:16

*really* backing up an n800?
 
so... I've been using an n800 (although not the same one- see below) for about a month and a half now. while I really like the device, I have one major issue:

is it in any way possible to access/mount/image/backup the onboard (not sd card) memory *without* installing the 3rd party init.fs bootmenu package?

I've been hacking away at this thing off and on, installing programs and changing stuff in /etc and various hildon config files, and a couple times now I've edited the wrong file the wrong way or installed an unstable program and caused the n800 to hang or crash on reboot. I solved those by reflashing, but that gets real old real fast.

I've been looking into ways to fully backup the n800 (or at least mount the internal memory on another machine so I can dd it), but I'm not finding any good solutions. the backup program that's provided by nokia is a joke as it doesn't actually backup any programs (much less /etc), searching on the forums lead me to init.fs, but installing that completely bricked my n800 (black screen, wouldn't boot, wouldn't charge, wouldn't reflash, wouldn't anything)... thankfully I was still within my 30 days return period so I was able to swap it for the one I have now.

it's kinda gotten to the point where I'm almost afraid to use it, at the very least, I'm very leery of installing anything or changing any settings anymore for fear of it hanging and me having to reflash it and lose everything again.



so I pose this question: is there any way I can get at the onboard memory on this thing without installing another program? do people have instructions on like building a cable for the serial port? would that even work? is my only option to keep buying (and potentially bricking) n800's till I get one where init.fs suceeds?

GeneralAntilles 2008-03-05 19:26

Re: *really* backing up an n800?
 
Just create a tarball of the rootfs?

fanoush 2008-03-05 20:12

Re: *really* backing up an n800?
 
Quote:

Originally Posted by GeneralAntilles (Post 151271)
Just create a tarball of the rootfs?

Yes, since OP asked only about backup, this is good suggestion. The hard part with tarball is how to restore it :-)

If one intends to restore backup as is, it is possible to create jffs2 image directly from rootfs and such image is flashable via Nokia linux flasher over USB.

See http://www.internettablettalk.com/fo...3348#post33348
or search this forum for sumtool, mkfs.jffs2 and possibly also nandwrite, flash_eraseall

fanoush 2008-03-05 20:28

Re: *really* backing up an n800?
 
Quote:

Originally Posted by Quartz (Post 151266)
searching on the forums lead me to init.fs, but installing that completely bricked my n800 (black screen, wouldn't boot, wouldn't charge, wouldn't reflash, wouldn't anything)...

Sounds scary but I believe it is just coincidence. Either the HW was really faulty or the "wouldn't reflash, wouldn't anything" part is not true. initfs flasher reflashes just initfs partition which may indeed render device temporarily unbootable, but in such state reflashing is still possible via Nokia flasher (just like when flashing bad linux kernel which is run even before initfs). While I understand that your experience is pretty discouraging, I still suggest to try to install bootmenu again.

dogsbody 2008-03-05 20:50

Re: *really* backing up an n800?
 
If I do say so myself I am really good with backups and have one of my home computers backing up all my machines each night via rsync (much faster and only backs up the files that have changed).

When I got my N800 I added a script to back that up too. I set my home router to always issue the IT the same IP every time it connects via WiFi (also makes things easier to connect to for other things). Each night the script pings the IT and if it's online will SSH to it and backup securely via rsync, this backs up the entire tablet including any cards loaded.

I also added a few more things, using hard links on my backup box I can keep weeks of backups using a fraction of the space and if the IT is offline for more than 10 days then I get an e-mail each night until it gets backed up :p

Quartz 2008-03-06 00:18

Re: *really* backing up an n800?
 
Quote:

Originally Posted by fanoush (Post 151307)
Sounds scary but I believe it is just coincidence. Either the HW was really faulty or the "wouldn't reflash, wouldn't anything" part is not true. initfs flasher reflashes just initfs partition which may indeed render device temporarily unbootable, but in such state reflashing is still possible via Nokia flasher.

when I installed init.fs, I followed the instructions that came with it, chose dropbear, etc. it then attempted to reboot but apparently died in the process. it wouldn't turn on no matter how long I held the power button (no Dpad light or anything), and plugging it into the charger would not display the 'charging' icon on the screen. I know the ac adapter and battery were good because I charged the battery ahead of time before I started, and tested them later before I returned everything to the store.

in any event, since I couldn't turn it on, I couldn't reflash it. and yes I tried leaving it out overnight with and without the battery.

dblank 2008-03-06 00:20

Re: *really* backing up an n800?
 
I use rsnapshot, which copies over the network with rsync.
With rsnapshot you can configure daily/hourly/whatever backups and it only stores the changes, then you can restore from any backup point.

rdiff-backup works similarly, but I've not tried it yet.

Quartz 2008-03-06 00:22

Re: *really* backing up an n800?
 
Quote:

Originally Posted by fanoush (Post 151297)
If one intends to restore backup as is, it is possible to create jffs2 image directly from rootfs and such image is flashable via Nokia linux flasher over USB.

See http://www.internettablettalk.com/fo...3348#post33348

I'll look into that. the thread you link to seems to imply I need to boot from an sd card first though, which AFAIK requires installing init.fs, which is exactly what I'm trying to avoid.

??

Quartz 2008-03-06 00:25

Re: *really* backing up an n800?
 
Quote:

Originally Posted by dogsbody (Post 151315)
via rsync, this backs up the entire tablet including any cards loaded.

I'm not sure how this would help me though if the tablet is borked and hanging on the splashscreen or something. unless I can get unrestricted access to the onboard memory from another machine, any other solution seems to require booting the tablet to some runlevel or another to run a restore program.

... unless you mean there's a way to convert that rsync into a flashable image I can use with the flasher program.

Quartz 2008-03-06 00:34

Re: *really* backing up an n800?
 
Quote:

Originally Posted by fanoush (Post 151297)
If one intends to restore backup as is, it is possible to create jffs2 image directly from rootfs and such image is flashable via Nokia linux flasher over USB.

if I could get a version of the flasher capable of ripping and re-writing the rootfs, that would be good enough. can the nokia/linux/mac version of the flasher program do this out of the box?

fanoush 2008-03-06 06:44

Re: *really* backing up an n800?
 
Quote:

Originally Posted by Quartz (Post 151393)
I'll look into that. the thread you link to seems to imply I need to boot from an sd card first though

Well, it is better but not strictly needed. When backing up live system you may end with some additional runtime garbage in the image but it doesn't hurt, better keep the system quiet when backing up. Also even with live system you are supposed to mount it again somewhere (like /opt) before backing up, don't use '/' path directly.
Quote:

Originally Posted by Quartz (Post 151393)
which AFAIK requires installing init.fs, which is exactly what I'm trying to avoid.

Well, no, even the stock initfs can boot from mmc but you need usb flasher to set the choice, there is no menu and only first found ext2 partition is used. When I created bootmenu, initfs could boot only from mmcblk0p1 which was not very useful for running cloned system. Later they added search_root_onmmc() which scans all mmc partitions for executable /sbin/init and first one is booted.

fanoush 2008-03-06 08:10

Re: *really* backing up an n800?
 
Quote:

Originally Posted by Quartz (Post 151394)
... unless you mean there's a way to convert that rsync into a flashable image I can use with the flasher program.

Yes, you can use mkfs.jffs2 also on linux desktop to create the image later. Linux/Mac flasher can write such image of rootfs (or initfs or kernel) separately. Sadly it cannot read it from device. Usage here
http://maemo.org/development/documen...sher_tool.html

fanoush 2008-03-06 08:31

Re: *really* backing up an n800?
 
Quote:

Originally Posted by Quartz (Post 151389)
in any event, since I couldn't turn it on, I couldn't reflash it. and yes I tried leaving it out overnight with and without the battery.

Could be faulty hardware or you may be victim of this http://blog.homac.de/?p=58 a.k.a Power up Drama http://bugs.maemo.org/show_bug.cgi?id=2673

As for installing initfs with bootmenu
Quote:

You can still skip the final flashing part and download created initfs.bootmenu.jffs2 image (and initfs.orig.jffs2 backup) to PC and flash via official flasher if you want to be extra safe.
so there is a way even if you don't want to use mtd-utils on device. Still, even completely erasing initfs partition is not enough to cause symptoms you saw. See also
http://maemo.org/development/documen...e.html#OSLayer
http://maemo.org/development/documen...ure.html#Flash

Quartz 2008-03-06 18:31

Re: *really* backing up an n800?
 
Quote:

Originally Posted by fanoush (Post 151501)
When backing up live system you may end with some additional runtime garbage in the image but it doesn't hurt, better keep the system quiet when backing up.

fair enough

Quote:

Originally Posted by fanoush (Post 151501)
Well, no, even the stock initfs can boot from mmc but you need usb flasher to set the choice,

really? ::looks::
is that the "set default root device" option? what's the syntax for that?

Quote:

Originally Posted by fanoush (Post 151501)
there is no menu and only first found ext2 partition is used. When I created bootmenu, initfs could boot only from mmcblk0p1 which was not very useful for running cloned system.

ok, this is the first I've ever heard about this. so if I were able to put an OS on an sd card, I could use the flasher to tell it to boot off it as long as it's p1? (what's the limitation here, that I can't have a fat32 partition for vm on the same card?)

Quote:

Originally Posted by fanoush (Post 151501)
Later they added search_root_onmmc() which scans all mmc partitions for executable /sbin/init and first one is booted.

define "later", I'm using what I believe is the first and only non-beta release of OS2008... or do you mean 'later' as in later hardware?

Quartz 2008-03-06 18:41

Re: *really* backing up an n800?
 
Quote:

Originally Posted by fanoush (Post 151518)
Yes, you can use mkfs.jffs2 also on linux desktop to create the image later. Linux/Mac flasher can write such image of rootfs (or initfs or kernel) separately.

neat, that looks promising, thanks. anyone have a link to a guide or something on how to use mkfs.jffs2 to make an image out of a folder/rsync?


Quote:

Originally Posted by fanoush (Post 151518)
Sadly it cannot read it from device.

bah, figures. that would be too easy, eh? :)


Quote:

Originally Posted by fanoush (Post 151524)
Could be faulty hardware or you may be victim of this http://blog.homac.de/?p=58 a.k.a Power up Drama http://bugs.maemo.org/show_bug.cgi?id=2673

yeah, that sounds like it alright. never thought about putting it in the freezer.

mrklaw 2008-03-06 19:13

Re: *really* backing up an n800?
 
I'd love to see some sample scripts to accomplish this. I want to implement a similar backup system using rsync.

Quote:

Originally Posted by dogsbody (Post 151315)
If I do say so myself I am really good with backups and have one of my home computers backing up all my machines each night via rsync (much faster and only backs up the files that have changed).

When I got my N800 I added a script to back that up too. I set my home router to always issue the IT the same IP every time it connects via WiFi (also makes things easier to connect to for other things). Each night the script pings the IT and if it's online will SSH to it and backup securely via rsync, this backs up the entire tablet including any cards loaded.

I also added a few more things, using hard links on my backup box I can keep weeks of backups using a fraction of the space and if the IT is offline for more than 10 days then I get an e-mail each night until it gets backed up :p


dogsbody 2008-03-06 21:14

Re: *really* backing up an n800?
 
Quote:

Originally Posted by mrklaw (Post 151640)
I'd love to see some sample scripts to accomplish this. I want to implement a similar backup system using rsync.

The cleaver stuff is really just one very long rsync command, e.g.
Code:

/usr/bin/rsync --bwlimit=512 -az --log-format=%f --numeric-ids --delete --rsh=ssh --stats --exclude-from=/backup/scripts/libs/host.example.com.exclude --link-dest=/backup/backups/host.example.com/2008-03-05-01 host.example.com:/ /backup/backups/host.example.com/2008-03-06-01
I actually blogged about it a while back if your interested (I really must finish building my website! :o )

All the scripting is just the checking that commands executed correctly and building up the above command.

I hope that helps.

mrklaw 2008-03-06 22:10

Re: *really* backing up an n800?
 
Thanks for the info!

Quartz 2008-03-11 03:19

Re: *really* backing up an n800?
 
so, I think doing daily rsyncs and compiling them to a flashable image is probably the best overall backup solution. can anyone point me to a reference on how to do this?

also, does anyone have any further information on booting from SD using the stock init.fs as fanoush noted? I'm curious what the limitations are.

fanoush 2008-03-11 06:17

Re: *really* backing up an n800?
 
Quote:

Originally Posted by Quartz (Post 153302)
can anyone point me to a reference on how to do this?.

mkfs.jffs2 is the command, see the link in post #3 for usage. Also try to search for 'rootfs' on www.maemo.org
Quote:

Originally Posted by Quartz (Post 153302)
also, does anyone have any further information on booting from SD using the stock init.fs as fanoush noted? I'm curious what the limitations are.

Check README.txt inside initfs_flasher.tgz and then maybe re-read this thread.

Quartz 2008-03-11 09:19

Re: *really* backing up an n800?
 
Quote:

Originally Posted by fanoush (Post 153350)
mkfs.jffs2 is the command, see the link in post #3 for usage.

ah ok, thanks. I missed that you had a complete command there with all the endian and cleanmarker parameters and stuff (which is what I was unsure of).

Quote:

Originally Posted by fanoush (Post 153350)
Check README.txt inside initfs_flasher.tgz and then maybe re-read this thread.

ok, that answers my question as to when they put in the partition searching, but I'm still curious what the limitations are re: first partition (even if it's a moot point now :) ).

I'm probably going to try your init.fs again, but I'm trying to make a couple bootable backups I can test on an SD card first in case something goes wrong again.

Valeria 2008-08-13 21:30

Re: *really* backing up an n800?
 
So, did this thread die? Is there no easy way to backup and restore? something for the average user...

geneven 2008-08-13 21:34

Re: *really* backing up an n800?
 
This is a FAQ and should be added to a Wiki when someone provides a clear answer. I don't worry about it myself, and am willing to accept smoke and ashes from my tablet from time to time. Starting over from nothing has its benefits.


All times are GMT. The time now is 14:31.

vBulletin® Version 3.8.8