Forum
[SOLVED] duplicate/clone an xbian installation - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Configuration (/forum-17.html)
+--- Thread: [SOLVED] duplicate/clone an xbian installation (/thread-884.html)

Pages: 1 2 3


duplicate/clone an xbian installation - captainsammitch - 10th May, 2013 06:03 AM

Apologies if this thread is somehow an infraction against the forum procedures or out of format or in the wrong forum, but I checked the FAQ and other threads and haven't found an answer thus far. I work at a store in a modest-sized chain of computer stores and was recently handed the assignment (well, I kind of volunteered) to build a looping video kiosk for product promos, tech demos, and the like. I used the most recent release on an RPi v2 and have it configured exactly how I want it - plug it in, it boots into XBMC, shuffles the videos in a playlist and loops them continuously with no interaction needed. It's completely self-contained and everything is on the SD card.

Our store manager and I hit on the idea at the exact same time that if you could somehow clone that SD card with everything on it and ready to go, then you could have an identical kiosk in every store in the chain. Unfortunately, everything I've tried thus far to duplicate my existing installation has fallen flat. The problem is that the partition XBian is using for the root filesystem won't show up in any of the OSes to which I have access - I've tried XP, 7, 8, OSX 10.6, Mint 14 KDE, and even Paragon, DriveImageXML, and Clonezilla show that partition as unallocated space or don't pick it up at all. The only way I can add/remove videos or edit the contents of my userdata folder and subfolders is by piping in for FTP via SSH using WinSCP; I use PuTTY to config everything.

So what I'm wondering is, can I somehow clone the card on which XBian and our videos are kept so that I can pop the duplicate into another RPi and have the exact same thing happen that happens with our display unit when I come in in the morning? Or am I just going to have to do a separate install procedure on each card and manually drag-and-drop the media and any userdata and configs via the FTP program? I have a feeling the first option would be quite a bit quicker and make my manager a lot more likely to pitch this to home office. Any advice would be appreciated.


RE: duplicate/clone an xbian installation - rikardo1979 - 10th May, 2013 06:14 AM

on any Windows you can use XBian installer and use Advance mode and Backup or simple tools like Win32 disk imager
or similar and simply use the backup option. Than just plug your new empty sd card and use restore
Wink


RE: duplicate/clone an xbian installation - rikardo1979 - 10th May, 2013 06:32 AM

another great tool - USB Image Tool

with all of these tools you simply clone your card with all the content which is on it and simply restore to other cards. Than you plug those cards into your other RPi machines and you are ready to go Wink


RE: duplicate/clone an xbian installation - captainsammitch - 10th May, 2013 07:01 AM

Thank you very much! I will attempt this the next time I have enough time to work on the project.


RE: duplicate/clone an xbian installation - captainsammitch - 11th May, 2013 04:20 AM

Works perfectly. Thanks again for your help!


RE: duplicate/clone an xbian installation - rikardo1979 - 11th May, 2013 04:22 AM

(11th May, 2013 04:20 AM)captainsammitch Wrote:  Works perfectly. Thanks again for your help!

not a problem Wink glad you find what you was looking for
anything else come back any time Wink


Re: RE: duplicate/clone an xbian installation - kas_27_es - 17th May, 2013 03:04 PM

(11th May, 2013 04:22 AM)rikardo1979 Wrote:  
(11th May, 2013 04:20 AM)captainsammitch Wrote:  Works perfectly. Thanks again for your help!

not a problem Wink glad you find what you was looking for
anything else come back any time Wink

Is there a way to do the same on Linux?

Thanks


duplicate/clone an xbian installation - Koenkk - 17th May, 2013 03:32 PM

On linux just use DD


RE: duplicate/clone an xbian installation - kas_27_es - 17th May, 2013 04:47 PM

Ok, thanks I've found it:

Terminal
sudo dd if=/dev/sdb of=~/xbianBackup.img

Thanks, again.


RE: duplicate/clone an xbian installation - mk01 - 19th May, 2013 09:01 AM

guys again, those new ext4 fs inside .img will not be consistent. because that partition is root fs, it won't be possible to fsck it either so sooner or later the installation will collapse.


Re: RE: duplicate/clone an xbian installation - kas_27_es - 20th May, 2013 03:36 PM

(19th May, 2013 09:01 AM)mk01 Wrote:  guys again, those new ext4 fs inside .img will not be consistent. because that partition is root fs, it won't be possible to fsck it either so sooner or later the installation will collapse.

And then, how can I solve it?

Thanks


RE: duplicate/clone an xbian installation - mk01 - 20th May, 2013 06:32 PM

there is similar thread

http://forum.xbian.org/thread-427-post-10140.html#pid10140

btw: only now I realized there is /dev/sdb as "if", with this I'm fine. my point is valid for dd copies of filesystem which is booted and used as rootfs.

if you do offline dd copy (not booted from /dev/sdbX), i'm fine.


RE: duplicate/clone an xbian installation - effemmeffe - 29th May, 2013 07:10 PM

Hello, mk01.
I was trying to set up a live backup of my entire sd card, so I wrote this mesage: http://forum.xbian.org/thread-598-post-10917.html#pid10917
In the thread I got the suggestion to use the command line: dd if=/dev/mmbclk0 of=/media/usb/backup.img and so I did it.
Now I have a cronjob that does that command and I was confident that my sd wwas backupped.
Then I stumbled in this thread and now I have one doubt: is my backup working or I have to change it?


RE: duplicate/clone an xbian installation - mk01 - 2nd Jun, 2013 04:44 AM

(29th May, 2013 07:10 PM)effemmeffe Wrote:  Then I stumbled in this thread and now I have one doubt: is my backup working or I have to change it?

I was already explaining what is happening.

You can be lucky, if your RPI is idle and fs caches flushed.
dd created image of rw mounted / filesystem will never be atomic. It's not like a picture taken with a camera.

But you can always check how consistent is the img. Split the backup.img into two files (partition1 and partition2 - you can do it again with dd, just check with fdisk or sfdisk block sizes of p1 and p2).

then mount the files through loop devices (losetup /dev/loopX [filename]). this /dev/loopX you can mount as regular block device.

run ext fsck and you will see if is ok or not.

mk


RE: duplicate/clone an xbian installation - effemmeffe - 2nd Jun, 2013 06:27 AM

thanks. so i have to conclude there is no safe way to backup all my sd from inside the system, the only way would be remove the sd, put it in a card reader and dd it on an external system. not very friendly...