[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Live-snapshot questions



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Answering to self, since I'm cooking up a workaround (might benefit
others, might help Marko debug things). Feel free to shed more light :-)

On Tue, Oct 14, 2008 at 12:36:28PM +0200, tomas@tuxteam.de wrote:
> Hi,
> 
> I have two questions wrt to live-snapshot (well, two-and-a-half :)
> 
> All is with a fairly recent live toolset on Lenny:
> 
>   ii  live-helper    1.0.1-1        Debian Live build scripts
>   ii  live-initramfs 1.139.1-3      Debian Live initramfs hook
> 
> 
>  (1) I'm trying to use a cpio.gz snapshot [...]
[...]
>    On boot of the live system all is fine. Problem arises when trying to
>    refresh the snapshot: in /etc/live.conf I see something like:
> 
>    /root:/dev/sdb1:live-sn.cpio.gz
     ^^^^^
[should be:]

>    /live/cow:/dev/sdb1:live-sn.cpio.gz
     ^^^^^^^^^

This entries are created in the live initramfs, /scripts/live, in
try_snap(). The idea is that the live-initramfs scripts stumble upon a
persistence image (e.g. live-sn.cpio.gz) they note its "coordinates" in
/etc/live.conf so that later "live-snapshot --refresh" knows where to
put things back, right?

The relevant line (executed once try_snap() has succeeded reading in a
snapshot) is

  	echo "export ${snap_type}SNAP="${snap_mount}":${snapdev}:${snapfile}" \
             >> /etc/live.conf # for resync on reboot/halt

(wrapping is mine). Now, I'd guess ${snap_mount} is wrong here (it
happens to be "/root" for ROOTSNAP, "/root/home" for HOMESNAP). I think
$snap_mount is where the top of the filesystem will be once we leave
initramfs. So this is the target where we *now* have to unpack the
contents of the persistence store, but later, we'll have to gather
things from where the overlay FS is mounted on: this will be /live/cow,
right? (i guess the initramfs / ends up as /live once we leave
initramfs).

So in setup_unionfs I'm doing

     try_snap "${root_snapshot_label}" "${rootmnt}" "/live/cow" "ROOT"
     try_snap "${home_snapshot_label}" "${rootmnt}/home" "/live/cow/home" "HOME"

thus passing try_snap an extra parameter, the "snapshot source" for
live-snapshot. I change try_snap thusly:

       try_snap ()
       {
        [...]
        snap_label="${1}"
        snap_mount="${2}"
        live_snap_source="${3}"
        snap_type="${4}"
        [...]

and then use $live_snap_source in the echo. I'd be glad to send in a
patch, but Marco said he's rewriting the whole thing anyay, so I'm
hesitant (since I don't even know how accurate my analysis is ;-)

Regards
- -- tomás






  	echo "export ${snap_type}SNAP="/live/cow:${snapdev}:${snapfile}" \
             >> /etc/live.conf # for resync on reboot/halt

> 
>    all works as expected (i.e. "sudo live-snapshot --refresh" writes out
>    the cpio archive with all the changes).
> 
>    Am I doing something wrong? Or is there a buglet somewhere?
> 
>  (2) Do I have to do anything special to have separate "live" and "home"
>    snapshots? As far as I can see, there is only one COW directory
>    mounted over / -- so any changes (included those in /home) would land
>    in live-sn. But I must be missing something, right?
> 
>  (3) Now to the half-question: I would like to take another kind of
>    snapshots: rsync snapshots over the net. Would there be interest in
>    it? Would it make sense to provide some hook magic, to not have all
>    the snapshot machinery built in? Ideas?
> 
> Thanks
> -- tomás
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-live-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFI+1TVBcgs9XrR2kYRArt0AJ9k5Q+GF5NLrjIEXpV/WSgbmQVPzgCfWHiZ
cW1W8deRgOQpmcVhD6591Lw=
=Ju/x
-----END PGP SIGNATURE-----


Reply to: