<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ingo Fahrentholz</title>
    <description>A passionate web developer</description>
    <link>http://ifahrentholz.de//</link>
    <atom:link href="http://ifahrentholz.de//feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Sat, 22 Apr 2017 18:54:41 +0000</pubDate>
    <lastBuildDate>Sat, 22 Apr 2017 18:54:41 +0000</lastBuildDate>
    <generator>Jekyll v3.4.3</generator>
    
      <item>
        <title>Polymer case-study</title>
        <description>&lt;p&gt;In this article I want to document how to work with polymer &amp;amp; web components.
The goal is to create a fully working webapp.&lt;/p&gt;

&lt;h3 id=&quot;todos&quot;&gt;TODOS:&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;☑︎ Start 💪&lt;/li&gt;
  &lt;li&gt;☐ Create the needed web components&lt;/li&gt;
  &lt;li&gt;☐ Overlay with (iron-overlay-behavior)&lt;/li&gt;
  &lt;li&gt;☐ Routing &amp;amp; lazy loading&lt;/li&gt;
  &lt;li&gt;☐ Ajax handling (iron-ajax)&lt;/li&gt;
  &lt;li&gt;☐ Data-binding&lt;/li&gt;
  &lt;li&gt;☐ Usage of observables&lt;/li&gt;
  &lt;li&gt;☐ Event handling&lt;/li&gt;
  &lt;li&gt;☐ Handle image loading (iron-image &amp;amp; placeholder[base64-image-string])&lt;/li&gt;
  &lt;li&gt;☐ Implement PRPL pattern&lt;/li&gt;
  &lt;li&gt;☐ Vulcanize &amp;amp; Crisper&lt;/li&gt;
  &lt;li&gt;☐ Bundling with Webpack / Grunt&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Sat, 22 Apr 2017 00:00:00 +0000</pubDate>
        <link>http://ifahrentholz.de//2017/polymer-case-study/</link>
        <guid isPermaLink="true">http://ifahrentholz.de//2017/polymer-case-study/</guid>
        
        <category>polymer</category>
        
        <category>case-study</category>
        
        <category>case</category>
        
        <category>study</category>
        
        <category>routing</category>
        
        <category>data-binding</category>
        
        
        <category>web-development</category>
        
        <category>polymer</category>
        
        <category>case-study</category>
        
      </item>
    
      <item>
        <title>Setup Jenkins server on Raspberry</title>
        <description>&lt;p&gt;In this article I want to document how to setup a Jenkins server on raspberry pi (3).
The content is heavily borrowed by &lt;a href=&quot;http://kubecloud.io/guide-install-jenkins-on-rpi/&quot;&gt;kubecloud&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;step-1&quot;&gt;Step 1&lt;/h3&gt;

&lt;p&gt;Choose java jdk-8 as your java.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo update-alternatives --config java

There are 2 choices for the alternative java (providing /usr/bin/java).
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;step-2&quot;&gt;Step 2&lt;/h3&gt;

&lt;p&gt;Installation&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mkdir jenkins &amp;amp;&amp;amp; cd jenkins

wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -

sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ &amp;gt; /etc/apt/sources.list.d/jenkins.list'

sudo apt-get update

sudo apt-get install jenkins
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;step-3&quot;&gt;Step 3&lt;/h3&gt;

&lt;p&gt;Start Jenkins&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo nano /etc/init.d/jenkins
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Define your ports&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;HTTP_PORT=8000  
JENKINS_ARGS=&quot;--httpPort=$HTTP_PORT&quot;  
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;To make sure the new port is used restart Jenkins&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo /etc/init.d/jenkins restart  
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

</description>
        <pubDate>Fri, 06 Jan 2017 00:00:00 +0000</pubDate>
        <link>http://ifahrentholz.de//2017/setup-jenkins-on-raspberry/</link>
        <guid isPermaLink="true">http://ifahrentholz.de//2017/setup-jenkins-on-raspberry/</guid>
        
        <category>raspberry</category>
        
        <category>jenkins</category>
        
        <category>setup</category>
        
        
        <category>raspberry</category>
        
        <category>jenkins</category>
        
      </item>
    
      <item>
        <title>Setup Minecraft server on Raspberry</title>
        <description>&lt;p&gt;In this article I want to document how to setup a Minecraft server on raspberry pi (3).
The content is heavily borrowed by &lt;a href=&quot;https://jankarres.de&quot;&gt;jankarres&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;step-1&quot;&gt;Step 1&lt;/h3&gt;

&lt;p&gt;First of all you should configure your raspberry pi&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo raspi-config
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;ol&gt;
  &lt;li&gt;Expand Filesystem&lt;/li&gt;
  &lt;li&gt;Change user password&lt;/li&gt;
  &lt;li&gt;Change hostname&lt;/li&gt;
  &lt;li&gt;Set boot to CLI&lt;/li&gt;
  &lt;li&gt;Set GPU Memory to 16&lt;/li&gt;
  &lt;li&gt;Update your localisation settings&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;step-2-optional&quot;&gt;Step 2 (optional)&lt;/h3&gt;

&lt;p&gt;Expand your swap file-size.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo su -c 'echo &quot;CONF_SWAPSIZE=2048&quot; &amp;gt; /etc/dphys-swapfile'
sudo dphys-swapfile setup
sudo dphys-swapfile swapon
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;step-3&quot;&gt;Step 3&lt;/h3&gt;

&lt;p&gt;Install dependencies.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install git screen
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;step-4&quot;&gt;Step 4&lt;/h3&gt;

&lt;p&gt;Download &amp;amp; patch the Spigot server.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
java -Xmx1G -jar BuildTools.jar
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;step-5&quot;&gt;Step 5&lt;/h3&gt;

&lt;p&gt;Create a run script to start the Minecraft server.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Keep in mind that you have to update the spigot version number inside the run script @ &lt;strong&gt;spigot-1.8.jar&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/sh&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;BINDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;dirname &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;readlink -fn &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$0&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$BINDIR&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
java -Xmx1024M -XX:ParallelGCThreads&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;8 -Xincgc -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:+AggressiveOpts -XX:+CMSParallelRemarkEnabled -XX:+DisableExplicitGC -XX:MaxGCPauseMillis&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;500 -XX:SurvivorRatio&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;16 -XX:TargetSurvivorRatio&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;90 -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -Xnoclassgc -XX:UseSSE&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;3 -XX:LargePageSizeInBytes&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;4m -jar spigot-1.8.jar nogui
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;step-6&quot;&gt;Step 6&lt;/h3&gt;

&lt;p&gt;Add permission.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo chmod +x run.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;step-7&quot;&gt;Step 7&lt;/h3&gt;

&lt;p&gt;Start your server for the first time.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo ./run.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;step-8&quot;&gt;Step 8&lt;/h3&gt;

&lt;p&gt;Accept the EULA by setting &lt;code class=&quot;highlighter-rouge&quot;&gt;eula=true&lt;/code&gt; in the &lt;code class=&quot;highlighter-rouge&quot;&gt;eula.txt&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;vi eula.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;step-9&quot;&gt;Step 9&lt;/h3&gt;

&lt;p&gt;Update the default config of the spigot server to improve the performance.&lt;/p&gt;

&lt;p&gt;Config download: &lt;a href=&quot;../../files/spigot_config_2015_02.tar.gz&quot;&gt;spigot_config_2015.02.tar.gz&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;step-10-optional&quot;&gt;Step 10 (optional)&lt;/h3&gt;

&lt;p&gt;Start your Minecraft server in a screen session so it keeps running in the ‘background’.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Navigate to your server’s directory.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Run the command: &lt;code class=&quot;highlighter-rouge&quot;&gt;screen -S ScreenNameGoesHere&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Then you’ll be in your screen session, so run the server startup script.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To leave the screen session (and leave it running) press and hold CTRL, A, D (in that order).&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To resume the screen session run the command: screen -r ScreenNameGoesHere&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To kill the screen session run the command: screen -S ScreenNameGoesHere -X kill&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;availability&quot;&gt;Availability&lt;/h3&gt;
&lt;blockquote&gt;
  &lt;p&gt;If you want to make your server public available you need to use a dynip service like: &lt;a href=&quot;https://www.noip.com/&quot;&gt;noip.com&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Fri, 06 Jan 2017 00:00:00 +0000</pubDate>
        <link>http://ifahrentholz.de//2017/setup-minecraft-server-on-raspberry/</link>
        <guid isPermaLink="true">http://ifahrentholz.de//2017/setup-minecraft-server-on-raspberry/</guid>
        
        <category>raspberry</category>
        
        <category>minecraft</category>
        
        
        <category>raspberry</category>
        
        <category>minecraft</category>
        
      </item>
    
      <item>
        <title>Install Nextcloud on Raspberry</title>
        <description>&lt;p&gt;&lt;strong&gt;UPDATE 2016-08-13: Use MariaDB and PHP7&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the following steps I’ll document how the nextcloud setup works.&lt;/p&gt;

&lt;p&gt;Configure your Pi&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo raspi-config
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;Expand Filesystem&lt;/li&gt;
  &lt;li&gt;Change user password&lt;/li&gt;
  &lt;li&gt;Change hostname&lt;/li&gt;
  &lt;li&gt;Set boot to CLI&lt;/li&gt;
  &lt;li&gt;Set GPU Memory to 16&lt;/li&gt;
  &lt;li&gt;Update your localisation settings&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Update your system&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade &amp;amp;&amp;amp; sudo apt-get dist-upgrade
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Add the www-data user to the www-data group:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo usermod -a -G www-data www-data
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;install-the-required-packages&quot;&gt;Install the required packages&lt;/h3&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install nginx openssl ssl-cert curl libapr1 libtool curl libcurl4-openssl-dev memcached varnish
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;install-php7&quot;&gt;Install PHP7&lt;/h3&gt;

&lt;p&gt;Edit sources:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo nano /etc/apt/sources.list
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Add&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Edit&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo nano /etc/apt/preferences
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Add&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Package: *
Pin: release n=jessie
Pin-Priority: 600
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Fetch and install&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;wget https://www.dotdeb.org/dotdeb.gpg
sudo apt-key add dotdeb.gpg
sudo apt-get update
sudo apt-get install php7.0-fpm php7.0-mysql php7.0-common php7.0-gd php7.0-json php7.0-cli php7.0-curl php7.0-xml php7.0-zip php7.0-mbstring
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;install-mariadb&quot;&gt;Install MariaDB&lt;/h3&gt;

&lt;p&gt;MariaDB is a drop-in replacement for MySQL.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install -y mariadb-server mariadb-client
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Check MariaDB version&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mysql --version
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now run the security script (But don’t delete the root user yet!)&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now we need to setup our database&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mysql -u root -p
CREATE DATABASE nextcloud;
CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'SecurePassword';
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost';
FLUSH PRIVILEGES;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;create-the-ssl-certificat&quot;&gt;Create the SSL certificat&lt;/h3&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo openssl req $@ -new -x509 -days 730 -nodes -out /etc/nginx/cert.pem -keyout /etc/nginx/cert.key
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Protect the certificat&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo chmod 600 /etc/nginx/cert.pem
sudo chmod 600 /etc/nginx/cert.key
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;update-the-nginx-configuration&quot;&gt;Update the nginx configuration&lt;/h3&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default_old
sudo nano /etc/nginx/sites-available/default
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Paste the following configuration. Make sure you substitue &lt;strong&gt;IPAdress&lt;/strong&gt; with your Raspberry Pi IPAdress&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;upstream php-handler {
    server 127.0.0.1:9000;
}

server {
    listen 80;
    server_name IPaddress;
    return 301 https://$server_name$request_uri; # enforce https
}

server {
    listen 443 ssl;
    server_name IPaddress;
    ssl_certificate /etc/nginx/cert.pem;
    ssl_certificate_key /etc/nginx/cert.key;
    # Path to the root of your installation
    root /var/www/nextcloud;
    client_max_body_size 1000M; # set max upload size
    fastcgi_buffers 64 4K;
    rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
    rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
    rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
    index index.php;
    error_page 403 /core/templates/403.php;
    error_page 404 /core/templates/404.php;
    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }
    location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README) {
        deny all;
    }
    location / {
        # The following 2 rules are only needed with webfinger
        rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
        rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
        rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
        rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
        rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
        try_files $uri $uri/ index.php;
    }
    location ~ \.php(?:$|/) {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTPS on;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }
    # Optional: set long EXPIRES header on static assets
    location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
         expires 30d;
         # Optional: Don't log access to assets
         access_log off;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;adjust-the-phpini&quot;&gt;Adjust the php.ini&lt;/h3&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo nano /etc/php/7.0/fpm/php.ini
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Use &lt;strong&gt;Ctrl+W&lt;/strong&gt; to search for the lines below
&lt;em&gt;TO disable max_sizes use 0&lt;/em&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;upload_max_filesize = 2000M
post_max_size = 2000M
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Find the the following line:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;;cgi.fix_pathinfo=1
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;remove the preceeding semicolon and set it’s value to 0&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cgi.fix_pathinfo=0
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;adjust-the-wwwconf&quot;&gt;Adjust the www.conf&lt;/h3&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo nano /etc/php/7.0/fpm/pool.d/www.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Change listen = /var/run/php7-fpm.sock
to
listen = 127.0.0.1:9000&lt;/p&gt;

&lt;h3 id=&quot;adjust-the-swapsize&quot;&gt;Adjust the Swapsize&lt;/h3&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo nano /etc/dphys-swapfile
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;CONF_SWAPSIZE=100
to
CONF_SWAPSIZE=512&lt;/p&gt;

&lt;p&gt;Restart your pi&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo reboot
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;install-nextcloud&quot;&gt;Install Nextcloud&lt;/h3&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mkdir -p /var/www/nextcloud
sudo wget https://download.nextcloud.com/server/releases/nextcloud-9.0.53.tar.bz2
sudo tar xvf nextcloud-9.0.53.tar.bz2
sudo mv nextcloud/ /var/www/
sudo chown -R www-data:www-data /var/www
rm -rf nextcloud nextcloud-9.0.53.tar.bz2
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;mount-your-drive&quot;&gt;Mount your drive&lt;/h3&gt;

&lt;p&gt;Install the following packages&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install ntfs-3g exfat-utils
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Create a directory we can mount to&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mkdir /media/nextclouddrive
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Get your gid, uid and UUID&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;gid&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;id -g www-data
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;uid&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;id -u www-data
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;UUID&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ls -l /dev/disk/by-uuid
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Adjust fstab&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo nano /etc/fstab
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;At the bottom paste the following&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;UUID=F6941E59941E1D25 /media/nextclouddrive auto nofail,uid=33,gid=33,umask=0027,dmask=0027,noatime 0 0
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Test if everything is ok&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mount -a
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If you don’t get any errors reboot&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo reboot
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now you can open your webbrowser and setup Nextcloud.
Please make sure you configure your Data folder below &lt;strong&gt;Storage &amp;amp; database&lt;/strong&gt;&lt;/p&gt;

&lt;h3 id=&quot;appendix&quot;&gt;Appendix&lt;/h3&gt;

&lt;p&gt;If you’ve trouble with large folders and run into a timeout you need to make the following adjustments.&lt;/p&gt;

&lt;p&gt;For Nginx + FastCGI (php-fpm), you should try to tweak nginx configuration in this way:&lt;/p&gt;

&lt;p&gt;Open:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo nano /etc/php/7.0/fpm/php.ini
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Set:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;max_execution_time = 300
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Open :&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo nano /etc/php/7.0/fpm/pool.d/www.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Set:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;request_terminate_timeout = 300
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now set the fastcgi_read_timeout&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo nano /etc/nginx/sites-available/default
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Set:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;fastcgi_read_timeout 300;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Restart Nginx:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo service nginx reload
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
        <pubDate>Sat, 13 Aug 2016 00:00:00 +0000</pubDate>
        <link>http://ifahrentholz.de//2016/install-nextcloud-on-raspberry/</link>
        <guid isPermaLink="true">http://ifahrentholz.de//2016/install-nextcloud-on-raspberry/</guid>
        
        <category>raspberry</category>
        
        <category>nextcloud</category>
        
        
        <category>raspberry</category>
        
        <category>nextcloud</category>
        
      </item>
    
      <item>
        <title>Mount USB HDD on Raspberry</title>
        <description>&lt;p&gt;In this article I want to document how to mount a external HDD device on a Raspberry Pi.&lt;/p&gt;

&lt;h3 id=&quot;configure-your-pi&quot;&gt;Configure your Pi&lt;/h3&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo raspi-config
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;Expand Filesystem&lt;/li&gt;
  &lt;li&gt;Change user password&lt;/li&gt;
  &lt;li&gt;Change hostname&lt;/li&gt;
  &lt;li&gt;Set boot to CLI&lt;/li&gt;
  &lt;li&gt;Set GPU Memory to 16&lt;/li&gt;
  &lt;li&gt;Update your localisation settings&lt;/li&gt;
&lt;/ol&gt;

&lt;h4 id=&quot;update-your-system&quot;&gt;Update your system&lt;/h4&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade &amp;amp;&amp;amp; sudo apt-get dist-upgrade
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;mount-your-external-hdd&quot;&gt;Mount your external HDD&lt;/h3&gt;

&lt;p&gt;Now we can mount our storage. Please not that I’m using in this tutorial &lt;strong&gt;usbstorage&lt;/strong&gt;,
&lt;strong&gt;sda1&lt;/strong&gt; and as user &lt;strong&gt;pi&lt;/strong&gt;. These are variables which you have to adjust depending on your system configuration and needs.&lt;/p&gt;

&lt;h4 id=&quot;prepare-the-mount-point&quot;&gt;Prepare the Mount Point&lt;/h4&gt;

&lt;p&gt;First make a directory where your storage should be mounted.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mkdir /mnt/usbstorage
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Set the user permissions&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo chown -R pi:pi /mnt/usbstorage
sudo chmod -R 775 /mnt/usbstorage
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Set all future permissions for the mount point.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo setfacl -Rdm g:pi:rwx /mnt/usbstorage
sudo setfacl -Rm g:pi:rwx /mnt/usbstorage
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h4 id=&quot;determine-the-usb-hard-drive-format&quot;&gt;Determine the USB Hard Drive Format&lt;/h4&gt;

&lt;p&gt;You need to knwo the file system the drive is formatted with&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo blkid

/dev/mmcblk0p1: SEC_TYPE=&quot;msdos&quot; LABEL=&quot;boot&quot; UUID=&quot;787C-2FD4&quot; TYPE=&quot;vfat&quot;
/dev/mmcblk0p2: UUID=&quot;3d81d9e2-7d1b-4015-8c2c-29ec0875f762&quot; TYPE=&quot;ext4&quot;
/dev/sda1: LABEL=&quot;TrekStor&quot; UUID=&quot;3d9d92e2-7d1b-4015-8c2c&quot; TYPE=&quot;exfat&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Note the &lt;strong&gt;TYPE=”exfat”&lt;/strong&gt; at the end, you will need this for the fstab file.&lt;/p&gt;

&lt;p&gt;Now mount the usb stick. If it is NTFS you will need to install some utilities first.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install ntfs-3g -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If the drive is exfat install these utilities&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install exfat-utils -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;For all drive types mount the usb with this command, -o insures pi is the owner which should avoid permission issues&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mount -o uid=pi,gid=pi /dev/sda1 /mnt/usbstorage
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If you get an error use this syntax&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mount -t uid=pi,gid=pi /dev/sda1 /mnt/usbstorage
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If the mount -t command returns an error then use this syntax&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mount uid=pi,gid=pi /dev/sda1 /mnt/usbstorage
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;automount-the-usb-hard-drive&quot;&gt;Automount the USB Hard Drive&lt;/h3&gt;

&lt;p&gt;/mnt/usbstorage will be the folder in which you store your media. We want it to be automounted on boot The best way to do this is through the UUID. Get the UUID by using this commmand&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo ls -l /dev/disk/by-uuid/
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;You will see some output like this. The UUID you want is formatted like this XXXX-XXXX for the sda1 drive. If the drive is NTFS it can have a longer format like UUID=”BABA3C2CBA3BE413”. Note this UUID, for me it is BA8F-FFE8&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;total 0
lrwxrwxrwx 1 root root 15 Jan  1  1970 3d81d9e2-7d1b-4015-8c2c-29ec0875f762 -&amp;gt; ../../mmcblk0p2
lrwxrwxrwx 1 root root 15 Jan  1  1970 787C-2FD4 -&amp;gt; ../../mmcblk0p1
lrwxrwxrwx 1 root root 10 Oct 26 21:10 BA8F-FFE8 -&amp;gt; ../../sda1
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now we will edit fstab to mount the USB by UUID on boot&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo nano /etc/fstab
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Add the line in red to the bottom, replace XXXX-XXXX with your UUID and exfat with your type if it is different (e.g. ntfs, vfat, ext4). You may or may not need the quotation marks wrapped around the UID, you do not need quotation marks wrapped around the file system type (ext4, vfat, NTFS etc).&lt;/p&gt;

&lt;p&gt;The umask 0002 sets 775 permissions so the pi user and group can read, write and execute files on the external USB drive. To completely eliminate permission issues you can set the umask to 0000 which equals 777 permissions so anybody can read, write and execute. Note that 777 permissions are considered a security risk.&lt;/p&gt;

&lt;p&gt;If you have issues here then try replacing uid=pi,gid=pi with just the word defaults (typical for ext4). You can also try replacing the UUID with the /dev/sda1 line.&lt;/p&gt;

&lt;p&gt;This is an example for exfat&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 errors=remount-ro,noatime 0 1

UUID=XXXX-XXXX  /mnt/usbstorage exfat   nofail,uid=pi,gid=pi   0   0
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;For NTFS, note that it is ntfs and not ntfs-3g&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 errors=remount-ro,noatime 0 1

UUID=XXXX-XXXX    /mnt/usbstorage    ntfs   nofail,uid=pi,gid=pi    0   0
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;for ext4 using uid and gid is not recommended so use at your own risk as it could cause
issues.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 errors=remount-ro,noatime 0 1

UUID=XXXX-XXXX    /mnt/usbstorage    ext4   nofail,uid=pi,gid=pi    0   0
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If you get any errors you can replace uid=pi,gid=pi with defaults or remove it entirely&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 errors=remount-ro,noatime 0 1

UUID=XXXX-XXXX    /mnt/usbstorage    ext4   nofail,defaults    0   0
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;For using /dev/sda1 and defaults if you have troubles with UUID&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 errors=remount-ro,noatime 0 1

/dev/sda1    /mnt/usbstorage    ext4   nofail    0   0
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now test if the fstab file works&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mount -a
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If you didn’t get errors reboot, otherwise try the suggestions above to get it working then mount -a again until it succeeds&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo reboot
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;You should be able to access the mounted USB drive and list its contents&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cd /mnt/usbstorage
ls
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Every time you reboot, the drives will be mounted as long as the UUID remains the same. If you delete the partitions or format the USB hard drive or stick the UUID changes so bear this in mind. You can always repeat the process for additional hard drives in the future.&lt;/p&gt;

&lt;p&gt;If you have multiple hard drives you will have to make separate mount points (e.g. /mnt/usbstorage2) for each drive’s partition&lt;/p&gt;

&lt;h3 id=&quot;fix-raspberry-pi-2-mounting-issues&quot;&gt;Fix Raspberry Pi 2 Mounting Issues&lt;/h3&gt;

&lt;p&gt;Apparently there is a bug in the Pi 2 that messes up automounting. You can fix it by creating a delay.&lt;/p&gt;

&lt;p&gt;Open up the /boot/cmdline.txt files&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo nano /boot/cmdline.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Add this line to the bottom, you can increase this delay if necessary&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rootdelay=5
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Hit Ctrl+X, Y and Enter to save and exit, then reboot to see if it automounts now.
If the Raspberry Pi hard drive still does not automount we can use rc.local&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo nano /etc/rc.local
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Add this lines before the exit line&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sleep 30
sudo mount -a
exit
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Ctrl+X, Y and Enter to save&lt;/p&gt;

&lt;p&gt;Reboot again to test&lt;/p&gt;

&lt;h3 id=&quot;appendix&quot;&gt;Appendix&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Unmount the disk
    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo umount /mnt/usbstorage
&lt;/code&gt;&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

</description>
        <pubDate>Tue, 09 Aug 2016 10:00:00 +0000</pubDate>
        <link>http://ifahrentholz.de//2016/mount-hard-drive-raspberry/</link>
        <guid isPermaLink="true">http://ifahrentholz.de//2016/mount-hard-drive-raspberry/</guid>
        
        <category>raspberry</category>
        
        <category>mount</category>
        
        
        <category>raspberry</category>
        
        <category>mount</category>
        
      </item>
    
      <item>
        <title>Use the Raspberry Pi as NAS server</title>
        <description>&lt;p&gt;First of all - due to the crapy data throughput of the Raspberry Pi you should not expect high
performance data transfer. A 1GB file will take ~20 minutes to be transfered.&lt;/p&gt;

&lt;p&gt;That said lets dive directly into the setup.&lt;/p&gt;

&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites:&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;sudo rights on your working station&lt;/li&gt;
  &lt;li&gt;external hard disks (one or more)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://sourceforge.net/projects/openmediavault/files/&quot;&gt;OpenMediaVault image for your Pi&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;install-omv-os&quot;&gt;Install OMV OS&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Insert the SD card onto your computer&lt;/li&gt;
  &lt;li&gt;Get the device name of the SD card - should be something like: &lt;strong&gt;/dev/disk2&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;➜  ~ diskutil list
/dev/disk2 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;internal, physical&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;:
   &lt;span class=&quot;c&quot;&gt;#:                       TYPE NAME                    SIZE       IDENTIFIER&lt;/span&gt;
   0:     FDisk_partition_scheme                        &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;31.9 GB    disk2
   1:             Windows_FAT_32 boot                    58.7 MB    disk2s1
   2:                      Linux                         3.5 GB     disk2s2
   3:                      Linux                         67.1 MB    disk2s3
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Open the terminal and open the folder where you downloaded your OMV Os to.&lt;/li&gt;
  &lt;li&gt;Unzip the file:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;gunzip omv_3.0.24_beta_rpi2_rpi3.img.gz
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Now you need to unmount your SD card an install the img (be sure you substitue &lt;em&gt;/dev/disk2&lt;/em&gt; with your device name of the SD card):&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo diskutil unmountDisk /dev/disk2
sudo dd &lt;span class=&quot;nv&quot;&gt;bs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1m &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;omv_3.0.24_beta_rpi2_rpi3.img &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/disk2
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Put the SD card into your Raspberry Pi and start it - but make sure the external hard disks and the ethernet cable are connected&lt;/li&gt;
  &lt;li&gt;Now you’ll be prompted with the login:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;raspberrypi login: root
Password: openmediavault
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Get the IP address of your Raspberry Pi (ifconfig):&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;root@raspberrypi:~# &lt;/span&gt;ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:f0:ea:18
          inet addr:&lt;span class=&quot;k&quot;&gt;***&lt;/span&gt;.&lt;span class=&quot;k&quot;&gt;***&lt;/span&gt;.&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.&lt;span class=&quot;k&quot;&gt;**&lt;/span&gt;  Bcast:&lt;span class=&quot;k&quot;&gt;***&lt;/span&gt;.&lt;span class=&quot;k&quot;&gt;***&lt;/span&gt;.&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.&lt;span class=&quot;k&quot;&gt;***&lt;/span&gt;  Mask:&lt;span class=&quot;k&quot;&gt;***&lt;/span&gt;.&lt;span class=&quot;k&quot;&gt;***&lt;/span&gt;.&lt;span class=&quot;k&quot;&gt;***&lt;/span&gt;.&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;On your workstation you can open a webbrowser and as url type: http://[your-ip]&lt;/li&gt;
  &lt;li&gt;The default weblogin is:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Username: admin
Password: openmediavault
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;The first thing you should do is to change the default password to something secure:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo passwd
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
        <pubDate>Fri, 08 Jan 2016 15:04:23 +0000</pubDate>
        <link>http://ifahrentholz.de//2016/openmediavault/</link>
        <guid isPermaLink="true">http://ifahrentholz.de//2016/openmediavault/</guid>
        
        <category>raspberry</category>
        
        <category>nas</category>
        
        <category>openmediavault</category>
        
        <category>omv</category>
        
        
        <category>raspberry</category>
        
      </item>
    
  </channel>
</rss>
