Public bug reported:

I have always relied on snapshots taken during boot when rolling back a
system since I started using zfs years ago, because I know the system is
in a consistent state while booting (no open files, no VM or containers
running etc.). With zsysctl this has become even easier.

I have created a simple systemd unit file /etc/systemd/system/zfs-
import-snap.service to achieve this. Perhaps it is a useful feature to
add.

[Unit]
Description=Snapshot ZFS pools after import
DefaultDependencies=no
Requires=zfs-import-scan.service zsysd.service
Before=zfs-mount.service
After=zfs-import-scan.service zsysd.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash -c '/usr/sbin/zsysctl save zb_$$(/usr/bin/date 
+%%Y%%m%%d-%%H%%M%%S) -s'

[Install]
WantedBy=zfs-mount.service
WantedBy=zfs.target

** Affects: zsys (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug focal

** Description changed:

  I have always relied on snapshots taken during boot when rolling back a
  system since I started using zfs years ago, because I know the system is
  in a consistent state while booting (no open files, no VM or containers
  running etc.). With zsysctl this has become even easier.
  
  I have created a simple systemd unit file /etc/systemd/system/zfs-
  import-snap.service to achieve this. Perhaps it is a useful feature to
  add.
  
  [Unit]
  Description=Snapshot ZFS pools after import
  DefaultDependencies=no
  Requires=zfs-import-scan.service zsysd.service
  Before=zfs-mount.service
  After=zfs-import-scan.service zsysd.service
  
  [Service]
  Type=oneshot
  RemainAfterExit=yes
  ExecStart=/bin/bash -c '/usr/sbin/zsysctl save zb_$$(/usr/bin/date 
+%%Y%%m%%d-%%H%%M%%S) -s'
  
  [Install]
  WantedBy=zfs-mount.service
  WantedBy=zfs.target
- 
- ProblemType: Bug
- DistroRelease: Ubuntu 20.04
- Package: zsys 0.4.5
- Uname: Linux 5.6.7-surface x86_64
- NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair nvidia_modeset 
nvidia
- ApportVersion: 2.20.11-0ubuntu27
- Architecture: amd64
- CasperMD5CheckResult: skip
- CurrentDesktop: ubuntu:GNOME
- Date: Mon Apr 27 21:44:37 2020
- InstallationDate: Installed on 2020-04-26 (1 days ago)
- InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
- ProcKernelCmdLine: BOOT_IMAGE=/BOOT/ubuntu_zj7a3r@/vmlinuz-5.6.7-surface 
root=ZFS=rpool/ROOT/ubuntu_zj7a3r ro quiet splash vt.handoff=1
- RelatedPackageVersions:
-  zfs-initramfs  0.8.3-1ubuntu12
-  zfsutils-linux 0.8.3-1ubuntu12
- SourcePackage: zsys
- UpgradeStatus: No upgrade log present (probably fresh install)
- ZFSImportedPools:
-  NAME               SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  
DEDUP    HEALTH  ALTROOT
-  bpool             1,88G   458M  1,43G        -         -     0%    23%  
1.00x    ONLINE  -
-  lenny-systempool   254G   190G  64,3G        -         -    36%    74%  
1.00x    ONLINE  -
-  rpool             79,5G  7,44G  72,1G        -         -     3%     9%  
1.00x    ONLINE  -
- ZFSListcache-bpool:
-  bpool        /boot   off     on      on      off     on      off     on      
off     -       none
-  bpool/BOOT   none    off     on      on      off     on      off     on      
off     -       none
-  bpool/BOOT/ubuntu_zj7a3r     /boot   on      on      on      off     on      
off     on      off     -       none

** Attachment removed: "Dependencies.txt"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361924/+files/Dependencies.txt

** Attachment removed: "Grub.cfg.txt"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361925/+files/Grub.cfg.txt

** Attachment removed: "Mounts.txt"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361926/+files/Mounts.txt

** Attachment removed: "MountsGenerated.txt"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361927/+files/MountsGenerated.txt

** Attachment removed: "ProcCpuinfoMinimal.txt"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361928/+files/ProcCpuinfoMinimal.txt

** Attachment removed: "ProcEnviron.txt"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361929/+files/ProcEnviron.txt

** Attachment removed: "SystemdDefaultUnitsState.txt"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361930/+files/SystemdDefaultUnitsState.txt

** Attachment removed: "SystemdFailedUnits.txt"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361931/+files/SystemdFailedUnits.txt

** Attachment removed: "ZFSDatasets.txt"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361932/+files/ZFSDatasets.txt

** Attachment removed: "ZFSListcache-rpool.txt"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361933/+files/ZFSListcache-rpool.txt

** Attachment removed: "ZFSModules.txt"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361934/+files/ZFSModules.txt

** Attachment removed: "ZFSMounts.txt"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361935/+files/ZFSMounts.txt

** Attachment removed: "ZFSPoolCache.gz"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361936/+files/ZFSPoolCache.gz

** Attachment removed: "ZFSPoolsStatus.txt"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361937/+files/ZFSPoolsStatus.txt

** Attachment removed: "ZSYSDump.txt"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361938/+files/ZSYSDump.txt

** Attachment removed: "ZSYSJournal.txt"
   
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+attachment/5361939/+files/ZSYSJournal.txt

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1875479

Title:
  Snapshot during system boot to get "known good configuration"

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to