automated_zfs_snapshots_for_omv5

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
automated_zfs_snapshots_for_omv5 [2021/05/05 23:44] crashtestautomated_zfs_snapshots_for_omv5 [2022/07/26 01:35] crashtest
Line 1: Line 1:
-{{ :underconstruction.jpg?400 |}} +<html><center><strong>Automated ZFS Snapshots for Openmediavault and 6</strong></center></html>
- +
-<html><center><strong>Automated ZFS Snapshots for openmediavault 5</strong></center></html>+
  
 {{ :zfs1.jpg?400 |}} {{ :zfs1.jpg?400 |}}
  
-====== Automated ZFS Snapshots for openmediavault 5 ======+====== Automated ZFS Snapshots for Openmediavault and 6 ======
 \\ \\
 <html><center><strong>How To setup automated, Self  Rotating and Purging ZFS snapshots</strong></center></html> <html><center><strong>How To setup automated, Self  Rotating and Purging ZFS snapshots</strong></center></html>
Line 22: Line 20:
 \\ \\
 **For ZFS users:**\\ **For ZFS users:**\\
-This guide will show how to setup and take advantage of one of ZFS' most valuable features for restoration, SNAPSHOTS.  **zfs-auto-snapshot**, automatically creates, prunes, and purges periodic snapshots.  Other than ZFS utilities which are installed with the ZFS filesystemand cron which is part of most Linux installations, there are no specific dependencies.+This guide will show how to setup and take advantage of one of ZFS' most valuable features for restoration, SNAPSHOTS.\\   
 +**zfs-auto-snapshot**, automatically creates, prunes, and purges periodic snapshots.  Other than ZFS utilitieswhich are installed with the ZFS filesystem and cronwhich is part of most Linux installations, there are no specific dependencies.
  
 While intended primarily for openmendiavault, this How-To and the package zfs-auto-snapshot will work with other Linux distributions with ZFS on Linux (ZOL). While intended primarily for openmendiavault, this How-To and the package zfs-auto-snapshot will work with other Linux distributions with ZFS on Linux (ZOL).
Line 31: Line 30:
  
 ---- ----
-\\+
 ==== General ==== ==== General ====
-\\+
 Given the design and function of a CoW (copy on write) filesystem, ZFS gives users the ability to “capture” the state of their file system at a given moment in time and preserve it using snapshots.  Since only changes to ZFS filesystems are maintained between current filesystem states and historic snapshots, snapshoting is very efficient.  For largely static pools, maintaining the cumulative differences between snapshots, shouldn't require more than an extra 25% disk space.   Given the design and function of a CoW (copy on write) filesystem, ZFS gives users the ability to “capture” the state of their file system at a given moment in time and preserve it using snapshots.  Since only changes to ZFS filesystems are maintained between current filesystem states and historic snapshots, snapshoting is very efficient.  For largely static pools, maintaining the cumulative differences between snapshots, shouldn't require more than an extra 25% disk space.  
 Having the ability to “roll back” the pool, individual filesystems in the pool, or retrieve individual files from previous snapshots has obvious advantages.  These abilities would allow an entire pool to be restored to a time before a virus infection, a ransomware infection, and allow the retrieval of  deleted files or previous versions of files.\\ Having the ability to “roll back” the pool, individual filesystems in the pool, or retrieve individual files from previous snapshots has obvious advantages.  These abilities would allow an entire pool to be restored to a time before a virus infection, a ransomware infection, and allow the retrieval of  deleted files or previous versions of files.\\
Line 83: Line 82:
 \\ \\
 **In the interests of clarity:**\\ **In the interests of clarity:**\\
-A ZFS “filesystem” is interchangeable with a standard Linux folder at the root of the pool and is navigable, on the command line, in the same manner.  The difference is a standard Linux folder at the root of the pool, is part of the parent pool.  A child “filesystem” is created by ZFS and is assigned editable ZFS properties.  A “filesystem snapshot” is taken independent of the parent pool and is independently restoreable. \\+A ZFS “filesystem” is interchangeable with a standard Linux folder at the root of the parent pool and is navigable, on the command line, in the same manner.  The difference is a standard Linux folder at the root of the pool, is part of the parent pool.  A child “filesystem” is created by ZFS and is assigned editable ZFS properties.  A “filesystem snapshot” is taken independent of the parent pool and is independently restoreable. \\
 \\ \\
 ---- ----
-==== Customizing Snapshot jobs ====+===== Customizing Snapshot jobs =====
  
 By default all snapshot time intervals are set to “**true**”.  Changes are required only if a specific time interval is not desired. By default all snapshot time intervals are set to “**true**”.  Changes are required only if a specific time interval is not desired.
Line 96: Line 95:
 \\ \\
 zfs set com.sun:auto-snapshot=**true** Rocky\\ zfs set com.sun:auto-snapshot=**true** Rocky\\
 +\\
 zfs set com.sun:auto-snapshot:frequent=true Rocky\\ zfs set com.sun:auto-snapshot:frequent=true Rocky\\
 zfs set com.sun:auto-snapshot:hourly=true Rocky\\ zfs set com.sun:auto-snapshot:hourly=true Rocky\\
Line 145: Line 145:
 While rolling back a file system or the parent pool is relatively easy, if going significantly back in time (beyond the most recent snapshot) the roll back feature will not work in the OMV GUI.  However, a roll back can be done with the following command line: While rolling back a file system or the parent pool is relatively easy, if going significantly back in time (beyond the most recent snapshot) the roll back feature will not work in the OMV GUI.  However, a roll back can be done with the following command line:
  
-(In this example, the roll back would be done to the entire parent pool “Rocky”.)+(In this example, the roll back would be done to the parent pool “Rocky”.)
  
 ''zfs rollback Rocky@zfs-auto-snap_hourly-2018-01-14-1617 -r''    ''zfs rollback Rocky@zfs-auto-snap_hourly-2018-01-14-1617 -r''   
Line 195: Line 195:
  
 ---- ----
-==== Notes: ====+===== Notes: =====
  
 1. For maximum snapshot flexibility, creating child filesystems on the parent pool is essential.\\ 1. For maximum snapshot flexibility, creating child filesystems on the parent pool is essential.\\
Line 215: Line 215:
 6. If more advanced features are needed, such as offloading snapshots to an external host, [[http://www.znapzend.org/|ZnapZend]] is a more appropriate solution.\\     6. If more advanced features are needed, such as offloading snapshots to an external host, [[http://www.znapzend.org/|ZnapZend]] is a more appropriate solution.\\    
 \\ \\
-=== Additional Information===+==== Additional Information ====
    
-zfs-auto-snapshot source:+==== zfs-auto-snapshot source ====
 https://github.com/zfsonlinux/zfs-auto-snapshot/ \\ https://github.com/zfsonlinux/zfs-auto-snapshot/ \\
 \\ \\
Line 223: Line 223:
 https://pthree.org/2012/12/19/zfs-administration-part-xii-snapshots-and-clones/ \\ https://pthree.org/2012/12/19/zfs-administration-part-xii-snapshots-and-clones/ \\
 \\ \\
-ZFS Video Tutorial:+==== ZFS Video Tutorial ====
 Part 1: https://sysadmincasts.com/episodes/35-zfs-on-linux-part-1-of-2  \\ Part 1: https://sysadmincasts.com/episodes/35-zfs-on-linux-part-1-of-2  \\
 Part 2: https://sysadmincasts.com/episodes/37-zfs-on-linux-part-2-of-2  \\ Part 2: https://sysadmincasts.com/episodes/37-zfs-on-linux-part-2-of-2  \\