Active Topics

 


Reply
Thread Tools
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#671
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.
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature

Last edited by peterleinchen; 2013-11-01 at 11:06. Reason: added restore
 

The Following 5 Users Say Thank You to peterleinchen For This Useful Post:
Community Council | Posts: 4,920 | Thanked: 12,867 times | Joined on May 2012 @ Southerrn Finland
#672
Thanks for the guide, that's pretty much how it can be accomplished.
One minor suggestion, though;

For people using Windows, and hence never needing to mount the ext4fs partitions outside the device, I suggest you change the key
G_EXPORTED_PARTITONS="/dev/mmcblk0" to G_EXPORTED_PARTITONS="/dev/mmcblk0p1"

Reason for that is that even as the WinPC is not going to try to mount other than mmcblk0p1 ever, it is still safer not to try to export the other partitions if you are going to mount them inside the device.
 

The Following 2 Users Say Thank You to juiceme For This Useful Post:
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#673
Yep, generally a good idea.
BUT...
... this is one thing I wanted to ask you either:
when using maintenance mode with windoze (having G_EXPORTED_PARTITONS="/dev/mmcblk0"), I only get the first partition offered and it is mounted automatically. The others not. So no prob at all, right? Or we would get device busy error, or?
When using modified usbmoded, I do get all partitions offered and may mount my extfs partitions manually.
I would like ubiboot to behave the same way!?
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature

Last edited by peterleinchen; 2013-11-01 at 12:24.
 

The Following User Says Thank You to peterleinchen For This Useful Post:
Community Council | Posts: 4,920 | Thanked: 12,867 times | Joined on May 2012 @ Southerrn Finland
#674
Originally Posted by peterleinchen View Post
Yep, generally a good idea.
BUT...
... this is one thing I wanted to ask you either:
when using maintenance mode with windoze (having G_EXPORTED_PARTITONS="/dev/mmcblk0"), I only get the first partition offered and it is mounted automatically. The others not. So no prob at all, right? Or we would get device busy error, or?
When using modified usbmoded, I do get all partitions offered and may mount my extfs partitions manually.
I would like ubiboot to behave the same way!?
Hmm, that indeed so? But can you mount the rest of the partitions in Windows anyway, even if offered from the device since I thought there's some kind of ext2fs support but no ext4fs...?
Now I am not sure about this and have to test a bit. However, as for Linux, when /dev/mmcblk0 is offered all partitions are seen by the host computer.
 

The Following User Says Thank You to juiceme For This Useful Post:
Posts: 697 | Thanked: 137 times | Joined on Jul 2012 @ Hillerød, DK
#675
Isn't this an ext4fs for windows:
Paragon_ExtFS_for_Windows_2.41.exe ?
https://www.google.com/search?q=Para...ndows_2.41.exe

https://www.google.com/search?q=Para...4+for+windows8

http://www.paragon-software.com/home/extfs-windows/
__________________
OK

Last edited by Garp; 2013-11-01 at 15:14.
 

The Following User Says Thank You to Garp For This Useful Post:
Community Council | Posts: 4,920 | Thanked: 12,867 times | Joined on May 2012 @ Southerrn Finland
#676
Originally Posted by juiceme View Post
Now I am not sure about this and have to test a bit.
Okay, now I have tested a bit

The results are as follows;
  • if you set G_EXPORTED_PARTITONS="/dev/mmcblk0", you will get all partitions exported.
  • if you set G_EXPORTED_PARTITONS="/dev/mmcblk0p1", you will get just one partition exported.
  • if you set G_EXPORTED_PARTITONS="/dev/mmcblk0p1,dev/mmcblk0p2", you will get both partitions 1 and 2 exported.
    (the driver will contain 2 different luns in this case, one for each partition)

Now this above is what happens on Linux.
My guess is that on Windows the 1st and 2nd behave similarily, only the partition 1 gets exported, but the 3rd case would export both partitions correctly.
 

The Following User Says Thank You to juiceme For This Useful Post:
Posts: 324 | Thanked: 739 times | Joined on Jun 2009 @ São Paulo, Brazil
#677
Originally Posted by peterleinchen View Post
To juiceme's honor:
it seems I am the bad guy here.
I sent original harmattan preinit to juiceme via e-mail, but it took a short stop on MyDocs (vfat) for attaching to mail. This for sure removed all user rights from that file. As juiceme is only used to Linux, he did not check it once more before taring?
So my bad (should have zipped from ext drive). I do apologize!
Well, this is OSS evolving, this kind of thing happens. Besides, we are all grown ups, we can deal with bugs.
 

The Following 2 Users Say Thank You to traysh For This Useful Post:
TMavica's Avatar
Posts: 2,021 | Thanked: 1,060 times | Joined on Apr 2010 @ Hong Kong
#678
Successful after use new preinit..lucky I havent reflash it yet
__________________
The Glorious Lady T.Mavica
Twitter https://twitter.com/TMavica
 
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#679
Originally Posted by juiceme View Post
Okay, now I have tested a bit

The results are as follows;
  • if you set G_EXPORTED_PARTITONS="/dev/mmcblk0", you will get all partitions exported.
  • if you set G_EXPORTED_PARTITONS="/dev/mmcblk0p1", you will get just one partition exported.
  • if you set G_EXPORTED_PARTITONS="/dev/mmcblk0p1,dev/mmcblk0p2", you will get both partitions 1 and 2 exported.
    (the driver will contain 2 different luns in this case, one for each partition)

Now this above is what happens on Linux.
My guess is that on Windows the 1st and 2nd behave similarily, only the partition 1 gets exported, but the 3rd case would export both partitions correctly.
Absolutely correct ( I assume ).
Windoze recognizes only first partition on flash drives (default).
In usbmoded I have defined the partitions item by item (but without root and home, you remember? ). And it worked, so could have thought of trying it the same way (dumb me ).
Once more thank you.

Will test and let you know.
About ext support: I am using ext2Fsd, as it is OSS. ext2 rw, ext3 r(w), ext4 ro. But I normally need only to read from ext, When I have the need to write, I rely on a VM.
Paragon is closed (despite having had good experiences with their SW). Do not know about their reliability about write support.
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 
Posts: 335 | Thanked: 285 times | Joined on Sep 2012 @ Trento, Italy
#680
Originally Posted by juiceme View Post
I have corrected that to the preinits.tar file now.
Hi, is it correct to simply put the new preinits.tar to MyDocs and do tar -xvf preinits.tar -C / as in the wiki or? Thanks
__________________
Petition to get bug fixing for N9:
http://www.change.org/en-GB/petition...g-for-nokia-n9
 
Reply


 
Forum Jump


All times are GMT. The time now is 17:36.