{"id":235,"date":"2011-01-10T13:16:48","date_gmt":"2011-01-10T12:16:48","guid":{"rendered":""},"modified":"2015-08-16T19:59:40","modified_gmt":"2015-08-16T17:59:40","slug":"masowe-snapshoty-zfs-2","status":"publish","type":"post","link":"https:\/\/drfugazi.eu.org\/en\/masowe-snapshoty-zfs-2\/","title":{"rendered":"Masowe snapshoty ZFS"},"content":{"rendered":"<p><\/p>\n<h4>ZFS is very friendly filesystem. You can do a snapshot quick and easy.<\/h4>\n<p>For example, if you have ZFS named <b><code>tank<\/code><\/b>, you can do snapshot named <b><code>snap1<\/code><\/b>:<\/p>\n<pre><code># zfs snapshot tank@snap1<\/code><\/pre>\n<p>Done. But what if you have several pools and several ZFS filesystems on each? You can do a simple loop:<\/p>\n<pre><code># for a in `zpool list -H -o name`; do zfs snapshot -r $a@20110109; done<\/code><\/pre>\n<p>This command will create recursive snapshots for all zpools in system. Naturally string 20110109 is exemplary and represents actual date.<\/p>\n<p><!--break--><\/p>","protected":false},"excerpt":{"rendered":"<h3>ZFS to taki fajny filesystem, w kt\u00f3rym szybko mo\u017cna zrobi\u0107 migawk\u0119 (snapshot).<\/h3>\n<p>Na przyk\u0142ad maj\u0105c ZFS o nazwie <b><code>tank<\/code><\/b>, robimy snapshot o nazwie <b><code>snap1<\/code><\/b>:<\/p>\n<pre><code>\r\n# zfs snapshot tank@snap1\r\n<\/code><\/pre>\n<p>Za\u0142atwione, operacja szybka i bezbolesna. Ale jak w systemie jest kilka zpool i na ka\u017cdej kilka filesystem\u00f3w ZFS to ju\u017c trzeba by si\u0119 troch\u0119 naklepa\u0107. Ja to za\u0142atwiam takim jednowierszowcem:<\/p>\n<pre><code>\r\n# for a in `zpool list -H -o name`; do zfs snapshot -r $a@20110109; done\r\n<\/code><\/pre>\n<p>Ta instrukcja spowoduje rekursywne utworzenie snapshot\u00f3w dla wszystkich zpool w systemie, oczywi\u015bcie ci\u0105g 20110109 jest przyk\u0142adowy i reprezentuje aktualn\u0105 dat\u0119.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[113],"tags":[114,9],"jetpack_publicize_connections":[],"acf":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7M9Tz-3N","jetpack-related-posts":[{"id":344,"url":"https:\/\/drfugazi.eu.org\/en\/masowe-snapshoty-zfs\/","url_meta":{"origin":235,"position":0},"title":"Masowe snapshoty ZFS","author":"","date":"Monday January 10th, 2011","format":false,"excerpt":"ZFS to taki fajny filesystem, w kt\u00f3rym szybko mo\u017cna zrobi\u0107 migawk\u0119 (snapshot). Na przyk\u0142ad maj\u0105c ZFS o nazwie tank, robimy snapshot o nazwie snap1: # zfs snapshot tank@snap1 Za\u0142atwione, operacja szybka i bezbolesna. Ale jak w systemie jest kilka zpool i na ka\u017cdej kilka filesystem\u00f3w ZFS to ju\u017c trzeba by\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":237,"url":"https:\/\/drfugazi.eu.org\/en\/usuwanie-starych-i-tworzenie-nowych-snapshotow-zfs\/","url_meta":{"origin":235,"position":1},"title":"Usuwanie starych i tworzenie nowych snapshot\u00f3w ZFS","author":"drfugazi","date":"Tuesday February  1st, 2011","format":false,"excerpt":"Niedawno pisa\u0142em o masowym tworzeniu snapshot\u00f3w ZFS. Tam robi\u0142em to rekursywnie dla ca\u0142ej puli u\u017cywaj\u0105c zpool list -H i przekierowuj\u0105c wyj\u015bcie do zfs snapshot -r. Tym razem zrobimy to inaczej. Je\u015bli mamy stare snapshoty to mo\u017cemy je wy\u015bwietli\u0107 poleceniem: # zfs list -t snapshot NAME USED AVAIL REFER MOUNTPOINT dappserv@20101130\u2026","rel":"","context":"In \"Solaris\"","block_context":{"text":"Solaris","link":"https:\/\/drfugazi.eu.org\/en\/tag\/solaris\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":345,"url":"https:\/\/drfugazi.eu.org\/en\/usuwanie-starych-i-tworzenie-nowych-snapshotow-zfs\/","url_meta":{"origin":235,"position":2},"title":"Usuwanie starych i tworzenie nowych snapshot\u00f3w ZFS","author":"","date":"Tuesday February  1st, 2011","format":false,"excerpt":"Niedawno pisa\u0142em o masowym tworzeniu snapshot\u00f3w ZFS. Tam robi\u0142em to rekursywnie dla ca\u0142ej puli u\u017cywaj\u0105c zpool list -H i przekierowuj\u0105c wyj\u015bcie do zfs snapshot -r. Tym razem zrobimy to inaczej. Je\u015bli mamy stare snapshoty to mo\u017cemy je wy\u015bwietli\u0107 poleceniem: # zfs list -t snapshot NAME USED AVAIL REFER MOUNTPOINT dappserv@20101130\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":238,"url":"https:\/\/drfugazi.eu.org\/en\/automatyczne-usuwanie-i-tworzenie-nowych-snapshotow\/","url_meta":{"origin":235,"position":3},"title":"Automatyczne usuwanie i tworzenie nowych snapshot\u00f3w","author":"drfugazi","date":"Monday February 28th, 2011","format":false,"excerpt":"Oto kolejny jednowierszowiec do usuwania starych i tworzenia nowych snapshot\u00f3w. Ju\u017c bez rozwodzenia si\u0119 po co, jak i dlaczego tak. Mo\u017cna dopisa\u0107 do crona. # for a in `zfs list -t snapshot -H -o name`; do zfs destroy $a && zfs snapshot `echo $a|sed \"s\/@.*\/\/\"`@`date +%Y%m%d`; done Uwaga: Tworzony jest\u2026","rel":"","context":"In \"Solaris\"","block_context":{"text":"Solaris","link":"https:\/\/drfugazi.eu.org\/en\/tag\/solaris\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":346,"url":"https:\/\/drfugazi.eu.org\/en\/automatyczne-usuwanie-i-tworzenie-nowych-snapshotow\/","url_meta":{"origin":235,"position":4},"title":"Automatyczne usuwanie i tworzenie nowych snapshot\u00f3w","author":"","date":"Monday February 28th, 2011","format":false,"excerpt":"Oto kolejny jednowierszowiec do usuwania starych i tworzenia nowych snapshot\u00f3w. Ju\u017c bez rozwodzenia si\u0119 po co, jak i dlaczego tak. Mo\u017cna dopisa\u0107 do crona. # for a in `zfs list -t snapshot -H -o name`; do zfs destroy $a && zfs snapshot `echo $a|sed \"s\/@.*\/\/\"`@`date +%Y%m%d`; done Uwaga: Tworzony jest\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":212,"url":"https:\/\/drfugazi.eu.org\/en\/how-remove-dataset-solaris-zone-and-mount-it-lofs\/","url_meta":{"origin":235,"position":5},"title":"How to remove dataset from Solaris zone and mount it as lofs","author":"drfugazi","date":"Tuesday August 17th, 2010","format":false,"excerpt":"Because of building mail system I need to export ZFS filesystem via NFS to other node, where postfix with deliver will save messages to mail boxes. As you can see in this installation transcript I configured whole zpool \"studmail\" as ZFS dataset for zone st1. Unfortunatelly, you can not simply\u2026","rel":"","context":"In \"Solaris\"","block_context":{"text":"Solaris","link":"https:\/\/drfugazi.eu.org\/en\/tag\/solaris\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/posts\/235"}],"collection":[{"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/comments?post=235"}],"version-history":[{"count":1,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/posts\/235\/revisions"}],"predecessor-version":[{"id":415,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/posts\/235\/revisions\/415"}],"wp:attachment":[{"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/media?parent=235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/categories?post=235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/tags?post=235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}