Der Plan

Einen ROCKPro64 als verschlüsseltes NAS zu benutzen.

 

Hardware

  • ROCKPro64 2GB v2.1
  • Netzteil für ROCKPro64
  • eMMC Modul 32GB
  • PCIe SATA Adapter
  • 2 St. HDD 2,5 Zoll 2TB
  • 2 St. SATA Kabel
  • Spannungsversorgungsleitung für zwei SATA Laufwerke

Software

Ein Bionic-Minimal soll die Basis sein.

Installation des Systemes

Wir flashen das Image auf eine SD-Karte. Diesen Schritt kann man sich ersparen, wenn man den USB-Adapter für eMMC-Module hat. Muss ich beim nächsten Mal mitbestellen. Aber man weiß sich ja zu helfen. :)

Die SD-Karte in den ROCKPro64, eMMC-Modul rein und den ROCKPro64 einschalten.

rock64@rockpro64:~$ uname -a
Linux rockpro64 4.4.132-1075-rockchip-ayufan-ga83beded8524 #1 SMP Thu Jul 26 08:22:22 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux

Wir kopieren jetzt das System auf das eMMC-Modul nach dieser Anleitung.

Erledigt. ?

rock64@rockpro64:~$ sudo dd if=/dev/mmcblk0 of=/dev/mmcblk1 bs=4M
[sudo] password for rock64:
3798+1 records in
3798+1 records out
15931539456 bytes (16 GB, 15 GiB) copied, 673.512 s, 23.7 MB/s

Ok, dann davon starten, SD-Karte raus und vom eMMC-Modul booten. Mal nachschauen ob es geklappt hat.

 

rock64@rockpro64:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 992M 0 992M 0% /dev
tmpfs 200M 484K 199M 1% /run
/dev/mmcblk1p7 15G 1.2G 13G 9% /
tmpfs 996M 0 996M 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 996M 0 996M 0% /sys/fs/cgroup
/dev/mmcblk1p6 112M 4.0K 112M 1% /boot/efi
tmpfs 200M 0 200M 0% /run/user/1000

Ok, hier sieht man das ich / noch nicht resized habe. Auf deutsch, die Partition muss noch vergrößert werden, da sie nur 15G groß ist. Auch logisch, wir haben ja mit dd von einer 16GB großen SD-Karte kopiert. Aber Kamil hat da ein nettes Script für.

cd /usr/local/sbin

Dort findet man das Script

sudo ./resize_rootfs.sh

Die Ausgabe

rock64@rockpro64:/usr/local/sbin$ sudo ./resize_rootfs.sh
[sudo] password for rock64:
Resizing /dev/mmcblk1 (sd/emmc -- /dev/mmcblk1p7)...
+ sgdisk -e /dev/mmcblk1
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
+ echo ,+,,,
+ sfdisk /dev/mmcblk1 -N7 --force
Checking that no-one is using this disk right now ... FAILED

This disk is currently in use - repartitioning is probably a bad idea.
Umount all file systems, and swapoff all swap partitions on this disk.
Use the --no-reread flag to suppress this check.

Disk /dev/mmcblk1: 28.9 GiB, 31037849600 bytes, 60620800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2C9A4A22-7AA8-4A1B-815E-0C3E2E7065E6

Old situation:

Device Start End Sectors Size Type
/dev/mmcblk1p1 64 8063 8000 3.9M Linux filesystem
/dev/mmcblk1p2 8064 8191 128 64K Linux filesystem
/dev/mmcblk1p3 8192 16383 8192 4M Linux filesystem
/dev/mmcblk1p4 16384 24575 8192 4M Linux filesystem
/dev/mmcblk1p5 24576 32767 8192 4M Linux filesystem
/dev/mmcblk1p6 32768 262143 229376 112M Microsoft basic data
/dev/mmcblk1p7 262144 31116254 30854111 14.7G Linux filesystem

/dev/mmcblk1p7:
New situation:
Disklabel type: gpt
Disk identifier: 2C9A4A22-7AA8-4A1B-815E-0C3E2E7065E6

Device Start End Sectors Size Type
/dev/mmcblk1p1 64 8063 8000 3.9M Linux filesystem
/dev/mmcblk1p2 8064 8191 128 64K Linux filesystem
/dev/mmcblk1p3 8192 16383 8192 4M Linux filesystem
/dev/mmcblk1p4 16384 24575 8192 4M Linux filesystem
/dev/mmcblk1p5 24576 32767 8192 4M Linux filesystem
/dev/mmcblk1p6 32768 262143 229376 112M Microsoft basic data
/dev/mmcblk1p7 262144 60619709 60357566 28.8G Linux filesystem

The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
Syncing disks.
+ partprobe /dev/mmcblk1
+ resize2fs /dev/mmcblk1p7
resize2fs 1.44.1 (24-Mar-2018)
Filesystem at /dev/mmcblk1p7 is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 4
The filesystem on /dev/mmcblk1p7 is now 7544695 (4k) blocks long.

Neustarten und überprüfen

sudo reboot

Kurz überprüfen

rock64@rockpro64:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 992M 0 992M 0% /dev
tmpfs 200M 484K 199M 1% /run
/dev/mmcblk1p7 29G 1.2G 26G 5% /
tmpfs 996M 0 996M 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 996M 0 996M 0% /sys/fs/cgroup
/dev/mmcblk1p6 112M 4.0K 112M 1% /boot/efi
tmpfs 200M 0 200M 0% /run/user/1000

Fertig! Das System ist nun auf dem eMMC-Modul. Wenn ihr kein eMMC-Modul habt, könnt ihr das alles auslassen und arbeitet einfach mit der SD-Karte. Vorausgesetzt man hat eine schnelle SD-Karte ist das sogar mittlerweile eine Option. Die sind sehr schnell geworden und kosten auch nicht mehr die Welt. Ok, weiter geht's

Cryptsetup

Cryptsetup installieren

rock64@rockpro64:~$ sudo apt-get update && sudo apt-get install cryptsetup
Hit:1 http://ppa.launchpad.net/ayufan/rock64-ppa/ubuntu bionic InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports bionic InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease
Get:4 http://deb.ayufan.eu/orgs/ayufan-rock64/releases InRelease [1335 B]
Hit:5 http://ppa.launchpad.net/ayufan/all-ppa/ubuntu bionic InRelease
Hit:6 http://ports.ubuntu.com/ubuntu-ports bionic-updates InRelease
Fetched 1335 B in 2s (872 B/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
cryptsetup-bin
Suggested packages:
keyutils
Recommended packages:
busybox-static | busybox plymouth
The following NEW packages will be installed:
cryptsetup cryptsetup-bin
0 upgraded, 2 newly installed, 0 to remove and 12 not upgraded.
Need to get 236 kB of archives.
After this operation, 816 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://ports.ubuntu.com/ubuntu-ports bionic/main arm64 cryptsetup-bin arm64 2:2.0.2-1ubuntu1 [85.6 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports bionic/main arm64 cryptsetup arm64 2:2.0.2-1ubuntu1 [150 kB]
Fetched 236 kB in 0s (1142 kB/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "de_DE.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Preconfiguring packages ...
Selecting previously unselected package cryptsetup-bin.
(Reading database ... 46721 files and directories currently installed.)
Preparing to unpack .../cryptsetup-bin_2%3a2.0.2-1ubuntu1_arm64.deb ...
Unpacking cryptsetup-bin (2:2.0.2-1ubuntu1) ...
Selecting previously unselected package cryptsetup.
Preparing to unpack .../cryptsetup_2%3a2.0.2-1ubuntu1_arm64.deb ...
Unpacking cryptsetup (2:2.0.2-1ubuntu1) ...
Processing triggers for systemd (237-3ubuntu10.3) ...
Setting up cryptsetup-bin (2:2.0.2-1ubuntu1) ...
Setting up cryptsetup (2:2.0.2-1ubuntu1) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
update-initramfs: deferring update (trigger activated)
Processing triggers for systemd (237-3ubuntu10.3) ...
Processing triggers for initramfs-tools (0.130ubuntu3.1) ...
update-initramfs: Generating /boot/initrd.img-4.4.132-1075-rockchip-ayufan-ga83beded8524
cryptsetup: WARNING: could not determine root device from /etc/fstab

Dabei fallen mir zwei Dinge auf.

perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "de_DE.UTF-8"
are supported and installed on your system.

Das läßt sich mit dieser Anleitung einfach fixen.

Und das hier

cryptsetup: WARNING: could not determine root device from /etc/fstab

Dazu fällt mir aktuell nichts ein !?

Cryptsetup benchmark

rock64@rockpro64:~$ cryptsetup benchmark
# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1 714288 iterations per second for 256-bit key
PBKDF2-sha256 1351257 iterations per second for 256-bit key
PBKDF2-sha512 438367 iterations per second for 256-bit key
PBKDF2-ripemd160 334367 iterations per second for 256-bit key
PBKDF2-whirlpool 155852 iterations per second for 256-bit key
argon2i 4 iterations, 326215 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
argon2id 4 iterations, 345708 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
# Algorithm | Key | Encryption | Decryption
aes-cbc 128b 527.2 MiB/s 697.3 MiB/s
serpent-cbc 128b N/A N/A
twofish-cbc 128b 72.3 MiB/s 74.1 MiB/s
aes-cbc 256b 456.2 MiB/s 648.1 MiB/s
serpent-cbc 256b N/A N/A
twofish-cbc 256b 72.7 MiB/s 74.3 MiB/s
aes-xts 256b 586.3 MiB/s 589.0 MiB/s
serpent-xts 256b N/A N/A
twofish-xts 256b N/A N/A
aes-xts 512b 542.1 MiB/s 546.5 MiB/s
serpent-xts 512b N/A N/A
twofish-xts 512b N/A N/A

Quelle: https://kneit.in/2015/09/17/brtfs-raid-on-dmcrypt.html

Ich werde jetzt schnell beide HHD's partitionieren.

rock64@rockpro64:~$ fdisk -l
fdisk: cannot open /dev/ram0: Permission denied
fdisk: cannot open /dev/mtdblock0: Permission denied
fdisk: cannot open /dev/mtdblock1: Permission denied
fdisk: cannot open /dev/mtdblock2: Permission denied
fdisk: cannot open /dev/mmcblk1: Permission denied
fdisk: cannot open /dev/mmcblk1rpmb: Permission denied
fdisk: cannot open /dev/mmcblk1boot1: Permission denied
fdisk: cannot open /dev/mmcblk1boot0: Permission denied
fdisk: cannot open /dev/sda: Permission denied
fdisk: cannot open /dev/sdb: Permission denied
fdisk: cannot open /dev/zram0: Permission denied
fdisk: cannot open /dev/zram1: Permission denied
fdisk: cannot open /dev/zram2: Permission denied
fdisk: cannot open /dev/zram3: Permission denied
fdisk: cannot open /dev/zram4: Permission denied
fdisk: cannot open /dev/zram5: Permission denied

Die HDD's sind sda und sdb.

sudo fdisk /dev/sda
sudo fdisk /dev/sdb

Ich gehe hier nicht weiter drauf ein, richtet eine Partition ein und fertig. Natürlich für beide Platten.

Ergebnis

Disk /dev/sda: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: ECA86F86-787E-483F-BD79-DC980BCA9447

Device Start End Sectors Size Type
/dev/sda1 2048 3907029134 3907027087 1,8T Linux filesystem

Disk /dev/sdb: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 1978A3C9-E914-41FB-8788-5518DBB77B2F

Device Start End Sectors Size Type
/dev/sdb1 2048 3907029134 3907027087 1,8T Linux filesystem

Beide Festplatten verschlüsseln

rock64@rockpro64:~$ sudo cryptsetup --key-size 512 --hash sha256 --iter-time 5000 --use-random luksFormat /dev/sda1

WARNING!
========
This will overwrite data on /dev/sda1 irrevocably.

Are you sure? (Type uppercase yes): YES
Enter passphrase for /dev/sda1:
Verify passphrase:

Das selbe mit sdb1 machen!

rock64@rockpro64:~$ sudo cryptsetup --key-size 512 --hash sha256 --iter-time 5000 --use-random luksFormat /dev/sdb1

WARNING!
========
This will overwrite data on /dev/sdb1 irrevocably.

Are you sure? (Type uppercase yes): YES
Enter passphrase for /dev/sdb1:
Verify passphrase:
System is out of entropy while generating volume key.
Please move mouse or type some text in another window to gather some random events.
Generating key (32% done).
Generating key (32% done).
Generating key (32% done).
Generating key (32% done).
Generating key (42% done).
Generating key (42% done).
Generating key (42% done).
Generating key (42% done).
Generating key (42% done).
Generating key (51% done).
Generating key (51% done).
Generating key (51% done).
Generating key (51% done).
Generating key (51% done).
Generating key (60% done).
Generating key (60% done).
Generating key (60% done).
Generating key (60% done).
Generating key (60% done).
Generating key (70% done).
Generating key (70% done).
Generating key (70% done).
Generating key (70% done).
Generating key (70% done).
Generating key (79% done).
Generating key (79% done).
Generating key (79% done).
Generating key (79% done).
Generating key (79% done).
Generating key (89% done).
Generating key (89% done).
Generating key (89% done).
Generating key (89% done).
Generating key (98% done).
Generating key (98% done).
Generating key (98% done).
Generating key (98% done).
Generating key (100% done).

Fertig! Beide HDD's sind jetzt verschlüsselt. Als nächstes

sda1

rock64@rockpro64:~$ sudo cryptsetup open /dev/sda1 btrfs_pool0
Enter passphrase for /dev/sda1:

sdb1

rock64@rockpro64:~$ sudo cryptsetup open /dev/sdb1 btrfs_pool1
Enter passphrase for /dev/sdb1:

Beide HDD's sind jetzt entsperrt und können benutzt werden, das kann man auch sehen mit

rock64@rockpro64:~$ fdisk -l
fdisk: cannot open /dev/ram0: Permission denied
fdisk: cannot open /dev/mtdblock0: Permission denied
fdisk: cannot open /dev/mtdblock1: Permission denied
fdisk: cannot open /dev/mtdblock2: Permission denied
fdisk: cannot open /dev/mmcblk1: Permission denied
fdisk: cannot open /dev/mmcblk1rpmb: Permission denied
fdisk: cannot open /dev/mmcblk1boot1: Permission denied
fdisk: cannot open /dev/mmcblk1boot0: Permission denied
fdisk: cannot open /dev/sda: Permission denied
fdisk: cannot open /dev/sdb: Permission denied
fdisk: cannot open /dev/zram0: Permission denied
fdisk: cannot open /dev/zram1: Permission denied
fdisk: cannot open /dev/zram2: Permission denied
fdisk: cannot open /dev/zram3: Permission denied
fdisk: cannot open /dev/zram4: Permission denied
fdisk: cannot open /dev/zram5: Permission denied
fdisk: cannot open /dev/mapper/btrfs_pool0: Permission denied
fdisk: cannot open /dev/mapper/btrfs_pool1: Permission denied

Die beiden HDD's

fdisk: cannot open /dev/mapper/btrfs_pool0: Permission denied
fdisk: cannot open /dev/mapper/btrfs_pool1: Permission denied

Das hilft uns aber nichts, da wir noch kein Filesystem aufgesetzt haben. Und dazu möchte ich gerne btrfs einsetzen.

Installieren

sudo apt-get install btrfs-tools

Filesystem & Raid1 anlegen

sudo mkfs.btrfs -m raid1 -d raid1 /dev/mapper/btrfs_pool0 /dev/mapper/btrfs_pool1

Ausgabe

rock64@rockpro64:~$ sudo mkfs.btrfs -m raid1 -d raid1 /dev/mapper/btrfs_pool0 /dev/mapper/btrfs_pool1
btrfs-progs v4.15.1
See http://btrfs.wiki.kernel.org for more information.

Label: (null)
UUID: f42fff01-ebdc-4972-9e75-5720ca319843
Node size: 16384
Sector size: 4096
Filesystem size: 3.64TiB
Block group profiles:
Data: RAID1 1.00GiB
Metadata: RAID1 1.00GiB
System: RAID1 8.00MiB
SSD detected: no
Incompat features: extref, skinny-metadata
Number of devices: 2
Devices:
ID SIZE PATH
1 1.82TiB /dev/mapper/btrfs_pool0
2 1.82TiB /dev/mapper/btrfs_pool1

Raid1 mounten

Verzeichnis anlegen

sudo mkdir /mnt/btrfs

Danach mounten

rock64@rockpro64:~$ sudo mount /dev/mapper/btrfs_pool0 /mnt/btrfs
rock64@rockpro64:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 992M 0 992M 0% /dev
tmpfs 200M 496K 199M 1% /run
/dev/mmcblk1p7 29G 1,3G 26G 5% /
tmpfs 996M 0 996M 0% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 996M 0 996M 0% /sys/fs/cgroup
/dev/mmcblk1p6 112M 4,0K 112M 1% /boot/efi
tmpfs 200M 0 200M 0% /run/user/1000
/dev/mapper/btrfs_pool0 1,9T 17M 1,9T 1% /mnt/btrfs

Hier wird das Raid1 gemountet, danach kurze Kontrolle. So weit sieht das gut aus. Jetzt schauen wir mal, ob das nach einem Reboot noch geht :)

Nach dem Start des Systemes müssen wir beide Platten entsperren. Dazu benötigt es drei Schritte

sudo cryptsetup open /dev/sda1 btrfs_pool0
sudo cryptsetup open /dev/sdb1 btrfs_pool1
sudo mount /dev/mapper/btrfs_pool0 /mnt/btrfs

Kontrolle

rock64@rockpro64:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 992M 0 992M 0% /dev
tmpfs 200M 496K 199M 1% /run
/dev/mmcblk1p7 29G 1,3G 26G 5% /
tmpfs 996M 0 996M 0% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 996M 0 996M 0% /sys/fs/cgroup
/dev/mmcblk1p6 112M 4,0K 112M 1% /boot/efi
tmpfs 200M 0 200M 0% /run/user/1000
/dev/mapper/btrfs_pool0 1,9T 17M 1,9T 1% /mnt/btrfs

Da fehlt jetzt noch was Wichtiges. Der Benutzer muss noch eingestellt werden, sonst kann man in /mnt/btrfs nicht schreiben.

sudo chown -R rock64:rock64 /mnt/btrfs

Nun ist der Besitzer der User rock64.

hdparm

Mit hdparm kann man die HDDs schlafen legen. Gerade die mechanischen Dinger, können einem ganz schön auf die Nerven gehen. Da ich diese Installation später mal als NAS nutzen möchte, müssen die Platten nicht ewig laufen. Macht die mechanischen Dinger auch nur kaputt ;)

Installation

rock64@rockpro64:/mnt$ sudo apt-get install hdparm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
apmd
Recommended packages:
powermgmt-base
The following NEW packages will be installed:
hdparm
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 89.6 kB of archives.
After this operation, 231 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports bionic/main arm64 hdparm arm64 9.54+ds-1 [89.6 kB]
Fetched 89.6 kB in 0s (460 kB/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "de_DE.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package hdparm.
(Reading database ... 46794 files and directories currently installed.)
Preparing to unpack .../hdparm_9.54+ds-1_arm64.deb ...
Unpacking hdparm (9.54+ds-1) ...
Setting up hdparm (9.54+ds-1) ...

Konfiguration

ls /dev/disk/by-id

Die ID's der HDDs auslesen. In meinem Fall sieht das so aus.

rock64@rockpro64:/dev/disk/by-id$ ls
ata-ST2000LM015-2E8174_ZDZ2MY9W mmc-SC32G_0x601d3b65 mmc-SC32G_0x601d3b65-part4 wwn-0x5000c500b111120c
ata-ST2000LM015-2E8174_ZDZ2MY9W-part1 mmc-SC32G_0x601d3b65-part1 mmc-SC32G_0x601d3b65-part5 wwn-0x5000c500b111120c-part1
ata-ST2000LM015-2E8174_ZDZ2MZ1W mmc-SC32G_0x601d3b65-part2 mmc-SC32G_0x601d3b65-part6 wwn-0x5000c500b1112c07
ata-ST2000LM015-2E8174_ZDZ2MZ1W-part1 mmc-SC32G_0x601d3b65-part3 mmc-SC32G_0x601d3b65-part7 wwn-0x5000c500b1112c07-part1

Das sind meine beiden Festplatten

  • ata-ST2000LM015-2E8174_ZDZ2MY9W
  • ata-ST2000LM015-2E8174_ZDZ2MZ1W

Config bearbeiten

sudo nano /etc/hdparm.conf

Das dann ans Ende der Datei. Sieht dann so aus

#HDDs schlafen legen nach 20 Minuten (240*5=1200Sek.=20Min.)
/dev/disk/by-id/ata-ST2000LM015-2E8174_ZDZ2MY9W {
# mult_sect_io = 16
# write_cache = off
# dma = on
spindown_time = 10
}

/dev/disk/by-id/ata-ST2000LM015-2E8174_ZDZ2MZ1W {
# mult_sect_io = 16
# write_cache = off
# dma = on
spindown_time = 10
}

Die 10 ist mein Testwert, man hat ja nicht ewig Zeit ? Danach mal eben neustarten und etwas warten, dann legen sich die Platten schlafen. Das machen sie natürlich nur, wenn es keine Aktivität gibt! Bei mir hat das wunderbar geklappt, nach einer knappen Minute waren sie leise.
Die 240 also 20 Minuten, benutze ich schon ewig auf meinem NAS, ohne Probleme. Also, nach dem Testen auf 240 umstellen! Neustarten nicht vergessen.



Fazit

So weit sieht das doch jetzt alles prima aus. Was jetzt noch fehlt, wäre das beim Starten automatisch die Passwörter abgefragt werden und das automatisch gemountet wird. Dazu eine Kontrolle ob auch die Daten korrekt geschrieben werden. Aber darüber muss ich nochmal nachdenken, ob das alles auch sinnvoll ist.

Erst mal eine Kaffee!

And many thanks to kyle kneitlinger for an very nice tutorial!
https://kneit.in/2015/09/17/brtfs-raid-on-dmcrypt.html

Update

Kontrolle der Daten

Testfile anlegen

rock64@rockpro64:/mnt/btrfs$ nano test

Die 2. Platte mounten

rock64@rockpro64:/mnt/btrfs$ sudo mount /dev/mapper/btrfs_pool1 /media

File lesen

nano /media/btrfs/test

Hat alles geklappt?

rock64@rockpro64:/media$ sudo umount /media

Das dient nur der Kontrolle. btrfs kümmert sich da alleine drum, nur um mal zu sehen ob das auch klappt, hab ich das gemacht. Im Normalfall interessiert uns die 2. Platte nicht.

 

Und noch viel mehr zum ROCKPro64 und meinem NAS findet ihr in meinem Forum!