<?xml version="1.0" encoding="UTF-8"?><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>freenas &#8211; Giovanni F. Mazzeo De Santolo</title>
	<atom:link href="https://desantolo.com/tag/freenas/feed/" rel="self" type="application/rss+xml" />
	<link>https://desantolo.com</link>
	<description>That italian IT guy</description>
	<lastBuildDate>Sun, 27 Dec 2020 05:38:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
<site xmlns="com-wordpress:feed-additions:1">123042357</site>	<item>
		<title>FreeBSD/FreeNAS USB_ERR_TIMEOUT fix</title>
		<link>https://desantolo.com/2017/06/freebsd-freenas-usb_err_timeout-fix/</link>
		
		<dc:creator><![CDATA[Giovanni]]></dc:creator>
		<pubDate>Sun, 11 Jun 2017 19:26:20 +0000</pubDate>
				<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[freenas]]></category>
		<guid isPermaLink="false">https://desantolo.com/?p=534</guid>

					<description><![CDATA[As I prepare my migration to my new Debian ZFS system I wanted to backup my zpool onto an external 8TB hard drive. I came across this issue where after plugging in the external USB 3.0 hard drive it would &#8230; <a href="https://desantolo.com/2017/06/freebsd-freenas-usb_err_timeout-fix/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>As I prepare my migration to my new Debian ZFS system I wanted to backup my zpool onto an external 8TB hard drive. I came across this issue where after plugging in the external USB 3.0 hard drive it would loop and not work:</p>
<p><span id="more-534"></span><br />
<code>Jun 11 12:15:54 gserver xhci_do_command: Command timeout!<br />
Jun 11 12:15:54 gserver xhci_do_command: Controller reset!<br />
Jun 11 12:15:54 gserver xhci0: Resetting controller<br />
Jun 11 12:15:54 gserver usb_alloc_device: device init 2 failed (USB_ERR_TIMEOUT, ignored)<br />
Jun 11 12:15:54 gserver xhci_device_state_change:<br />
Jun 11 12:15:54 gserver ugen0.2: &lt;Unknown&gt; at usbus0 (disconnected)<br />
Jun 11 12:15:54 gserver uhub_reattach_port: could not allocate new device<br />
Jun 11 12:15:54 gserver xhci_root_intr: port 2 changed<br />
Jun 11 12:15:55 gserver xhci_root_intr: port 2 changed<br />
Jun 11 12:15:55 gserver xhci_root_intr: port 4 changed<br />
Jun 11 12:15:55 gserver xhci_ep_clear_stall:<br />
Jun 11 12:15:55 gserver xhci_cmd_enable_slot:<br />
Jun 11 12:15:55 gserver xhci_do_command: Command timeout!<br />
Jun 11 12:15:55 gserver xhci_reset_command_queue_locked:<br />
Jun 11 12:15:55 gserver xhci_reset_command_queue_locked: Command ring running<br />
Jun 11 12:15:55 gserver xhci_reset_command_queue_locked: CRCR=0x00000000057cfd80<br />
Jun 11 12:15:55 gserver xhci_do_command: Command timeout!<br />
Jun 11 12:15:55 gserver xhci_do_command: Controller reset!<br />
Jun 11 12:15:55 gserver usb_alloc_device: device init 2 failed (USB_ERR_TIMEOUT, ignored)<br />
Jun 11 12:15:55 gserver xhci_device_state_change:<br />
Jun 11 12:15:55 gserver ugen0.2: &lt;Unknown&gt; at usbus0 (disconnected)<br />
Jun 11 12:15:55 gserver uhub_reattach_port: could not allocate new device<br />
Jun 11 12:15:55 gserver uhub0: at usbus0, port 1, addr 1 (disconnected)<br />
Jun 11 12:15:55 gserver xhci_set_hw_power:<br />
Jun 11 12:15:55 gserver xhci_set_hw_power_sleep: Stopping the XHCI<br />
Jun 11 12:15:55 gserver xhci_halt_controller:<br />
Jun 11 12:15:55 gserver xhci_set_hw_power_sleep: Starting the XHCI<br />
Jun 11 12:15:55 gserver xhci_start_controller:<br />
Jun 11 12:15:56 gserver xhci_start_controller: CONFIG=0x00000000 -&gt; 0x00000020<br />
Jun 11 12:15:56 gserver xhci_start_controller: ERSTSZ=0x00000000 -&gt; 0x00000001<br />
Jun 11 12:15:56 gserver xhci_start_controller: ERDP(0)=0x00000000057cf080<br />
Jun 11 12:15:56 gserver xhci_start_controller: ERSTBA(0)=0x00000000057cf000<br />
Jun 11 12:15:56 gserver xhci_start_controller: CRCR=0x00000000057cfd80<br />
Jun 11 12:15:56 gserver xhci_set_hw_power:<br />
Jun 11 12:15:56 gserver uhub0: &lt;0x1912 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1&gt; on usbus0<br />
Jun 11 12:15:56 gserver uhub0: 4 ports with 4 removable, self powered<br />
Jun 11 12:15:56 gserver xhci_set_hw_power:<br />
Jun 11 12:15:56 gserver xhci_root_intr: port 2 changed<br />
Jun 11 12:15:56 gserver xhci_root_intr: port 4 changed<br />
Jun 11 12:15:56 gserver xhci_ep_clear_stall:<br />
Jun 11 12:15:56 gserver xhci_cmd_enable_slot:<br />
Jun 11 12:15:57 gserver xhci_do_command: Command timeout!<br />
</code><br />
Trying the following without rebooting did not work</p>
<p>[root@gserver] ~# sysctl hw.usb.xhci.xhci_port_route=-1</p>
<p>I enabled debugging to get the logs:</p>
<p>[root@gserver] ~# sysctl hw.usb.xhci.debug=1</p>
<p>Apparently we need to add this to: /boot/loader.conf and reboot then try again.</p>
<p><code># Workaround desantolo.com USB3 loop<br />
sysctl hw.usb.xhci.xhci_port_route=-1</code></p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">534</post-id>	</item>
		<item>
		<title>Install proxmox on a partition instead of a full-disk</title>
		<link>https://desantolo.com/2017/06/zfs-proxmox-on-a-partition-instead-of-a-full-disk/</link>
		
		<dc:creator><![CDATA[Giovanni]]></dc:creator>
		<pubDate>Sun, 11 Jun 2017 11:24:31 +0000</pubDate>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Proxmox]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[freenas]]></category>
		<category><![CDATA[proxmox]]></category>
		<category><![CDATA[ssd]]></category>
		<category><![CDATA[zfs]]></category>
		<guid isPermaLink="false">https://desantolo.com/?p=532</guid>

					<description><![CDATA[By default, installing Proxmox with ZFS during the installation process will force you to use the entire disk for the root zpool. For most installs this is good enough. However, I like to do things differently sometimes. I have a &#8230; <a href="https://desantolo.com/2017/06/zfs-proxmox-on-a-partition-instead-of-a-full-disk/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>By default, installing Proxmox with ZFS during the installation process will force you to use the entire disk for the root zpool. For most installs this is good enough. However, I like to do things differently sometimes.</p>
<p>I have a pair of Samsung 840 Pro 256GB SSDs that I wanted to use for my new homelab that I am currently building (moving from vmware to proxmox). You may be wondering why I want to install the operating system on a partition instead of an entire disk. Several reasons:<br />
<span id="more-532"></span><br />
1. Proxmox (ZFS-on-Linux) does not yet support SSD TRIM, FreeBSD does support it so migrating from FreeNAS into Proxmox I should be aware of it.<br />
2. Data redundancy for the root filesystem does not need to be large. Even if I do RAID1 with my two SSDs I won&#8217;t be storing my critical data or VMs in the rpool &#8211; I want a smaller sized root pool that has fault-tolerance (RAID1). A partition of 60GB mirrored in two SSDs should fit the bill here.<br />
3. ZIL Intent Log experimentation, I also want to experiment by using the same two SSDs to speed up my ZFS writes. I want a small partition in a stripe (RAID0) for performance, 45GB total (22.5gb per ssd) is plenty for this.<br />
4. The left over unused space will be left untouched so that the SSD will have more available blocks during the controller&#8217;s built-in garbage collection (not the same as TRIM)</p>
<p>I don&#8217;t have enough time to go into a lot of details (it&#8217;s past 4am), so I will get to how to do it. If you are trying to follow my same steps, you will need at least 3 hard drives.</p>
<p>1. On a hard drive or device you don&#8217;t care to use in the final outcome, install Proxmox as you would normally. Wipe the entire partition table and let it install RAID0 on the whole disk.<br />
2. Boot into your new installation, have the two new disks you want to keep attached to the system and ensure linux sees them fdisk should help with this.<br />
3. You will now need to create the partitions on the new disks (not rpool):</p>
<p>You will need to know how to calculate hard disk sectors and multiply by your block size. I don&#8217;t have time to go over it but I will do a quick TL;DR example to give you an idea:</p>
<p>We want 25GB slice so that is around 25000000000 bytes / 512 (block size) = 48828125 total sectors to allocate this storage amount.</p>
<p>Take a look at the partition table to make sure you create something similar, fdisk -l /dev/sd$ (your rpool disk). We will leave 8MB disk at the end of the partition, Proxmox by default creates 3 partitions: GRUB_BOOT, ZFS data, Solaris 8MB.</p>
<p>This command creates the partitions for my new array, I&#8217;ve described them for you by the -c command. It should be self-explanatory.</p>
<p># sgdisk -z /dev/sdb<br />
# sgdisk -a1 -n1:34:2047 -t1:EF02 -c1:&#8221;BIOS boot&#8221; -n2:2048:156252048 -t2:BF01 -c2:&#8221;mirror&#8221; -n3:156252049:205080174 -t3:BF01 -c3:&#8221;stripe&#8221; -n4:205080175:205096559 -t4:BF0 /dev/sda</p>
<p># sgdisk -a1 -n1:34:2047 -t1:EF02 -c1:&#8221;BIOS boot&#8221; -n2:2048:156252048 -t2:BF01 -c2:&#8221;mirror&#8221; -n3:156252049:205080174 -t3:BF01 -c3:&#8221;stripe&#8221; -n4:205080175:205096559 -t4:BF0 /dev/sdc<br />
# zpool create -f stripe -o ashift=13 /dev/sda3 /dev/sdc3<br />
# zpool create -f newroot -o ashift=13 mirror /dev/sda2 /dev/sdc2<br />
# grub-install /dev/disk/by-id/ata-Samsung_SSD_840_PRO_Series_S1ATNSADB46090M<br />
# grub-install /dev/disk/by-id/ata-Samsung_SSD_840_PRO_Series_S12RNEACC59063B</p>
<p>Backup &amp; moving stuff.<br />
# zfs snapshot -r rpool@fullbackup<br />
# zfs list -t snapshot<br />
# zfs send -R rpool@fullbackup | zfs recv -vFd newroot<br />
root@pve:/# zpool get bootfs<br />
NAME PROPERTY VALUE SOURCE<br />
newroot bootfs &#8211; default<br />
rpool bootfs rpool/ROOT/pve-1 local<br />
stripe bootfs &#8211; default<br />
root@pve:/# zpool set bootfs=newroot/ROOT/pve-1 newroot<br />
zpool export newroot<br />
zpool import -o altroot=/mnt newroot<br />
&#8212; rebooted with freenas live cd, enter shell, import newroot with new name rpool. rebooted<br />
&#8212; boot into proxmox recovery &#8212; once it boots, do recovery<br />
grub-install /dev/sdb<br />
grub-install /dev/sda<br />
update-grub2<br />
update-initramfs -u</p>
<p>#zpool set bootfs=newroot rpool could also work without renaming via FreeNAS but didn&#8217;t try.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">532</post-id>	</item>
		<item>
		<title>Plex mediaserver on FreeNAS allowing anyone to stream without login</title>
		<link>https://desantolo.com/2016/12/plex-mediaserver-on-freenas-allowing-anyone-to-stream-without-login/</link>
					<comments>https://desantolo.com/2016/12/plex-mediaserver-on-freenas-allowing-anyone-to-stream-without-login/#respond</comments>
		
		<dc:creator><![CDATA[Giovanni]]></dc:creator>
		<pubDate>Mon, 26 Dec 2016 14:36:52 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[freenas]]></category>
		<category><![CDATA[jail]]></category>
		<category><![CDATA[plex media server]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[streaming]]></category>
		<category><![CDATA[unknown traffic]]></category>
		<guid isPermaLink="false">https://desantolo.com/?p=449</guid>

					<description><![CDATA[I&#8217;ve been a user of Plex mediaserver for over two years, I set this up on a FreeNAS jail a long time ago and in the past few days I noticed something funny. Out of nowhere there were two additional &#8230; <a href="https://desantolo.com/2016/12/plex-mediaserver-on-freenas-allowing-anyone-to-stream-without-login/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve been a user of Plex mediaserver for over two years, I set this up on a FreeNAS jail a long time ago and in the past few days I noticed something funny.</p>
<p>Out of nowhere there were two additional streams going on in my server onto the internet, I usually share my library with friends and family but what was curious about this traffic was that Plex was claiming that these two streams were &#8220;on my local network&#8221;<br />
<span id="more-449"></span></p>
<p>After reviewing firewall logs and traffic reports (pfSense), I saw traffic from some Australia IP addresses as well as Egypt on my plex port. I discovered that when I setup Plex on FreeNAS I had followed someone&#8217;s guide and steps and there was a setting that the guide required on file /usr/pbi/plexmediaserver-amd64/plexdata/Plex Media Server/Preferences.xml</p>
<p><strong><code>disableRemoteSecurity="1" </code></strong></p>
<p>Somehow for the past 2 years this has gone undetected, mostly because I have never (until now) detected anyone that I did not trust streaming my media library. Some Google searches told part of the story, some websites and facebook pages started sharing links to my public IP address and plex port.</p>
<p>I setup a quick SSH tunnel to one of my servers to get an &#8216;external&#8217; view from outside my network and sure enough, you could see my library and stream anything, no login required!</p>
<p>After some research, even though my plex settings were set to require a login to be able to stream settings set on the Plex server settings page were being ignored. Finally when I checked the XML file manually I found out that the security was being disabled and so that is why Plex was not applying the settings.</p>
<p>If you have noticed any weird traffic or use the setting above on your FreeNAS + Plex jail &#8211; please be wary and you may want to close that loophole by removing that string from the XML Preferences file and restart Plex. You can whitelist your local network so that no login is required (I have 172.16.0.0/20 whitelisted).</p>
<p>It remains a mystery how these people found my public IP address, but I assume someone port scanned me for vulnerabilities and found the web portal wide open, so they started sharing the link.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://desantolo.com/2016/12/plex-mediaserver-on-freenas-allowing-anyone-to-stream-without-login/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">449</post-id>	</item>
	</channel>
</rss>
