Diskussion:NixOS: Unterschied zwischen den Versionen

Aus C3D2
Zur Navigation springen Zur Suche springen
Zeile 54: Zeile 54:
==== Partitionieren und Formatieren ====
==== Partitionieren und Formatieren ====


; Bestandsaufnahme:
===== Bestandsaufnahme der verfuegbaren Geraete an Massenspeicher =====
 
: <code>lsblk</code>


: <code>fdisk -l /dev/sda</code>
: <code>fdisk -l /dev/sda</code>
Zeile 92: Zeile 94:
<syntaxhighlight lang="shell"></syntaxhighlight>
<syntaxhighlight lang="shell"></syntaxhighlight>


: <code>lsblk</code>
===== Partitionierung eines verfuegbaren Geraetes an Massenspeicher =====


; Pauschales Erstellen einer neuen Partitionstabelle auf jedem Geraet, das kuenftig Bestandteil vom Setup sein soll:
; Pauschales Erstellen einer neuen Partitionstabelle auf jedem Geraet, das kuenftig Bestandteil vom Setup sein soll:
Zeile 102: Zeile 104:
:* Bestaetigen
:* Bestaetigen


: <code>sgdisk -Z /dev/sdd</code>
???
: <code>sgdisk -p /dev/sda</code>
<syntaxhighlight lang="shell"></syntaxhighlight>
<syntaxhighlight lang="shell">
Number  Start (sector)    End (sector)  Size      Code  Name
  1            2048        2099199  1024.0 MiB  8300  Linux filesystem
  2        2099200      976773119  464.8 GiB  8300  Linux filesystem
</syntaxhighlight>
 
: <code>sgdisk -Z /dev/sda</code>
<syntaxhighlight lang="shell">
<syntaxhighlight lang="shell">
GPT data structures destroyed! You may now partition the disk using fdisk or other utilities.
GPT data structures destroyed! You may now partition the disk using fdisk or other utilities.
</syntaxhighlight>
</syntaxhighlight>


: <code>sgdisk -o /dev/sdd</code>
: <code>sgdisk -o /dev/sda</code>
<syntaxhighlight lang="shell">
<syntaxhighlight lang="shell">
Creating new GPT entries.
Creating new GPT entries.
Zeile 113: Zeile 124:
</syntaxhighlight>
</syntaxhighlight>


: <code>sgdisk -p /dev/sdd</code>
: <code>sgdisk -p /dev/sda</code>
<syntaxhighlight lang="shell">
<syntaxhighlight lang="shell">
Disk /dev/sdd: 976773168 sectors, 465.8 GiB
Disk /dev/sdd: 976773168 sectors, 465.8 GiB
Zeile 137: Zeile 148:


----
----
 
<!--
???
: <code>sgdisk -p /dev/sda</code>
<syntaxhighlight lang="shell"></syntaxhighlight>
<syntaxhighlight lang="shell">
Number  Start (sector)    End (sector)  Size      Code  Name
  1            2048        2099199  1024.0 MiB  8300  Linux filesystem
  2        2099200      976773119  464.8 GiB  8300  Linux filesystem
</syntaxhighlight>


: <code>sgdisk -Z /dev/sda</code>
: <code>sgdisk -Z /dev/sda</code>
Zeile 186: Zeile 189:
Number  Start (sector)    End (sector)  Size      Code  Name
Number  Start (sector)    End (sector)  Size      Code  Name
</syntaxhighlight>
</syntaxhighlight>
!-->
----


----
===== Partitionierung eines weiteren Geraetes an Massenspeicher =====


Replizieren der Partitionstablle vom eingerichteten Geraet ''sda'' auf das gleichermassen einzurichtende Geraet ''sdd''
Replizieren der Partitionstablle vom eingerichteten Geraet ''sda'' auf das gleichermassen einzurichtende Geraet ''sdd''

Version vom 19. November 2017, 00:55 Uhr

Ideen für Ideen zu und rund um NixOS

NixOS meets iRedMail

(g)ui the whole configuration.nix

  • gui oder wui
  • Unmöglichkeit von Typos
  • bessere Übersicht zu (allen) verfügbaren Optionen
  • ...

NixOS as FreeBSD

aka uNix oder FreeNix oder NixBSD

nixpkgs on BSD

Dragonfly BSD
Anwendungsbeispiele
nix für Jails

my perfect NixOS laptop installation

The goal is to set up a sweet default for the usage of a (usual) laptop running NixOS.

Probably we are going to use a ThinkPad (idea of the project denkende Bretter bohren). Of course everybody can bring their own device.

The "perfect" setup seems to be:

  • NixOS
  • ZFS (for everything but /boot)
    ext4 might be possible also but is not as feature rich. btrfs should be also available to install (NixOS) on.
  • 2 mirrored disks (nice to have)
    (A caddy for a second disk (for a ThinkPad) will be there for testing such a setup. user:vater has got one.)
  • all data encrypted (as far as possible - for / but probably without /boot)
    Probably we have to use the 18.03 (version of NixOS, a prerelease) b/c we also want to test native ZFS encryption.
    Those who are interested to run LUKS - the "typical" way to encrypt devices on GNU/Linux - can do of course.
    ZFS native encryption is one of the newest features of ZFS, driven by the ZoL community. (It is not available on FreeBSD at present (2017-10).)
  • (maybe a device or file for swap)

Installation

Hardware

Laptop
lenovo ThikPad T430
Massenspeicher
  • 2 x 500 GB HDD
  • 1 x 24 GB SSD
  • 1 x 16 GB USB
Arbeitsspeicher
  • 2 x 8 GB DDR3

Partitionieren und Formatieren

Bestandsaufnahme der verfuegbaren Geraete an Massenspeicher
lsblk
fdisk -l /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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
fdisk -l /dev/sdb
Disk /dev/sdb: 22.4 GiB, 24015495168 bytes, 46905264 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
fdisk -l /dev/sdc
Disk /dev/sdc: 14.9 GiB, 16005464064 bytes, 31260672 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: dos
fdisk -l /dev/sdd
Disk /dev/sdd: 465.8 GiB, 500107862016 bytes, 976773168 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
Partitionierung eines verfuegbaren Geraetes an Massenspeicher
Pauschales Erstellen einer neuen Partitionstabelle auf jedem Geraet, das kuenftig Bestandteil vom Setup sein soll
BTW: Das kann auch gern auf der grafischen Oberflaeche mit GParted gemacht werden.
  • Geraet im Dropdown-Menue auswaehlen
  • Device -> Create Partion Table
  • gpt im Dropdown-Menue auswaehlen
  • Bestaetigen

???

sgdisk -p /dev/sda
Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         2099199   1024.0 MiB  8300  Linux filesystem
   2         2099200       976773119   464.8 GiB   8300  Linux filesystem
sgdisk -Z /dev/sda
GPT data structures destroyed! You may now partition the disk using fdisk or other utilities.
sgdisk -o /dev/sda
Creating new GPT entries.
The operation has completed successfully.
sgdisk -p /dev/sda
Disk /dev/sdd: 976773168 sectors, 465.8 GiB
Model:
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID):
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 976773101 sectors (465.8 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name


Partitionierung eines weiteren Geraetes an Massenspeicher

Replizieren der Partitionstablle vom eingerichteten Geraet sda auf das gleichermassen einzurichtende Geraet sdd

sgdisk /dev/sda -R /dev/sdd
The operation has completed successfully.

Generieren einer neuen (abweichenden) GUID fuer das gleichermassen einzurichtende Geraet sdd

sgdisk -G /dev/sdd

booting from ZFS

GRUB kann doch ZFS, oder?

oder ist das nur ein Ding für FreeBSD?

Das Übergeben vom Passwort ist dann vielleicht noch einmal ein anderer Akt. (Ich bilde mir ein, dass als PC-BSD zeitweise GRUB nutzte, das da bereits bei GRUB das Passwort abverlangt wurde. (set kFreeBSD.kern.geom.eli.passphrase="$pass" oder so ein Pfeffer[1]))