• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1] 2
Author Topic: How to clone a SheevaPlug?  (Read 13711 times)
Eagle
Newbie
*

Karma: 0
Posts: 3


View Profile
« on: February 11, 2010, 12:53:51 PM »

Let's say you have your SheevaPlug configured as you want it and want to replicate it on another unit.  Is it possible to make something like CloneZilla clone from one SheevaPlug to another, either directly or by making an image first on a USB drive or a SD card?  How would one do that?

Thanks,

Eagle
Logged

Abra
Newbie
*

Karma: 1
Posts: 29


View Profile
« Reply #1 on: February 11, 2010, 05:30:31 PM »

using dd!

edit: ok I didn't help a lot... dd if=/dev/sda of=<some_file> (and some other options like blocksize etc, which make it run faster and can spare write cycles if you write on an SD card) copies *everything* from sda (partition table, fs, etc).
then you just have to dd if=file of=/dev/sdb
(note: I assumed your system was on some external storage, not the internal NAND. I do not own a sheevaplug, but from what I understood it is safer anyway)
« Last Edit: February 11, 2010, 07:27:03 PM by Abra » Logged

Eagle
Newbie
*

Karma: 0
Posts: 3


View Profile
« Reply #2 on: February 16, 2010, 08:06:42 AM »

Anybody have any ideas?
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #3 on: February 16, 2010, 08:14:08 AM »

Can you explain why you think Abra's idea not working for you?
Logged

Good Luck Smiley

cbxbiker61
Global Moderator
Sr. Member
*****

Karma: 38
Posts: 497


View Profile
« Reply #4 on: February 16, 2010, 08:35:41 AM »

What works well for me is to configure the sheeva with the root filesystem on SD.  Then when I want to backup the sheeva I shutdown, put the SD in in my notebook computer and tar up the SD image.  Restoring the SD is just a matter of formatting an SD and untarring my backup to the SD.  This makes it extremely easy to clone the sheeva.

Here's the script I run (on the notebook) to backup my SD.  The SD is mounted at /mnt/tmp.

#! /bin/bash
date=$(LC_ALL=C date +%Y.%m.%d)
sudo tar c -C /mnt/tmp --exclude=lost+found -J -v -f /var/tmp/SheevaRoot-$date.tar.xz .
Logged

Abra
Newbie
*

Karma: 1
Posts: 29


View Profile
« Reply #5 on: February 16, 2010, 09:29:29 AM »

I do not understand what the problem is: your solution seems to work: to replicate your plug, you would only have to format another SD card, untar your backup on it, and configure uboot (maybe copy a kernel in NAND if you want it to be loaded faster).
My suggestion with dd has the drawback of using more space on your laptop, and you must hace an SD card of at least the same size, but you don't need to format (it is good for a backup or if you have identical sd cards, or if you fine-tuned your partition).
Anyway, you have two solutions for one problem, so I don't really understand, or you missing a special feature or something?
Logged

Eagle
Newbie
*

Karma: 0
Posts: 3


View Profile
« Reply #6 on: February 16, 2010, 11:33:35 AM »

Can you explain why you think Abra's idea not working for you?

Maybe I'm misunderstanding, but I thought Abra's response was geared toward a file system residing on an SD card rather than the internal NAND.

Can dd copy from the currently mounted and running filesystem/os?
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #7 on: February 16, 2010, 12:36:39 PM »

@Eagle,

You are correct, it is not easy to use dd to access NAND. However your origin post does not make it clear hence my question. I was trying to understand what is your plug condition.

I think cbxbiker61 suggestion is very workable solution, the only modification I would add to it (because you want to clone running root file system on NAND)
Code:
unix # mkdir /tmp/a
unix # mount -o bind / /tmp/a #<=this will help excluding pseudo file system /proc, /sys and /dev
unix # tar c -C /tmp/a --exclude=lost+found -J -v -f /path/to/mounted/usb_or_sd/plug_clone.tar.xz .
unix # umount /tmp/a

Good luck Smiley
Logged

Good Luck Smiley

Abra
Newbie
*

Karma: 1
Posts: 29


View Profile
« Reply #8 on: February 16, 2010, 02:52:06 PM »

oops, sorry, I thought cbxbiker61 wrote the topic, that's why I was confused  Roll Eyes
Logged

SonicBoom
Newbie
*

Karma: 0
Posts: 11



View Profile
« Reply #9 on: April 13, 2010, 03:48:43 AM »

@pingtoo

Very clever and interesting! Thank you for your precious help.
Next point in this topic, now, should be how to reconfigure a sheevaplug using the .tar.xz file created.
Could you please help me?

Thank you in advance!
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #10 on: April 13, 2010, 06:30:56 AM »

Can you be more specific on
Quote
how to reconfigure a sheevaplug using the .tar.xz file created.
?

If you want to know how to use the .tar.xz file, you can use following command,
Code:
unix # tar -Jvxf /path/to/somehting.tat.xz -C /path/to/where/you/want/to/untar
Logged

Good Luck Smiley

fragfutter
Sr. Member
****

Karma: 12
Posts: 280


View Profile
« Reply #11 on: April 13, 2010, 06:56:24 AM »

guess its more like "how do i get the contend back into the flash"

Either boot the plug using an SD Card or a initrd (transfered with tftp). Then attach the ubifs and untar.
Logged

SonicBoom
Newbie
*

Karma: 0
Posts: 11



View Profile
« Reply #12 on: April 13, 2010, 08:23:41 AM »

@pingtoo

I'm sorry if I wasn't clear: that's because of my english! Smiley
By the term "reconfigure" I intended "install the whole operating system on a brand new sheevaplug", as guessed by fragfutter.
Thank you for your kindness and sorry again!

@fragfutter

What I'm trying to do is back-up (clone?) the whole NAND content on an USB-stick, and then clone it back on a different sheevaplug.
I understand what you says, but I don't know how to replicate in real life! Could you please be a little more specific and write down some step-by-step examples? Let's say: I used the pingtoo's script and now have my USB pen drive filled with my .tar.xz file. Now what? Smiley

Thank you both!!!
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #13 on: April 13, 2010, 10:57:56 AM »

@SonicBoom,

Please don't feel sorry, I just want to be sure on the question. I possibly have worst English than you.

Good luck Smiley
Logged

Good Luck Smiley

fragfutter
Sr. Member
****

Karma: 12
Posts: 280


View Profile
« Reply #14 on: April 13, 2010, 11:58:18 AM »

one needs to create an intitrd containing the mtd, ubifs and jffs2 tools. Then boot it using either tftp or loading it from sd (can the plug load from USB? no idea). Once inside the initrd format the mtd and attach it, then make the tarball accessibel (nfs mount, usb, sd-card). untar it and be done.

Sorry i don't have the initrd or a walkthrough for that. I currently have no idle system that is similiar to a plug. When I get a guruplug in, i can look into it (if i'm getting bored Wink)
Logged

Pages: [1] 2
Print
Jump to: