View Single Post
Posts: 290 | Thanked: 385 times | Joined on Jan 2012 @ Madrid, Spain
#1312
Originally Posted by peterleinchen View Post
Short tutorial to backup full device with ubiboot (for console enthusiasts only ):

- power down device

- connect USB to device and PC (be it Linux or Windoze flavor)

- wait for maintenance mode screen
at this time you should notice also mounted drive(s) on PC,
on Windoze only p1, on Linux all partitions (according to your ubiboot.conf)
do NOT touch that drive under Windoze yet

- open a console on PC and telnet/ssh into N9

- create some mount points
mkdir /mnt/p1
mkdir /mnt/p2
mkdir /mnt/p3
mkdir /mnt/px #for other partitions you might have

- mount MyDocs read-write, rootfs (p2) and home (p3) read-only
mount -w -t vfat /dev/mmcblk0p1 /mnt/p1
mount -r -t ext4 /dev/mmcblk0p2 /mnt/p2
mount -r -t ext4 /dev/mmcblk0p3 /mnt/p3

- tar up rootfs and home on MyDocs
cd /mnt/p2
tar -cvf /mnt/p1/p2.tar *
cd /mnt/p3
tar -cvf /mnt/p1/p3.tar *

you may also use
tar -cvzf /mnt/p1/pX.tar.gz *
for compressed tar, but it will take ages...

- now unmount all
umount /mnt/p1
umount /mnt/p2
umount /mnt/p3

- if you like, grab the tar files on N9/MyDocs NOW via the mounted drive from PC (do this first at this stage/unmounting as MyDocs seems mountable twice from PC and from N9, read access should not get you into trouble, but concurrent write access may do so, to the extent of fully broken file system)

That's it. Full backup of device done under Windoze with the help of ubiboot maintenance mode.
For Linux you may do it the same way or just directly mount and tar from PC.

Thanks again to juiceme for providing such wonderful tool!


Just thought I write it down, even all above is obvious.
Maybe worth to add to wiki or Readme?



--
Restore:

- power down device

- connect USB to device and PC (be it Linux or Windoze flavor)

- wait for maintenance mode screen
at this time you should notice also mounted drive(s) on PC,
on Windoze only p1, on Linux all partitions (according to your ubiboot.conf)
do NOT touch that drive under Windoze yet

- open a console on PC and telnet/ssh into N9

- create some mount points
mkdir /mnt/p1
mkdir /mnt/p2
mkdir /mnt/p3
mkdir /mnt/px #for other partitions you might have

- mount MyDocs read-only, rootfs (p2) and home (p3) read-write
mount -r -t vfat /dev/mmcblk0p1 /mnt/p1
mount -w -t ext4 /dev/mmcblk0p2 /mnt/p2
mount -w -t ext4 /dev/mmcblk0p3 /mnt/p3

- untar rootfs and home from MyDocs
cd /mnt/p2
rm -fr *
tar -xvf /mnt/p1/p2.tar
cd /mnt/p3
rm -fr *
tar -xvf /mnt/p1/p3.tar

if you have compressed tar.gz, use
tar -xvzf /mnt/p1/pX.tar.gz

- now unmount all
umount /mnt/p1
umount /mnt/p2
umount /mnt/p3

If you need to copy the backup from PC back to N9 first, then do it as first step before mounting.

Disclaimer: verified the restore up to now only to copy Harmattan root from p2 to p5 and it worked. So I am convinced, this will work.

Hi.
Maybe a bit offtopic (and surely outdated) replay, but I just want to confirm this method just works.
I have tested it in my backup device (with openmode kernel) and so far it is working flawlessly.
However I have a pair of questions to ask:
1.- Can I do this procedure in a device without openmode kernel? My main device is not flashed with openmode .
2.- Given that only the ubiboot kernel is flashed to export the partitions: Can I skip the ubiboot installation process (i.e: will it work just flashing the ubiboot kernel, making the backup and then reflashing the stock kernel)?

Regards.
 

The Following 2 Users Say Thank You to pasko For This Useful Post: