Monthly Archives: December 2014

ISC DHCP Server 4.2

Dynamic DNS (DDNS)

Dynamic DNS and DHCP – Easy to do, and you’ll thank yourself later
BIND permission errors
setting up bind to work with nsupdate (SERVFAIL)
DNS – DDNS with DHCPv4 and DHCPv6
DDNS

$ nsupdate
> server 127.0.0.1
> key DHCP_UPDATER uFj0b3YjnGGVOxpjvmpVqQ==
> zone intra.fablabwinti.ch
> update add test123.intra.fablabwinti.ch. 600 IN A 192.168.1.12
> send
update failed: SERVFAIL
$ cat zone.update
server 127.0.0.1
zone intra.fablabwinti.ch
update add test123.intra.fablabwinti.ch. 600 IN A 192.168.1.12
send

$ nsupdate -k ddns.key -v zone.update 
update failed: SERVFAIL
$ sudo /usr/sbin/named -u bind -fg
[...]
$ mv /etc/bind/db.192.168.1 /var/lib/bind
27-Dec-2014 17:30:43.649 client 127.0.0.1#44438/key dhcp_updater: signer "dhcp_updater" approved
27-Dec-2014 17:30:43.649 client 127.0.0.1#44438/key dhcp_updater: updating zone 'intra.fablabwinti.ch/IN': adding an RR at 'test123.intra.fablabwinti.ch' A
27-Dec-2014 17:30:43.650 /etc/bind/db.intra.fablabwinti.ch.jnl: create: permission denied
27-Dec-2014 17:30:43.650 client 127.0.0.1#44438/key dhcp_updater: updating zone 'intra.fablabwinti.ch/IN': error: journal open failed: unexpected error
[...]
27-Dec-2014 17:35:34.307 client 127.0.0.1#44604/key dhcp_updater: signer "dhcp_updater" approved
27-Dec-2014 17:35:34.307 client 127.0.0.1#44604/key dhcp_updater: updating zone 'intra.fablabwinti.ch/IN': adding an RR at 'test123.intra.fablabwinti.ch' A
27-Dec-2014 17:35:34.307 /etc/bind/db.intra.fablabwinti.ch.jnl: open: permission denied
27-Dec-2014 17:35:34.307 client 127.0.0.1#44604/key dhcp_updater: updating zone 'intra.fablabwinti.ch/IN': error: journal open failed: unexpected error
$ cat /etc/apparmor.d/usr.sbin.named 
/usr/sbin/named {
  [...]

  # /etc/bind should be read-only for bind
  # /var/lib/bind is for dynamically updated zone (and journal) files.
  # /var/cache/bind is for slave/stub data, since we're not the origin of it.
  # See /usr/share/doc/bind9/README.Debian.gz
  /etc/bind/** r,
  /var/lib/bind/** rw,
  /var/lib/bind/ rw,
  /var/cache/bind/** lrw,
  /var/cache/bind/ rw,

  [...]
}
$ mv /etc/bind/db.intra.fablabwinti.ch /var/lib/bind
$ mv /etc/bind/db.192.168.1 /var/lib/bind

$ sudo /usr/sbin/named -u bind -fg
[...]
27-Dec-2014 18:04:05.276 client 127.0.0.1#51007/key dhcp_updater: signer "dhcp_updater" approved
27-Dec-2014 18:04:05.276 client 127.0.0.1#51007/key dhcp_updater: updating zone 'intra.fablabwinti.ch/IN': adding an RR at 'test123.intra.fablabwinti.ch' A
27-Dec-2014 18:04:05.281 zone intra.fablabwinti.ch/IN: sending notifies (serial 2014060402)

FAQ

DHCP Server doesn’t start

$ service isc-dhcp-server start
start: Job failed to start
$ dhcpd -t -cf /etc/dhcp/dhcpd.conf
Internet Systems Consortium DHCP Server 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
/etc/dhcp/dhcpd.conf line 8: semicolon expected.
default-lease-time 
 ^
/etc/dhcp/dhcpd.conf line 8: expecting a parameter or declaration
default-lease-time      600;
                            ^
Configuration file errors encountered -- exiting

Brother MFC-9420CN

Brother Handbücher

ubuntuusers.de: Brother Scanner Wiki

VueScan Brother MFC-9420CN Scanner Driver
Brother MFC-7420(Printer/Scanner/Multifunction) – Linux Mint Community
HOWTO: Ubuntu All Brother Printer & Scanner Driver Installation for Newbies!

$ sudo dpkg -i brscan2-0.2.5-1.amd64.deb
$ sudo brsaneconfig2 -a name=MFC-9420CN model=MFC-9420CN ip=192.168.1.12
$ sudo vi /etc/ld.so.conf.d/brother.conf 
$ sudo ldconfig
/usr/lib64
/usr/lib64/sane

Qt on Windows (MinGW-w64)

Compile Graphics Magick, Boost, Botan and QT with MinGW64 under Windows 7 64
Building a custom MinGW/MSYS development environment

QT Archive

INCLUDEPATH += c:/MingW/opt/include
QMAKE_CFLAGS   += c:/MingW/opt/include
QMAKE_CXXFLAGS += c:/MingW/opt/include
QMAKE_LFLAGS   += c:/MingW/opt/lib
QMAKE_CXXFLAGS_DEBUG    += c:/MingW/opt/include
QMAKE_CXXFLAGS_RELEASE  += c:/MingW/opt/include
streambase.cpp: In member function 'quint16 StreamBase::frameLen(int) const':
streambase.cpp:217:48: error: cast from 'const StreamBase*' to 'ulong {aka long unsigned int}' loses precision [-fpermissive]
             qsrand(reinterpret_cast<ulong>(this));
                                                ^
make[2]: *** [debug/streambase.o] Error 1

MinGW-w64 – for 32 and 64 bit Windows

MinGW-w64 – for 32 and 64 bit Windows, A complete runtime environment for gcc
mingw-w64 – GCC for Windows 64 & 32 bits
Win-builds – (Free) Software Building and Packaging For Windows

MSYS2
MSYS2 installer
MSYS2 for Qt
How to build your GTK+ application on Windows
Compile and Install OpenWalnut with MSYS2
Getting and Setting up Msys2, Compiling and Running LibSwift and the Tutorial
Getting and Setting up Msys2, Compiling and Running LibSwift and the Tutorial
Package scripts for MinGW-w64 targets to build under MSYS2
Re: GTK-3.0 for Windows64 update – msg#00020
Pure MSYS2 Unix-like build on Windows: Packaging

Single Sign On (SSO) for Linux and Windows

SingleSignOn
Kerberos
OpenLDAPServer
Samba/Kerberos

Abkürzungen / Abbreviations

Active Directory (AD)
Domain Controller (DC)
Primary Domain Controller (PDC)
Group Policy Object (GPO), Gruppenrichtlinienobjekt für eine Windows Active-Directory-Domain

Linux Logon/Logoff Scripts

AppNote: How to Implement Login Scripts into a Pure Linux Environment

Name Service Switch (NSS)

Background on Name Service Switch

Pluggable Authentication Modules (PAM)

Understand PAM and NSS
PAM/NSS

How PAM works
Understanding PAM
NetBSD: Pluggable Authentication Modules (PAM)
FreeBSD: Pluggable Authentication Modules
Wikipedia: Pluggable Authentication Modules
RedHat: Using Pluggable Authentication Modules (PAM)
User Authentication HOWTO – PAM (Pluggable Authentication Modules)

Samba Shared Folders

Samba Server
Samba Server: smb.conf
samba question: share = user
ubuntu server and samba

$ chown nobody:sambashare /raid/share
# smbpasswd -a bachi
New SMB password:
Retype new SMB password:
tdbsam_open: Converting version 0.0 database to version 4.0.
WARNING: database '/var/db/samba4/private/passdb.tdb.tmp' does not end in .[n]tdb: treating it as a TDB file!
tdbsam_convert_backup: updated /var/db/samba4/private/passdb.tdb file.
tdb(/var/db/samba4/winbindd_idmap.tdb): tdb_open_ex: could not open file /var/db/samba4/winbindd_idmap.tdb: No such file or directory
tdb(/var/db/samba4/account_policy.tdb): tdb_open_ex: could not open file /var/db/samba4/account_policy.tdb: No such file or directory
account_policy_get: tdb_fetch_uint32 failed for type 1 (min password length), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 2 (password history), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 3 (user must logon to change password), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 4 (maximum password age), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 5 (minimum password age), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 6 (lockout duration), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 7 (reset count minutes), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 8 (bad lockout attempt), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 9 (disconnect time), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 10 (refuse machine password change), returning 0
Added user bachi.

# pkg remove samba41 ntdb tdb
# pkg install samba41 ntdb tdb

# smbpasswd -a bachi
New SMB password:
Retype new SMB password:

# ls -la /var/db/samba4/
total 480
drwxr-xr-x   3 root  wheel     512 Feb 18 11:07 .
drwxr-xr-x  12 root  wheel     512 Feb 18 11:00 ..
-rw-------   1 root  wheel  421888 Feb 18 11:03 account_policy.tdb
-rw-r--r--   1 root  wheel     237 Feb 18 11:07 browse.dat
-rw-r--r--   1 root  wheel     696 Feb 18 11:03 gencache.tdb
-rw-r--r--   1 root  wheel     696 Feb 18 11:07 gencache_notrans.tdb
-rw-------   1 root  wheel     696 Feb 18 11:03 group_mapping.tdb
-rw-------   1 root  wheel     696 Feb 18 11:03 mutex.tdb
drwxr-xr-x   2 root  wheel     512 Feb 11 10:16 private


# pdbedit -L  -v
---------------
Unix username:        bachi
NT username:
Account Flags:        [U          ]
User SID:             S-1-5-21-565438450-2596499718-1061971255-1000
Primary Group SID:    S-1-5-21-565438450-2596499718-1061971255-513
Full Name:            Andreas Bachmann
Home Directory:       \\bsd\bachi
HomeDir Drive:
Logon Script:
Profile Path:         \\bsd\bachi\profile
Domain:               BSD
Account desc:
Workstations:
Munged dial:
Logon time:           0
Logoff time:          Sun, 04 Dec 219250468 16:30:07 CET
Kickoff time:         Sun, 04 Dec 219250468 16:30:07 CET
Password last set:    Wed, 18 Feb 2015 11:07:24 CET
Password can change:  Wed, 18 Feb 2015 11:07:24 CET
Password must change: never
Last bad password   : 0
Bad password count  : 0
Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

# testparm
Load smb config files from /usr/local/etc/smb4.conf
Processing section "[homes]"
Loaded services file OK.
WARNING: 'workgroup' and 'netbios name' must differ.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        workgroup = BSD
        idmap config * : backend = tdb

[homes]
        comment = Home Directories
        valid users = %S
        read only = No
        create mask = 0600
        directory mask = 0700
        browseable = No

Samba mit Primary Domain Controller (PDC)

Samba-3 by Example: Chapter 11. Active Directory, Kerberos, and Security
Microsoft: You incorrectly receive an error message when you join a computer that is running Windows 7 to a Samba 3-based domain
Samba AD DC HOWTO
Samba Server PDC
Aufbau und Konfiguration eines Domänencontrollers mit Samba
Samba domain controller
Samba 4 Active Directory Domain Controller
Samba4 AD DC on Ubuntu 14.04
The Samba AD DNS Back Ends

FreeBSD

How to integrate Active Directory with FreeBSD 10.0 using security/sssd?
FreeBSD 10: SAMBA 4 as a domain controller running on a public IP (OpenVPN, BIND, pf)
Samba 4.1 Active Directory Domain Controller on FreeBSD 10.1
How to set up FreeBSD 10.1 as a Domain Controller (Video)
Samba4 dc in FreeBSD 10
Howto setup Samba Domain Controller on FreeBSD

LDAP / OpenLDAP

zytrax.com Open Source Guides – LDAP for Rocket Scientists

2. LDAP Concepts & Overview
Chapter 6. LDAP Configuration
Chapter 8. LDAP LDIF and DSML

Useful tutorials

Example: Shared Address Book (LDAP)
OpenLDAP Server on Ubuntu 14.04
Ubuntu Server Guide: OpenLDAP Server
How To Install and Configure OpenLDAP and phpLDAPadmin on an Ubuntu 14.04 Server
How To Install and Configure a Basic LDAP Server on an Ubuntu 12.04 VPS
Getting error for setting password feild when creating generic user account phpldapadmin

Line 2469:
$default = $this->getServer()->getValue('appearance','password_hash');
or
$default = $this->getServer()->getValue('appearance','password_hash_custom');
$ ldapsearch -X u:admin -b dc=auth,dc=intra,dc=fablabwinti,dc=ch
SASL/DIGEST-MD5 authentication started
Please enter your password: 
ldap_sasl_interactive_bind_s: Invalid credentials (49)
	additional info: SASL(-13): user not found: no secret in database

$ ldapsearch -x -LLL -b dc=auth,dc=intra,dc=fablabwinti,dc=ch 
dn: dc=auth,dc=intra,dc=fablabwinti,dc=ch
objectClass: top
objectClass: dcObject
objectClass: organization
o: fablabwinti
dc: auth

dn: cn=admin,dc=auth,dc=intra,dc=fablabwinti,dc=ch
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator

$ ldapsearch -x -LLL -b dc=auth,dc=intra,dc=fablabwinti,dc=ch dn
dn: dc=auth,dc=intra,dc=fablabwinti,dc=ch
dn: cn=admin,dc=auth,dc=intra,dc=fablabwinti,dc=ch

$ ldapsearch -LLL -x -H ldap:/// -b dc=auth,dc=intra,dc=fablabwinti,dc=ch dn
dn: dc=auth,dc=intra,dc=fablabwinti,dc=ch
dn: cn=admin,dc=auth,dc=intra,dc=fablabwinti,dc=ch

-X 

RADIUS

FreeRADIUS
Centralized Logins Using LDAP and RADIUS
Primer: Authentication – RADIUS, Kerberos, and LDAP
How to integrate RADIUS with Kerberos?
RADIUS and Kerberos and LDAP!!! Oh my!!!

Samba und OpenLDAP

The Linux Samba-OpenLDAP Howto
Setting up Samba as a Domain Controller with OpenLDAP
Samba and LDAP
Setup Samba Domain Controller with LDAP Backend in Ubuntu 13.04
Linux-PDC mit Samba und OpenLDAP – Zentrale Anmeldung

MIT Kerberos 5

Setting up an Active Directory Domain Controller using Samba 4 on Ubuntu 14.04
Ubuntu 14.04 kerberos krb5 installation+removing messed up login
Debian GNU and Ubuntu: Setting up MIT Kerberos 5
Unable to setup Kerberos on Ubuntu 14.04 – krb5kdc: No such file or directory – while initializing database for realm myrealm
Kerberos – Community Help Wiki
Kerberos
Kerberos und LDAP
Kerberos with LDAP Backend on Ubuntu 12.04 – Part One
Kerberos with LDAP Backend on Ubuntu 12.04 – Part Two
Kerberos with LDAP Backend on Ubuntu 12.04 – Part Three
Kerberos with LDAP Backend on Ubuntu 12.04 – Part Four
MIT Kerberos Documentation: Kerberos with LDAP backend on Ubuntu 10.4
MIT Kerberos Documentation: Configuring Kerberos with OpenLDAP back-end
Ubuntu 14.04 LTS : Samba Server : Samba AD DC : Server Settings
Ubuntu 14.04 LTS : WEB Server : Use Kerberos Auth

LightDM

Lightdm Login & Kerberos: Ticket nicht gekommen
Testing Kerberos in Ubuntu
How do I enable the “Other” user for login with Active Directory?
Ubuntu Linux and Active Directory

Abhändigheiten / Dependencies

ISC-DHCPD
BIND DNS-Server

$ sudo apt-get install bind9
$ sudo service bind9 stop

DNS

$ ls -la /etc/bind
[...]
-rw-r--r--   1 bind bind   493 Dez 26 19:41 named.conf
-rw-r--r--   1 root bind   307 Dez 29 18:50 named.conf.local
[...]

$ ls -la /var/lib/bind
[...]
-rw-r--r--  1 bind bind   572 Feb  6 18:49 db.192.168.1
[...]

$ cat /etc/apparmor.d/usr.sbin.named
/usr/sbin/named {
  [...]
 
  # /etc/bind should be read-only for bind
  # /var/lib/bind is for dynamically updated zone (and journal) files.
  # /var/cache/bind is for slave/stub data, since we're not the origin of it.
  # See /usr/share/doc/bind9/README.Debian.gz
  /etc/bind/** r,
  /var/lib/bind/** rw,
  /var/lib/bind/ rw,
  /var/cache/bind/** lrw,
  /var/cache/bind/ rw,
 
  [...]
}

NTP

HOWTO: Set Up an NTP Server
Time Synchronisation with NTP
Postponing ntpd
how do I disable ntpd?
The NTP FAQ and HOWTO – Understanding and using the Network Time Protocol

Apache

$ echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/fqdn.conf
$ sudo a2enconf fqdn

Bugs

Bug #1125726: boot-time race between /etc/network/if-up.d/ntpdate and “/etc/init.d/ntp start”
Bug #777879: removing ntpdate removes ubuntu-minimal (duplicate! use Bug #61619)
Bug #61619: ntpdate in -minimal should have an alternative
Bug #556372: Please remove the plymouth dependency from mountall / cryptsetup (Create a simple package)

Linux: Software RAID mit MDADM verwalten

Software-RAID
mdadm – Tipps & Tricks
Auto Mounting RAID Arrays on Linux Server Startup
Software Raid0 doesn’t mount successfully in fstab
Wikipedia: mdadm
Software RAID mit MDADM verwalten
mdadm mounting
How can I make mdadm auto-assemble RAID after each boot?
How to get an inactive RAID device working again?
How To Set Up Software RAID1 On A Running System – Part 1
How To Set Up Software RAID1 On A Running System – Part 2
RAID 5 mdadm superblock and mount on boot help!
Soft Raid 1 on Ubuntu 12.04 with GPT disks
Software RAID and LVM

fstab
Best practice /etc/fstab mount
Automatic mount ext4 hard disk on boot problem

Create RAID 1

# Install mdadm
apt-get update && apt-get install mdadm

# Partition the disk
fdisk /dev/sdb
fdisk /dev/sdc

# Create RAID
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb2 /dev/sdc2

# Create partition on RAID
mkfs.ext3 /dev/md0

# Mount /dev/md0
mkdir /raid
mount /dev/md0 /raid
df -H

# Add to /etc/fstab
/dev/md0 /raid1 ext3 noatime,rw 0 0

Maintain RAID

$ mdadm --version
mdadm - v3.3 - 3rd September 2013
$ sudo mdadm --assemble --scan -v
mdadm: looking for devices for /dev/md/0
mdadm: no RAID superblock on /dev/md/0
mdadm: no RAID superblock on /dev/sde5
mdadm: no RAID superblock on /dev/sde2
mdadm: no RAID superblock on /dev/sde1
mdadm: no RAID superblock on /dev/sde
mdadm: /dev/sdd1 is busy - skipping
mdadm: no RAID superblock on /dev/sdd
mdadm: /dev/sdc1 is busy - skipping
mdadm: no RAID superblock on /dev/sdc
mdadm: /dev/sdb1 is busy - skipping
mdadm: no RAID superblock on /dev/sdb
mdadm: /dev/sda1 is busy - skipping
mdadm: no RAID superblock on /dev/sda
$ sudo mdadm -v /dev/md0
/dev/md0: 3725.78GiB raid10 4 devices, 0 spares. Use mdadm --detail for more detail.

$ sudo mdadm --detail /dev/md0
[sudo] password for fabmin: 
/dev/md0:
        Version : 1.2
  Creation Time : Thu Nov 13 15:47:46 2014
     Raid Level : raid10
     Array Size : 3906763776 (3725.78 GiB 4000.53 GB)
  Used Dev Size : 1953381888 (1862.89 GiB 2000.26 GB)
   Raid Devices : 4
  Total Devices : 4
    Persistence : Superblock is persistent

    Update Time : Thu Dec 25 18:43:07 2014
          State : clean 
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

         Layout : near=2
     Chunk Size : 512K

           Name : homeserver:0
           UUID : d11e189b:bf60aac9:536e72e5:3c8655ab
         Events : 375

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync set-A   /dev/sda1
       1       8       17        1      active sync set-B   /dev/sdb1
       2       8       33        2      active sync set-A   /dev/sdc1
       3       8       49        3      active sync set-B   /dev/sdd1
$ cat /proc/mdstat 
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md0 : active raid10 sda1[0] sdd1[3] sdc1[2] sdb1[1]
      3906763776 blocks super 1.2 512K chunks 2 near-copies [4/4] [UUUU]
      
unused devices: <none>
# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0755 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

ARRAY /dev/md0 metadata=1.2 name=homeserver:0 UUID=d11e189b:bf60aac9:536e72e5:3c8655ab
$ ps aux | grep mdadm
root      1415  0.0  0.1  13492  2028 ?        Ss   17:27   0:00 /sbin/mdadm --monitor --pid-file /run/mdadm/monitor.pid --daemonise --scan --syslog

UUID of RAID

root@nas:~# blkid
/dev/sda1: LABEL="Wiederherstellung" UUID="EC9A5F809A5F466C" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="03445844-6d0c-4055-a155-6a1442f31f64"
/dev/sda2: UUID="EC60-8F16" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="10226de3-9880-442e-a9e5-d59cdb0ce76d"
/dev/sda4: UUID="C07C7CA27C7C953E" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="63bc6c88-f15f-4001-98cd-5ebb71519308"
/dev/sda5: UUID="e1d7ee86-6489-4389-a936-7552cb2292e8" TYPE="ext4" PARTUUID="9c269108-0270-43e0-b264-b29da816e33a"
/dev/sda6: UUID="47c5ef7e-a68d-4ddd-8aef-feb0a678f05b" TYPE="swap" PARTUUID="e4674559-cd6f-4d08-8bfe-2767821fe661"
/dev/sdb1: LABEL="DATA1" UUID="4C787EC15DDC54A0" TYPE="ntfs" PARTLABEL="DATA1" PARTUUID="45b920c2-1203-48e9-993d-12e70cb6029d"
/dev/sdb2: UUID="0317b14e-ea32-fa89-f352-5cce2ce8839e" UUID_SUB="e2ccf7f5-235a-88dd-e9f8-5bcda5e7983d" LABEL="nas:0" TYPE="linux_raid_member" PARTLABEL="RAID1_1" PARTUUID="170cbcce-7100-43be-8ee9-f8308e41e2cf"
/dev/sdc1: LABEL="DATA2" UUID="01A1558230E30FE7" TYPE="ntfs" PARTLABEL="DATA2" PARTUUID="c637c62a-1b13-496b-96db-bba719110c3b"
/dev/sdc2: UUID="0317b14e-ea32-fa89-f352-5cce2ce8839e" UUID_SUB="2586842b-0c7b-7a8c-1876-5291b55f0b97" LABEL="nas:0" TYPE="linux_raid_member" PARTLABEL="RAID1_2" PARTUUID="3f74418d-5a64-4647-9907-ec24ccf70517"
/dev/md0p1: LABEL="RAID1" UUID="d3150381-ba4a-4a75-8163-dbf9e0a59e33" TYPE="ext4" PARTLABEL="RAID1" PARTUUID="9a8b494a-2f69-48c1-89f8-2cbf0986a991"
/dev/sda3: PARTLABEL="Microsoft reserved partition" PARTUUID="09fa6865-ee2b-4591-ad2f-9d6d3d00b48d"
/dev/md0: PTUUID="d56f81c4-e1ca-4b60-b7df-fc31e89c34d0" PTTYPE="gpt"
$ sudo mdadm --detail /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Fri Jun 24 18:36:32 2016
     Raid Level : raid1
     Array Size : 3370014720 (3213.90 GiB 3450.90 GB)
  Used Dev Size : 3370014720 (3213.90 GiB 3450.90 GB)
   Raid Devices : 2
  Total Devices : 1
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Fri Dec 16 22:33:59 2016
          State : clean, degraded 
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

           Name : nas:0  (local to host nas)
           UUID : 0317b14e:ea32fa89:f3525cce:2ce8839e
         Events : 9836

    Number   Major   Minor   RaidDevice State
       0       0        0        0      removed
       1       8       34        1      active sync   /dev/sdc2

Hinzufügen von Disks (wenn sie removed worden sind)

$ sudo mdadm --manage /dev/md/0 -a /dev/sdb2
mdadm: re-added /dev/sdb2

$ sudo mdadm --detail /dev/md0
/dev/md0:
[...]
 Rebuild Status : 42% complete
[...]
    Number   Major   Minor   RaidDevice State
       0       8       18        0      spare rebuilding   /dev/sdb2
       1       8       34        1      active sync   /dev/sdc2
Mar  2 21:47:30 nas kernel: [    0.752405] ata3: SATA max UDMA/133 abar m2048@0xe1540000 port 0xe1540200 irq 25
Mar  2 21:47:30 nas kernel: [    6.115679] ata3: link is slow to respond, please be patient (ready=0)
Mar  2 21:47:30 nas kernel: [   10.763743] ata3: COMRESET failed (errno=-16)
Mar  2 21:47:30 nas kernel: [   16.123820] ata3: link is slow to respond, please be patient (ready=0)
Mar  2 21:47:30 nas kernel: [   20.771889] ata3: COMRESET failed (errno=-16)
Mar  2 21:47:30 nas kernel: [   26.131960] ata3: link is slow to respond, please be patient (ready=0)
Mar  2 21:47:30 nas kernel: [   45.004224] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Mar  2 21:47:30 nas kernel: [   45.093844] ata3.00: ATA-9: WDC WD40EFRX-68WT0N0, 82.00A82, max UDMA/133
Mar  2 21:47:30 nas kernel: [   45.093849] ata3.00: 7814037168 sectors, multi 0: LBA48 NCQ (depth 31/32), AA
Mar  2 21:47:30 nas kernel: [   45.097003] ata3.00: configured for UDMA/133
# dmesg | egrep 'error|fail|bug'
[    0.113512] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.117340] acpi PNP0A08:00: _OSC failed (AE_ERROR); disabling ASPM
[    0.633202] ehci-pci 0000:00:1a.0: debug port 2
[    0.647962] ehci-pci 0000:00:1d.0: debug port 2
[   10.763743] ata3: COMRESET failed (errno=-16)
[   20.771889] ata3: COMRESET failed (errno=-16)
[   53.028988] systemd[1]: Mounting Debug File System...
[   53.034543] systemd[1]: Mounted Debug File System.
[   53.125708] EXT4-fs (sda5): re-mounted. Opts: errors=remount-ro
[   53.976282] vboxdrv: module verification failed: signature and/or required key missing - tainting kernel
# sudo lshw -class disk -short
H/W path         Device     Class          Description
======================================================
/0/1/0.0.0       /dev/sda   disk           256GB Samsung SSD 850
/0/2/0.0.0       /dev/sdb   disk           4TB WDC WD40EFRX-68W
/0/3/0.0.0       /dev/sdc   disk           4TB WDC WD40EFRX-68W


HOWTO: Repair a broken Ext4 Superblock in Ubuntu
MDADM Superblock Recovery

Ubuntu Package nicht Upgraden

How to prevent updating of a specific package?

Using dpkg

Put a package on hold

echo "package hold" | sudo dpkg --set-selections

Remove the hold

echo "package install" | sudo dpkg --set-selections

Displaying the status of your packages

dpkg --get-selections

Displaying the status of a single package

dpkg --get-selections | grep "package"

Using apt

you can hold a package using

sudo apt-mark hold package_name

and remove the hold with

sudo apt-mark unhold package_name

Using aptitude

you can hold a package using

sudo aptitude hold package_name

and remove the hold with

sudo aptitude unhold package_name