Management and Repository for FreeBSD Jails

Attention! Current pages describe cbsd version 10.0.3. If you are using an older version, please update first.

Attention! I'm apologize, but it is automatic machine translation of the text. You can improve it if will send to me more correct version of the text or fix html pages via GITHUB repository.

Jails snapshot (zfs-only)

jsnapshot command

                        % cbsd jsnapshot
                
Description:

Show the list, create, delete and rollback snapshots for a jail when node startend on ZFS filesystem and zfsfeat in file $workdir/nc.inventory set to 1. Through mode parameter you can you specify that it is necessary to make. Possible options:

  • list — show snapshot liss for current jail
  • create — create snapshot for jail
  • destroy — delete snapshot for jail
  • destroyall — remove all snapshots for jail
  • clone — clone snapshot into new jail
  • rollback — rollback jail to current snapshot state

Additional arguments:

  • jname — for what jail action is made
  • snapname — snapshot name

It should be borne in mind that snapshots have a tree structure. It mean, if you created a series of snapshots : 1,2,3,4 and fell back to a snapshot 2, then snapshots 3 and 4 will be lost, as against by the time of the snapshot 2 they were created in the future. Also arbitrary and unique name for a snapshot when you create, you can specify snapname=gettimeofday. In this case, the system automatically fills in as the name of the timestamp from the current time. When listing snapshots, you can use modifiers to clarify to what you want to see jail snapshots, and customize output field through argument display=

Example:

create snapshot named gromozeka for jail1 jail:

                        % cbsd jsnapshot mode=create jname=jail1 snapname=gromozeka
                

create snapshot named zelepuka for jail1 jail:

                        % cbsd jsnapshot mode=create jname=jail1 snapname=zelepuka
                

Run jail1 and stop after some modification:

                        % cbsd jstart jail1
                        ..
                        % cbsd jexec jname=jail1 cp /bin/date /root
                        % cbsd jexec jname=jail1 file -s /root/date
                        /root/date: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked (uses shared libs), for FreeBSD 9.0 (900506), stripped
                        % cbsd jstop jail1
                        ..
                

Rollback jail1 to snapshot zelepuka state:

                        % cbsd jsnapshot mode=rollback snapname=zelepuka jname=jail1
                        % cbsd jstart jail1
                        ...
                        % cbsd jexec jname=jail1 file -s /root/date
                        /root/date: ERROR: cannot open `/root/date' (No such file or directory)