Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

Command-line version of XBian-copier
Thank you for your donation

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Command-line version of XBian-copier
28th Feb, 2014, 08:54 AM
Post: #1
palswim Offline
Registered
Posts: 42
Joined: Feb 2014
Reputation: 2
Command-line version of XBian-copier
I have been having issues with the XBian-copier utility, similar to other users (also a bug report of same). Before I directly troubleshoot that, I would like to know if I can invoke the XBian copier from a simple command (or set of commands), like
Code:
xbian-copier /dev/mmcblk0 /path/to/file.img

I was digging around in the xbian-config include files (in /usr/local/include/xbian-config/), but failed to extract something simple from them.

Summary: How can I execute the same function of the XBian-config's XBian copier from the command line?
Find all posts by this user
Quote this message in a reply
28th Feb, 2014, 11:57 PM
Post: #2
belese Offline
Moderator
******
Posts: 650
Joined: Jan 2013
Reputation: 38
RE: Command-line version of XBian-copier
here :

http://forum.xbian.org/thread-884-post-17029.html#pid17029

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
1st Mar, 2014, 04:49 AM
Post: #3
palswim Offline
Registered
Posts: 42
Joined: Feb 2014
Reputation: 2
RE: Command-line version of XBian-copier
From the other post, I can invoke the XBian-config utility's xbiancopy function:
Code:
xbian-config xbiancopy start source dest [label] [size]

source: Source partition - normally this is /dev/root (actually booted root), but can by used to copy others as well (btrfs only)
dest: Destination partition - like /dev/sda2 etc. if "dest" is prefixed with "file:", then file will be created
label: By default is "xbian-copy" used
size: (This makes sense only for destination as file.) By default, it is size of source partition, but sometimes, you have 16gb SD card, but 2gb used, so could be specified.

Examples:
Code:
xbian-config xbiancopy start /dev/root /dev/sda1
xbian-config xbiancopy start /dev/root file:/path/to/file.img

Check status with:
Code:
xbian-config xbiancopy status
After I ran this, status immediately returned 0, and I don't know for which status I am looking, but I find it more effective to check the modification time on the file I'm creating:
Code:
ls -l /path/to/file.img
I know it has finished when the last modified time stops increasing.


This method is a start. But, I am wondering which commands this Xbian copier is using to accomplish the copy.
Find all posts by this user
Quote this message in a reply
1st Mar, 2014, 05:18 AM
Post: #4
belese Offline
Moderator
******
Posts: 650
Joined: Jan 2013
Reputation: 38
RE: Command-line version of XBian-copier
i'm not the developer, but i think it use mk01 script (not really documented):
https://github.com/mk01/btrfs-auto-snapshot

if you want to know deeper, look into the code :-).

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
1st Mar, 2014, 06:29 AM
Post: #5
IriDium Offline
Inquisitor
******
Posts: 2,025
Joined: Jan 2013
Reputation: 170
RE: Command-line version of XBian-copier
I'm pretty sure there is lot more behind the clone function that you believe - dependencies, btrfs copys etc.

You are trying to invoke a command that was never intended, nor tested, to be invoked from the command line, so I'm not surprised you are encountering problems.

Please read before you post
How to post a log file

If you liked my help, click on "Thanks" to show your appreciation.
Find all posts by this user
Quote this message in a reply
1st Mar, 2014, 06:34 AM
Post: #6
palswim Offline
Registered
Posts: 42
Joined: Feb 2014
Reputation: 2
RE: Command-line version of XBian-copier
(1st Mar, 2014 06:29 AM)IriDium Wrote:  You are trying to invoke a command that was never intended, nor tested, to be invoked from the command line, so I'm not surprised you are encountering problems.

I had the problems using the "XBian copier" entry in the XBian-config utility. I'll have to verify more, but the command line seems to have worked better for me.
Find all posts by this user
Quote this message in a reply
1st Mar, 2014, 06:38 AM
Post: #7
belese Offline
Moderator
******
Posts: 650
Joined: Jan 2013
Reputation: 38
RE: Command-line version of XBian-copier
it should be really the same, as the gui call this command.
if you activate xbmc debug, try Xbian-copier in gui, and look at log, you will find the call "xbian-config xbiancopy start"

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
1st Mar, 2014, 06:44 AM
Post: #8
IriDium Offline
Inquisitor
******
Posts: 2,025
Joined: Jan 2013
Reputation: 170
RE: Command-line version of XBian-copier
Yes we are aware there is an issue with clone in RC1 and it was working in Beta 2.

If it works, then fine

Please read before you post
How to post a log file

If you liked my help, click on "Thanks" to show your appreciation.
Find all posts by this user
Quote this message in a reply
16th Mar, 2014, 03:17 PM
Post: #9
mk01 Offline
Registered
Posts: 2,485
Joined: Mar 2013
Reputation: 209
RE: Command-line version of XBian-copier
(1st Mar, 2014 06:34 AM)palswim Wrote:  
(1st Mar, 2014 06:29 AM)IriDium Wrote:  You are trying to invoke a command that was never intended, nor tested, to be invoked from the command line, so I'm not surprised you are encountering problems.

I had the problems using the "XBian copier" entry in the XBian-config utility. I'll have to verify more, but the command line seems to have worked better for me.

@palswim

the middleware is btrfs-auto-snapshot script which uses few different approaches. base idea for cloning btrfs is of course to use the native btrfs send | btrfs recv (it is atomic, copied are data streams not files so it is faster, supports incremental sends (on CoW the data saved since last send).

the img is created as:
1) file is created
2) file is truncated do needed size (size prealocation)
3) in the file 2 partitions are created (/boot and /btrfstop
3a) the parts are mounted via loop devices
4) into /boot /boot is copied and cmdline.txt adapted
5) btrfs send | btrfs recv is used to copy all found subvolumes
6) done

by default size of img is defined as used space reported by df (which unnecessary allocates waste space used by local snapshots which are NOT copied) + 500MB.

this size can be overriden on command line --size

check
Code:
btrfs-auto-snapshot --help

currently I added copying even from ANY filesystem to ANY files-system (via tar | tar -x) but because of formatting of dest partition only ext2/3/4 f2fs nfs is tested and paired with mkfs. this universal copy-to-copy is in /usr/local/include/xbian-config/modules/xbiancopy/main as one function.

btrfs-auto-snapshot is meant as universal snapshot management tool (cross platform). so xbian specifis are kept at xbian-config side, if needed actions resolve to btrfs & snapshots, btrfs-auto-snapshot is called.

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Possibly Related Threads...
Thread: Author Replies Views: Last Post
  Xbian-copier not working.... Skywatch 61 116,039 4th Dec, 2018 07:00 PM
Last Post: Skywatch
  [PROBLEM] Command line hangs husntvar 1 5,919 31st Dec, 2016 03:54 PM
Last Post: rikardo1979
  command line console does not fit on the screen Paul Lenz 3 9,178 29th Mar, 2016 06:16 AM
Last Post: Nachteule
  launch command line FROM kodi Enderswood 3 11,806 5th Feb, 2016 12:30 AM
Last Post: Enderswood
  XBMC Command line raspuca 2 25,964 15th Jul, 2013 05:52 AM
Last Post: mk01
  Using command line tietie 2 12,291 20th May, 2013 12:38 AM
Last Post: tietie

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 10th May, 2025, 10:07 PM Powered By MyBB, © 2002-2025 MyBB Group.