<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>ZFS &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/zfs/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Sun, 02 Apr 2023 12:37:43 +0000</lastBuildDate>
	<language>en-GB</language>
	<copyright>© Terence Eden. 🄯 CC BY-SA. See https://shkspr.mobi/blog/copyright-and-copyleft/</copyright>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>ZFS &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[ZFS - how to use a file as a ZIL]]></title>
		<link>https://shkspr.mobi/blog/2023/04/zfs-how-to-use-a-file-as-a-zil/</link>
					<comments>https://shkspr.mobi/blog/2023/04/zfs-how-to-use-a-file-as-a-zil/#respond</comments>
				<dc:creator><![CDATA[Terence Eden]]></dc:creator>
		<pubDate>Sun, 16 Apr 2023 11:34:51 +0000</pubDate>
		<category><![CDATA[HowTo]]></category><category><![CDATA[linux]]></category><category><![CDATA[ZFS]]></category>		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=45518</guid>

					<description><![CDATA[ZFS sometimes benefits from having a logging drive. Usually, you need to assign a whole device or partition to it. Unfortunately, I had already partitioned my SSD and didn&#039;t feel like repartitioning it.  So, here&#039;s how to create a file, mount it as a loopback, and then assign it to your ZFS pool as a logging drive.   Create a 1GB file somewhere on your SSD:   fallocate -l 1G zil.img  Mount the…]]></description>
										<content:encoded>&lt;p&gt;ZFS sometimes benefits from having a logging drive. Usually, you need to assign a whole device or partition to it. Unfortunately, I had already partitioned my SSD and didn't feel like repartitioning it.&lt;/p&gt;

&lt;p&gt;So, here's how to create a file, mount it as a loopback, and then assign it to your ZFS pool as a logging drive.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a 1GB file somewhere on your SSD:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;fallocate -l 1G zil.img&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Mount the file as a loopback device:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sudo losetup -fP zil.img&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Find the name of the new loopback device:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;losetup -a&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Add the new loopback device to your pool:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sudo zpool add your_pool log /dev/loop123&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Wait a few moments and then check it has been added using:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;zpool status&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Note - the loop won't be recreated after a reboot, so your ZFS will be a bit grumpy.  Remove it with:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sudo zpool remove data loop123&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Is there any point in doing this? No, not really. In my brief experiments it didn't make any appreciable different to the speed of my writes. Your use-case may be different though.&lt;/p&gt;
&lt;img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=45518&amp;amp;HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager"&gt;</content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/04/zfs-how-to-use-a-file-as-a-zil/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
