Solved: Can i use the "btrfs-auto-snapshot xbiancopy" cli to restore an img file?
|
5th Feb, 2014, 11:32 PM
Post: #1
|
|||
|
|||
Can i use the "btrfs-auto-snapshot xbiancopy" cli to restore an img file?
I would like to restore an img file to an usb drive. The img file is much bigger then the usb drive, although the content should fit.
How do I do this? I'd like to do this from the RaspPi via ssh if possible. The btrfs file system is new to me. When I mounted the img file I noted that things were saved in /@/ folders. So I assume that just copying things over to a the brfs partition on the usb drive would not work. I tried using the xbiancopy via the cli but "btrfs-auto-snapshot xbiancopy -h" doesn't offer much in terms of documentation. |
|||
6th Feb, 2014, 12:27 AM
Post: #2
|
|||
|
|||
RE: Can i use the "btrfs-auto-snapshot xbiancopy" cli to restore an img file?
@TheBigD
btrfs-auto-snapshot has no support for restoring .img as this .img file is simply a blockdevice byte copy. normally, you would dd it back block device. the size of created .img file is "used data at the time copy was taken" + 300MB. the only difference you see comparing to other filesystems are the subvolumes (root, home, modules ...) you see. otherwise it is just filesystem as all others. if you are interested on system files, copy from "root/@". if you are interested in home (XBMC files, xbian user) then go for "home/@" (always remember to copy ownership and mode file !!! when copying). Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here |
|||
6th Feb, 2014, 04:17 AM
Post: #3
|
|||
|
|||
RE: Can i use the "btrfs-auto-snapshot xbiancopy" cli to restore an img file?
Ok, so copying the files should work. Do i need to recreate the sub volumes on the target partiton? Like this?
Terminal sudo -i #mount img file after using parted to see offset mount -o loop,ro,offset=36700160 /media/path/xbianBU140125/xbian.img /media/imgf #format and mount usb stick to be used for system umount /dev/sda2 mkfs.btrfs -L xbian-usb /dev/sda2 mount /dev/sda2 /mnt cd /mnt #create subvolumes? btrfs subvolume create root btrfs subvolume create home btrfs subvolume create modules btrfs subvolume create data #copy files rsync -aAX /media/imgf/root/@/* /mnt/root/ --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/home/*/.gvfs} --progress rsync -aAX /media/imgf/home/@/* /mnt/home/ --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/home/*/.gvfs} --progress rsync -aAX /media/imgf/modules/@/* /mnt/modules/ --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/home/*/.gvfs} --progress rsync -aAX /media/imgf/data/@/* /mnt/data/ --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/home/*/.gvfs} --progress |
|||
6th Feb, 2014, 04:51 AM
Post: #4
|
|||
|
|||
RE: Can i use the "btrfs-auto-snapshot xbiancopy" cli to restore an img file?
oh, ok, ... forget all above and ...
yes, you can extract .img file to a partition. you have to map the .img with partition layout and use xbiancopy function from command line with speecifiing source different than default /dev/root: Code: sudo -i depending on kernel package version installed on .img and actual on /boot, after system boots reinstall kernel package if needed Code: apt-get install xbian-package-kernel or second option is to take the /boot from img file (/dev/mapper/loop0p1) and copy to /boot Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here |
|||
6th Feb, 2014, 09:35 AM
Post: #5
|
|||
|
|||
RE: Can i use the "btrfs-auto-snapshot xbiancopy" cli to restore an img file?
Excellent! I haven't got it all up and running yet, but it seems that there is stuff on the usb stick now, so it looks promising.
Thanks! |
|||
8th Feb, 2014, 05:49 AM
Post: #6
|
|||
|
|||
RE: Can i use the "btrfs-auto-snapshot xbiancopy" cli to restore an img file?
Just a follow up. Everything is up and running from the USB, as it should. I'll try to change the heading to reflect that.
My img files do not seem to be "the size of created .img file is "used data at the time copy was taken" + 300MB. " however. They seem to be the size of a raw copy to me. |
|||
17th Mar, 2014, 11:37 PM
Post: #7
|
|||
|
|||
RE: Can i use the "btrfs-auto-snapshot xbiancopy" cli to restore an img file?
@TheBigD
"rawcopy" size ( -x00MB to allow flash if another card is used - same sized cards could have some minor differences) was used in very first version of this function. I can't tell when exactly it was enhanced but it was already a while back. Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here |
|||
« Next Oldest | Next Newest »
|