{"id":34,"date":"2020-04-11T15:33:06","date_gmt":"2020-04-11T14:33:06","guid":{"rendered":"https:\/\/blog.thomarite.uk\/?p=34"},"modified":"2021-10-31T00:10:43","modified_gmt":"2021-10-30T23:10:43","slug":"zfs-basic","status":"publish","type":"post","link":"https:\/\/blog.thomarite.uk\/index.php\/2020\/04\/11\/zfs-basic\/","title":{"rendered":"ZFS Basic"},"content":{"rendered":"\n<p>A couple of weeks ago, at work,  sysadmin guys were working on some ZFS issues. They were talking about ZIL and ARC, and I had no idea what was that.<\/p>\n\n\n\n<p>I always wanted to run ZFS, so I think early 2019 I configured my laptop to use ZFS, not in the root partition but in a different partition. I had to configure my Debian Testing to support ZFS (I dont remember if it was very difficult) and then backup some data to make room for my new ZFS partition.<\/p>\n\n\n\n<p>For ZFS basics, you can follow the link below but there are many good tutorial searching in your favourite engine:<\/p>\n\n\n\n<figure class=\"wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-linux-hint\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"vkoM2ZD9hI\"><a href=\"https:\/\/linuxhint.com\/zfs-concepts-and-tutorial\/\">ZFS Concepts and Tutorial<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;ZFS Concepts and Tutorial&#8221; &#8212; \" src=\"https:\/\/linuxhint.com\/zfs-concepts-and-tutorial\/embed\/#?secret=vkoM2ZD9hI\" data-secret=\"vkoM2ZD9hI\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>In my case, it is a laptop, so I just have one pool that is based on my LV &#8220;storage&#8221;. I think this was the command I used:<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<pre class=\"wp-block-preformatted\">#zpool create -o mountpoint=\/home\/username storage \/dev\/mapper\/laptop--vg-storage<\/pre>\n\n\n\n<p>That would give me the following:<\/p>\n<\/div><\/div>\n<\/div><\/div>\n<\/div><\/div>\n<\/div><\/div>\n\n\n\n<pre class=\"wp-block-preformatted\"># zpool status\n  pool: storage\n state: ONLINE\nstatus: Some supported features are not enabled on the pool. The pool can\n\tstill be used, but some features are unavailable.\naction: Enable all features using 'zpool upgrade'. Once this is done,\n\tthe pool may no longer be accessible by software that does not support\n\tthe features. See zpool-features(5) for details.\n  scan: scrub repaired 0B in 0 days 00:10:39 with 0 errors on Sun Jan 12 00:34:40 2020\nconfig:\n\n\tNAME                  STATE     READ WRITE CKSUM\n\tstorage               ONLINE       0     0     0\n\t  laptop--vg-storage  ONLINE       0     0     0\n\nerrors: No known data errors\n# <\/pre>\n\n\n\n<p>And that would be mounted where I requested<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ df -hT | grep zfs\nstorage        zfs       176G   73G  103G  42% \/home\/username\/storage<\/pre>\n\n\n\n<p>This is too basic, in most cases your will want to have a kinf of RAID.  But again, this is a simple laptop. As well, you can configure snapshots (useful if you want to have rollback a server upgrade that involves a huge amount of data) and other performance parameters  (as per document below):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><a rel=\"noreferrer noopener\" href=\"https:\/\/www.percona.com\/live\/17\/sites\/default\/files\/slides\/pl17_ZFS_MySQL_Salesforce_0.pdf\" target=\"_blank\">https:\/\/www.percona.com\/live\/17\/sites\/default\/files\/slides\/pl17_ZFS_MySQL_Salesforce_0.pdf<\/a><\/pre>\n\n\n\n<p>So once you have your ZFS configured and mounted you can work with it as usual.<\/p>\n\n\n\n<p>So back to the ZIL and ARC. Based on the links below:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-wordpress wp-block-embed-wordpress is-provider-linux-hint\"><div class=\"wp-block-embed__wrapper\">\n\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-zfs-build\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/www.zfsbuild.com\/2010\/04\/15\/explanation-of-arc-and-l2arc\/\n<\/div><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>ZFS Intent Log, or ZIL, to buffer WRITE operations.<\/li><li>ARC and L2ARC which are meant for READ operations.<\/li><\/ul>\n\n\n\n<p>In my laptop, I dont have any space left to play with this, so I can only check in my employer systems.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A couple of weeks ago, at work, sysadmin guys were working on some ZFS issues. They were talking about ZIL and ARC, and I had no idea what was that. I always wanted to run ZFS, so I think early 2019 I configured my laptop to use ZFS, not in the root partition but in &hellip; <a href=\"https:\/\/blog.thomarite.uk\/index.php\/2020\/04\/11\/zfs-basic\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;ZFS Basic&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-unix"],"_links":{"self":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":3,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"predecessor-version":[{"id":762,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/34\/revisions\/762"}],"wp:attachment":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}