Seitenleiste

tweaks:nas

WD My Cloud EX2 Ultra 4 TB

Clean OS (Debian) + PiHole + OMV/Samba4 + Syncthing

Sources:

  1. Primary file archive: http://anionix.ddns.net/WDMyCloud/
  2. For donations - please, go to his site ftp.anionix.ru
  3. OMV/Samba
  4. Syncthing




FIRST!

  • Write down the MACadress from the original WD OS for later use

Clean OS (Debian)

Install: (Source 1, 2, 3)

  1. Go to „WD My Cloud EX2 Ultra“ web panel and install .bin file as regular firmware
  2. After reboot - device get new IP address, find it and connect via Telnet
  3. Run these commands for prepare HDD's:
    • Disk 1: /dev/sda, Disk 2: /dev/sdb
    • Run it for both disks
    • dd if=/dev/zero of=/dev/sda bs=1M count=10000
      dd if=/dev/zero of=/dev/sdb bs=1M count=10000
      parted --script /dev/sda "mklabel gpt mklabel gpt mkpart primary 0% 512MB mkpart primary 512MB 4096MB mkpart primary 4096MB 100% set 1 raid on set 2 raid on set 3 raid on"
      parted --script /dev/sdb "mklabel gpt mklabel gpt mkpart primary 0% 512MB mkpart primary 512MB 4096MB mkpart primary 4096MB 100% set 1 raid on set 2 raid on set 3 raid on"
      
      
      mdadm --create /dev/md0 --level=1 --raid-devices=2 --run /dev/sda1 /dev/sdb1
      mdadm --create /dev/md1 --level=1 --raid-devices=2 --run /dev/sda2 /dev/sdb2
      mdadm --create /dev/md2 --level=1 --raid-devices=2 --run /dev/sda3 /dev/sdb3
  4. Format new partitions:
    • mkswap /dev/md0
      swapon /dev/md0
      mkfs.ext4 /dev/md1
      mkfs.ext4 /dev/md2
  5. Mount partitions and upload rootfs (Already included kernel):
    • mkdir /mnt/root
      mount /dev/md1 /mnt/root
  6. Upload rootfs archive to this partition and unpack:
    • cd /mnt/root
      wget http://fox-exe.ru/WDMyCloud/WDMyCloud-Ex2-Ultra/Debian-linux_4.14.4/debian-stretch-rootfs.tar.xz
      tar xvf debian-stretch-rootfs.tar.xz
      rm debian-stretch-rootfs.tar.xz
  7. Install new Kernel for correct LED-Colors:
    • cd /mnt/root
      wget http://fox-exe.ru/WDMyCloud/WDMyCloud-Ex2-Ultra/Dev/Linux-4.15.0-rc6/libs-4.15.0-rc6.tar.gz
      wget http://fox-exe.ru/WDMyCloud/WDMyCloud-Ex2-Ultra/Dev/Linux-4.15.0-rc6/uImage
      wget http://fox-exe.ru/WDMyCloud/WDMyCloud-Ex2-Ultra/Dev/Linux-4.15.0-rc6/uRamdisk
      tar xvf libs-4.15.0-rc6.tar.gz
      dd if=/dev/zero of=/dev/mtdblock1
      dd if=uImage of=/dev/mtdblock1
      dd if=/dev/zero of=/dev/mtdblock2
      dd if=uRamdisk of=/dev/mtdblock2
      rm uImage uRamdisk libs-4.15.0-rc6.tar.gz /mnt/root/lib/modules/4.14.4 -r
  8. Reboot device
    • cd /
      umount /mnt/root
      sync
      reboot -f
  9. After reboot you can connect via SSH:
    • Hostname: wdmc
    • User: root
    • Passwd: mycloud ( DO NOT FORGET TO CHANGE THE PASS AND USE SSHKEYS LATER! )
  • MAC address will changed to real after next boot
  • For change it: /etc/network/interfaces (hwaddr value)

Files only for Backup (unzip before use):

Debian Settings

  1. You need to update the apt sources.list for stretch, not stable.
    • #deb  http://deb.debian.org/debian stable main contrib non-free
      #deb-src  http://deb.debian.org/debian stable main contrib non-free
      deb http://ftp.uni-mainz.de/debian/ stretch main non-free contrib
      deb-src http://ftp.uni-mainz.de/debian/ stretch main non-free contrib
      
      #deb  http://deb.debian.org/debian stable-updates main contrib non-free
      #deb-src  http://deb.debian.org/debian stable-updates main contrib non-free
      deb http://ftp.uni-mainz.de/debian/ stretch-updates main contrib non-free
      deb-src http://ftp.uni-mainz.de/debian/ stretch-updates main contrib non-free
      
      deb http://security.debian.org/ stretch/updates main contrib non-free
      deb-src http://security.debian.org/ stretch/updates main contrib non-free
      
      deb http://ftp.uni-mainz.de/debian/ stretch-backports main contrib non-free
      deb-src http://ftp.uni-mainz.de/debian/ stretch-backports main contrib 
  2. Update Debian (take a shower or get 2 cups of coffee)
    • apt clean
      apt update && apt upgrade
      apt install -y apt-transport-https ca-certificates curl ntp rsync vim
      apt -y purge exim4* && apt -y autoremove
  3. Info about the SystemFan, Temp and more with
    • mcu_ctl
  4. Wait min. 6 hours for the RaidSystem gets ready
    • cat /proc/mdstat
  5. WE ARE READY TO REBOOT!

OMV/Samba

DO NOT INSTALL PIHOLE FIRST! FIRST OMV!

  1. get the source of OMV
    • wget -O - http://packages.openmediavault.org/public/archive.key | apt-key add -
  2. Add the package repositories
    • cat <<EOF >> /etc/apt/sources.list.d/openmediavault.list
      deb https://packages.openmediavault.org/public arrakis main
      # deb https://downloads.sourceforge.net/project/openmediavault/packages arrakis main
      ## Uncomment the following line to add software from the proposed repository.
      # deb https://packages.openmediavault.org/public arrakis-proposed main
      # deb https://downloads.sourceforge.net/project/openmediavault/packages arrakis-proposed main
      ## This software is not part of OpenMediaVault, but is offered by third-party
      ## developers as a service to OpenMediaVault users.
      # deb https://packages.openmediavault.org/public arrakis partner
      # deb https://downloads.sourceforge.net/project/openmediavault/packages arrakis partner
      EOF
  3. Install the openmediavault 4 (Arrakis) package (Source: https://openmediavault.readthedocs.io/en/latest/installation/on_debian.html )
    • export LANG=C
      export DEBIAN_FRONTEND=noninteractive
      export APT_LISTCHANGES_FRONTEND=none
      apt update
      apt --allow-unauthenticated install openmediavault-keyring
      apt update
    • apt --yes --auto-remove --show-upgraded --allow-downgrades --allow-change-held-packages --no-install-recommends --option Dpkg::Options::="--force-confdef" --option DPkg::Options::="--force-confold" install postfix openmediavault
    • omv-initsystem
  4. Default OMV login/pass is: admin / openmediavault
    1. Warning: create network interface in webgui or you loose network connection after restart!
    2. go to Storage → File systems → Unmount /dev/md2 and mount it again, then create “Shared folders” and setup other things (Samba, ftp, ssh etc…)
  5. Configure all other things
  6. OMV-Extras:
    • from Commandline as root
    • wget -O - http://omv-extras.org/install | bash
      apt update && apt upgrade
  • Samba Share Password Refused / Problems with some Windows 10 SMB folder share / Windows 10 Netzwerk Passwort falsch Fehler 86
    •  System error 86 has occurred.
      
      The specified network password is not correct.
    • OMV Webadmin → Services → SMB → Advanced settings → Extra Options and add
      • ntlm auth = true
        lanman auth = no
        client ntlmv2 auth = yes

Pi-hole®

Install: (Source 6)

  1. curl -sSL https://install.pi-hole.net | bash
  2. more OK or Accept for pihole
  3. use ipv4 and 6
  4. Webadmin interface: ON, for later use of Blacklists and more
  5. Use Webserver lighttpd YES
  6. Wait for installation (next 2 cups of coffee?)
  7. Your Admin Webpage login password is „READ IT ON YOUR SCREEN!“
  8. Change the Pihole Webadmin Interface Port from 80 to 8080
    •  vim /etc/lighttpd/lighttpd.conf
  9. edit
    • vim /var/www/html/pihole/index.php
    • change
      $serverName = htmlspecialchars($_SERVER["HTTP_HOST"]);

      with

      $serverName = htmlspecialchars($_SERVER["SERVER_ADDR"]);
  10. restart lighttpd
    • /etc/init.d/lighttpd restart
    • for passwordchange use
      pihole -a -p
  11. Add your personal Blocklists or use only the PiholeDefault-Lists
    1. Navigate to PiholeWebadmin → Settings → Blocklist
    2. add these lines
    • https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV.txt	
      https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/android-tracking.txt	
      https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt	
      https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-blocklist.txt	
      https://v.firebog.net/hosts/Prigent-Ads.txt	
      https://v.firebog.net/hosts/Easyprivacy.txt	
      https://www.squidblacklist.org/downloads/dg-ads.acl	
      https://raw.githubusercontent.com/StevenBlack/hosts/master/data/UncheckyAds/hosts	
      https://v.firebog.net/hosts/Easylist.txt	
      https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt	
      https://v.firebog.net/hosts/AdguardDNS.txt	
      https://adaway.org/hosts.txt
    1. Navigate to Whitelist and add
    • aax-eu.amazon-adsystem.com
      activity.windows.com
      adf.ly
      ads.google.com
      adwords.google.com
      analytics.google.com
      analytics.twitter.com
      android.clients.google.com
      api.facebook.com
      api.ipify.org
      api.mixpanel.com
      api.vungle.com
      app-measurement.com
      axelspringer.sc.omtrdc.net
      b.stats.paypal.com
      beacons2.gvt2.com
      beacons3.gvt2.com
      beacons4.gvt2.com
      bit.ly
      c.amazon-adsystem.com
      cdn-gl.imrworldwide.com
      cdn.augur.io
      cdn.mxpnl.com
      cdn.optimizely.com
      client-event-reporter.twitch.tv
      clients1.google.com
      clients2.google.com
      clients3.google.com
      clients4.google.com
      clients5.google.com
      connect.facebook.net
      countess.twitch.tv
      crashlytics.com
      crossout.net
      csi.gstatic.com
      decide.mixpanel.com
      dev.appboy.com
      device-metrics-us-2.amazon.com
      dl.dropbox.com
      dpm.demdex.net
      e.crashlytics.com
      ea.com
      events.evie.com
      fls-eu.amazon.com
      fls-eu.amazon.de
      fonts.googleapis.com
      goo.gl
      googleads.g.doubleclick.net
      graph.facebook.com
      graph.instagram.com
      gravatar.com
      hosts-file.net
      id.google.com
      imasdk.googleapis.com
      imgs.xkcd.com
      keystone.mwbsys.com
      m.exactag.com
      msftncsi.com
      netflix.com
      ow.ly
      partners.webmasterplan.com
      pixel.bild.de
      pixel.facebook.com
      prophet.heise.de
      pstmrk.it
      pubsub-edge.twitch.tv
      quantcast.mgr.consensu.org
      raw.githubusercontent.com
      rcm-eu.amazon-adsystem.com
      rem-track.bild.de
      reports.crashlytics.com
      res.cloudinary.com
      rover.ebay.com
      rum-collector.wpm.neustar.biz
      s.amazon-adsystem.com
      s.shopify.com
      s.youtube.com
      s3.amazonaws.com
      sb.scorecardresearch.com
      secure-ds.serving-sys.com
      settings-win.data.microsoft.com
      settings.crashlytics.com
      spade.twitch.tv
      ssl.google-analytics.com
      stats.g.doubleclick.net
      sync.search.spotxchange.com
      syndication.twitter.com
      sysctl.org
      t.co
      t23.intelliad.de
      tags.tiqcdn.com
      teredo.ipv6.microsoft.com
      tinyurl.com
      tomshardware.com
      track.adform.net
      tracking.epicgames.com
      twitch.tv
      twitter.com
      txxx.com
      uidbox.uimserv.net
      v10.events.data.microsoft.com
      v10.vortex-win.data.microsoft.com
      v20.events.data.microsoft.com
      vendorlist.consensu.org
      watson.telemetry.microsoft.com
      www.bit.ly
      www.ecdinterface.philips.com
      www.google-analytics.com
      www.googleadservices.com
      www.googletagmanager.com
      www.gstatic.com
      www.msftncsi.com
      www.smartredirect.de
      zattoo.com
      zeustracker.abuse.ch
    • Number of domains being pulled in by gravity: 231132
    • Removing duplicate domains
    • Number of unique domains trapped in the Event Horizon: 184651
    • Number of whitelisted domains: 128
    • Number of blacklisted domains: 3
    • Number of regex filters: 1
  12. Reboot your NAS
  13. Howto Pihole Update?
    • goto SSH and use
      pihole -up

  • we need to add the original Macadress to the network

curl -s https://syncthing.net/release-key.txt | sudo apt-key add - echo „deb https://apt.syncthing.net/ syncthing stable“ | sudo tee /etc/apt/sources.list.d/syncthing.list apt update apt install syncthing

tweaks/nas.txt · Zuletzt geändert: 2019/11/01 14:06 von donzi