Synch between live USB and installed system?

Forum Forums New users New Users and General Questions Synch between live USB and installed system?

  • This topic has 7 replies, 3 voices, and was last updated Jan 12-11:16 pm by Splined.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #15552


    First off, thanks for Antix! So many great features and tools that just seem more streamlined or faster or simpler than what I am used to.
    I ran off the LiveUSB for quite a while before installing, and it was a great deal to have (almost) all of my changes transfer over.
    I’d love to be able to keep the USB as a backup of my system. Any problem with the laptop, just reinstall. But, obviously as I make changes to the installed version the LiveUSB won’t reflect them.

    Is there any way to keep the LiveUSB synchronized after installation?


    There is a “sort of, sync-like” feature exclusive to antiX and available since 2014 (antix14.8 or earlier) which has never been documented, AFAIK.

    From piecing together the few times it has been mentioned in the (now archived) forums, and from memory of the few times I utilized the feature years ago, I’ll attempt to explain/describe the feature.

    On the LiveUSB, there’s a top-level directory named “antiX”.
    If, on your installed system, you create an “xtra.tgz” archivefile containing the files you wish to update (sync) and copy the archivefile to the LiveUSB path /antiX/xtra.tgz …during next liveboot ( and during each subsequent boot, until/unless you delete /antiX/xtra.tgz ) the archive contents will be be extracted into place within the root filesystem of the LiveUSB.

    To achieve a permanent merge:

    1) liveboot a persistent session with /antiX/xtra.tgz present and perform a persist-save operation to merge the changes into the rootfs, then

    2) move, rename, or delete the /antiX/xtra.tgz file

    If you skip #2 and allow /antiX/xtra.tgz to remain, understand that its content will again be extracted during each boot ~~ overwriting any pre-existing same-pathed files present within the rootfs. Why might you choose allow /antiX/xtra.tgz to remain? A good usage example would be to achieve (re)placement (re-injection) of a fresh copy of your ~/.mozilla/ directory each time you liveboot — even if persistence was in effect during a previous liveboot session.


    bonus points (aka Advanced Usage):

    If the LiveUSB (boot-dev partition) is ext4, instead of (or in addition to) placing a /antiX/xtra.tgz file,
    you can plant loose files, pathed to e.g. /antiX/xtra/home/myusername/Documents/somefile.txt
    and they will automatically be injected to, e.g. /home/myusername/Documents/somefile.txt within the rootfs
    Note: I use root_persist. On my live system the files would be injected into place within the rootfs.
    If you use root+home persist, or only home_persist, you should expect that example file will be injected in the homefs file instead.
    Remember, any injected files are in place, available during the session… but files pathed outside of /home are not merged into the rootfs unless you have booted a persistence session and you perform a persist-save operation (or, if “automatic” mode persistence is in effect, and is performed during a clean shutdown).

    If, for some reason, the LiveUSB partition is formatted exfat//FAT32
    and you choose to attempt using the “xtra” feature, you can (should) expect that any injected “loose” files may have
    lost their original unix permissions (I’m guessing here: they become non-executable, and owned by root)
    and any uppercase characters within their filenames probably wind up converted to lowercase.


    Further Caveats

    Possibly the reason this feature hasn’t been documented / advertised is that sync-ing (er, side-loading) files into place can be detrimental.

    Consider: The apt/dpkg database is blind to the presence of any injected files.

    If someone would attempt to uninstall/purge (files from) an injected package, dpkg will report “no can do, that package is not installed”

    If someone would accidentally inject any foriegn dpkg (database,logs,cache) files, the dpkg mechanism would become hopelessly corrupted.

    Even if “no new/additional packages” are injected, individual config files (or executables, or components) belonging to packages which have been updated on the remote (non-live) installation might not function correctly when injected, piecemeal, into the live system.


    an additional tidbit:
    The live init SHOULD recognize (I have not tested) a noxtra bootline parameter.
    If, during a given liveboot, you append noxtra to the boot line, activation of the “xtra” feature is suppressed.
    This enables you to leave in place the to-be-injected xtra.tgz and/or individual loose /antiX/xtra/[…] files,
    selectively choosing whether or not they should be injected for the current session.

    We can also autoinject .deb files by creating a “/antiX/deb/” subdirectory on the LiveUSB and placing /antiX/deb/*.deb
    Optionally, can specify the exact install ordering for the debfiles by placing a “/antiX/deb/order” textfile containing a one-debfilename-per-line list.
    Specifying a liveboot parameter nodeb will suppress, for the current boot session, injection of any /antiX/deb/*.deb files


    In conjunction with the noxtra bootline parameter, the antiX live init also recognizes a doxtra parameter.
    I suspect (but have not tested) this accommodates use of “F8 Save”
    (present on antiX legacyBIOS liveboot screen, might not be seen during EFI boot)

    If, during a previous liveboot the noxtra had been added, and F8Save was requested…
    …during subsequent boots the “noxtra” would remain in effect (but, confusingly, not visible in the Custom bootline).
    Placing doxtra in the bootline and NOT electing F8Save would accommodate a scenario like “yeah, just for this session, I want to load those extra files & have ’em overwrite their same-named counterparts.”

    Overwrite ~= overshadow
    For a given use case, maybe you are choosing to inject extra files which reside in the (read-only) linuxfs.
    For a different use case, maybe you are injecting files into rootfs, and intend to followup by performing persist-save, or live-remaster.

    Injections are handy for conducting testing ~~ you can, but are not committed to performing persist-save to permanently merge the injected files.

    Forum Admin

    Is there any way to keep the LiveUSB synchronized after installation?

    No. I don’t think there is. The closest thing we have is to use the snapshot tool to make an iso and then use live-usb-maker to make a live-usb from the iso. There would be ways to skip some steps but they would involve programming. The big step is creating the compressed linuxfs file and that can’t really be skipped.

    I think snapshot, optionally followed by live-usb-maker is the way to go for you purposes. Depending on how much stuff you’ve installed, you can keep many snapshots on your computer and on a good quality $10 usb stick or other storage device. You could even use grub to boot directly from one of the iso files although you lose some of the live-usb features when you do that.

    Context is worth 80 IQ points -- Alan Kay


    antiX ControlCenter –} Maintenance –} Create Snapshot
    or commandline: sudo isosnapshot

    antiX / MX snapshot: walkthrough video (video say “MX” but is relevant to antiX also)
    antiX / MX wiki: search results page for “snapshot”

    You can find documentation for live-usb-maker in the wiki, or from the commandline: man live-usb-maker


    Ok, that’s * a little * more involved than I was hoping for. Thanks for all the detailed info. Not sure I’m up for that much of a challenge, but I may give it a shot.

    Forum Admin

    I hope you give it a try. It is really very easy. Do your backups with the snapshot program. Use live-usb-maker to make one or more of them into a live-usb. To be safe, copy the snapshot iso file off-site with something like Dropbox.

    There are several impediments to copying the installed system directly to a live-usb. First, there are differences in the files. We have programs live-to-installed and installed-to-live to switch back and forth so this is not a show stopper. The next problem is that the file system on the live-usb (and on the iso) is compressed into a single file called linuxfs. There is no real way of getting around recompressing your entire file system. If you are running a live system we will recompress for you with the live-remaster program or snapshot. If you are running installed, the only program we offer that will recompress the file system is snapshot.

    In theory, we could probably make some modifications to live-remaster so it runs on an installed system but there has been very little demand for this feature and I really don’t think it is worth the effort. Unlike in poems, with computer stuff you usually want to avoid the road less traveled.

    Also, if you are interested, it is pretty easy to set up grub entries to boot directly from those iso files. I’m a big advocate for our live-usb but IMO snapshot to iso file is the best way to backup your installed system. For example, you can save many iso files in the same directory but you would have to make some manual changes to put multiple systems on a live-usb. A file is much easier to deal with than a physical usb stick. You can back it up to the cloud, share it electronically, copy it to another device, etc. Think of it as a live-usb in a single file.

    If you are interested in easy live-usb backup then the best way is to keep running live either with a live-usb or a frugal install. Many people do this. IIRC anticapitalista runs a frugal system. You can then use live-remaster to back up directly to the live system. You can go back to the previous version with the “rollback” boot code. If you combine this with semi-automatic dynamic root persistence then you have a lot of flexibility.

    In addition, whether you are running frugal or live-usb, you *can* backup to directly to another live-usb with live-usb-maker. When you are running live it will automatically offer to “clone” your live system. No iso file needed.

    Context is worth 80 IQ points -- Alan Kay


    So many options, I’m sure I can find one that works for me. Problem is now I’m going to have to go back and think about how I want to set things up. 🙂

    Man, the more I use Antix the more I like it. Thanks again.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.