Benutzer:JoergE
Aktuelle Projekte
Raspberry Pi Debian (Raspbian) basierter Server
Schritt für Schritt Anleitung unter Verwendung eines Debian basierten Linux Desktop PCs.
Achtung: inzwischen sind wir auf ein minibian basiertes System umgestiegen, das hier beschriebene Vorgehen ist nicht falsch, aber wird derzeit nicht mehr weiter verfolgt.
Hardware
Ich habe folgende Speicher ausgewählt:
- SD Card: http://www.mindfactory.de/product_info.php/64-GB-Platinum-BestMedia-SDXC-Class-10-Retail_903535.html
- USB Speicherstick: http://www.mindfactory.de/product_info.php/64-GB-Verbatim-PinStripe-schwarz-USB-2-0_794286.html
Auswahl des Installation Image
Überblick über verfügbare Images: http://www.raspberrypi.org/downloads
Image Download
in ein temporäres Verzeichnis gehen, runterladen, Prüfsumme vergleichen und auspacken.
Hinweis: bei mir hat der Torrent nicht funktioniert und der .zip file Download von 550MB war nur langsam mit ~300kB/s. Also evtl das Image nochmal woanders speichern für weitere Versuche.
root@acca:~# cd /tmp root@acca:/tmp# wget http://director.downloads.raspberrypi.org/raspbian/images/raspbian-2013-10-07/2013-09-25-wheezy-raspbian.zip root@acca:/tmp# sha1sum 2013-09-25-wheezy-raspbian.zip root@acca:/tmp# unzip 2013-09-25-wheezy-raspbian.zip
Vorbereiten der SD Card
Der Bequemlichkeit halber hier alles mit root, statt einzelnn mit "sudo".
root@acca:/tmp# sudo -i
Prüfen der gelieferten Karte:
root@acca:/tmp# fdisk -l /dev/sdb Disk /dev/sdb: 64.4 GB, 64440238080 bytes 255 Köpfe, 63 Sektoren/Spur, 7834 Zylinder, zusammen 125859840 Sektoren Einheiten = Sektoren von 1 × 512 = 512 Bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Festplattenidentifikation: 0x00000000 Gerät boot. Anfang Ende Blöcke Id System /dev/sdb1 8192 125859839 62925824 7 HPFS/NTFS/exFAT
Achtung: Je nach installierten Laufwerken kann die Bezeichung der SD Card abweichen. Die folgenden Schritte können Daten des Systems zerstören.
Leeren der Karte
Dies machen wir um a) vorher evtl noch vorhandene alte Daten sicher zu löschen und b) um bei zukünftigen komprimierten Images Speicherplatz zu sparen
root@acca:/tmp# dd if=/dev/zero of=/dev/sdb bs=4M &
Das dauert jetzt etwas, man kann schauen wie weit es grade ist mit:
root@acca:/tmp# kill -USR1 %1 root@acca:/tmp# 309+0 Datensätze ein 309+0 Datensätze aus 1296039936 Bytes (1,3 GB) kopiert, 65,6308 s, 19,7 MB/s
Kopieren des Images auf die Karte:
root@acca:/tmp# dd if=2013-09-25-wheezy-raspbian.img of=/dev/sdb bs=4M &
Nachschauen, welche Partitionen das Original Image verwendet:
root@acca:/tmp# fdisk -l /dev/sdb Disk /dev/sdb: 64.4 GB, 64440238080 bytes 64 Köpfe, 32 Sektoren/Spur, 61455 Zylinder, zusammen 125859840 Sektoren Einheiten = Sektoren von 1 × 512 = 512 Bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Festplattenidentifikation: 0x0002c262 Gerät boot. Anfang Ende Blöcke Id System /dev/sdb1 8192 122879 57344 c W95 FAT32 (LBA) /dev/sdb2 122880 5785599 2831360 83 Linux
Oder mit parted:
root@acca:/tmp# parted /dev/sdb print Modell: Multiple Card Reader (scsi) Festplatte /dev/sdb: 64,4GB Sektorgröße (logisch/physisch): 512B/512B Partitionstabelle: msdos Nummer Anfang Ende Größe Typ Dateisystem Flags 1 4194kB 62,9MB 58,7MB primary fat16 LBA 2 62,9MB 2962MB 2899MB primary ext4
Jetzt kann man schauen, wieviel auf der Systempartition noch frei ist und was alles installiert ist, um zu entscheiden, welche weitere Partitionen wir noch anlegen:
root@acca:/tmp# mount /dev/sdb2 /mnt mount: Gerätedatei /dev/sdb2 existiert nicht root@acca:/tmp#
Hmm, der Kernel hat das Verändern des device nicht mitbekommen, am einfachsten lösen wir das durch Ein/Ausstecken der Karte, und dann:
root@acca:/tmp# mount /dev/sdb2 /mnt root@acca:/tmp# df /mnt Dateisystem 1K-Blöcke Benutzt Verfügbar Verw% Eingehängt auf /dev/sdb2 2721336 1600924 962460 63% /mnt
Eine übersichtliche Liste der installierten Pakete bekommt man mit:
root@acca:/tmp# dpkg -l --admindir=/mnt/var/lib/dpkg |egrep -v '^ii lib\w+' |egrep -v '^ii python.?-\w+'
Gewünscht=Unbekannt/Installieren/R=Entfernen/P=Vollständig Löschen/Halten
| Status=Nicht/Installiert/Config/U=Entpackt/halb konFiguriert/
Halb installiert/Trigger erWartet/Trigger anhängig
|/ Fehler?=(kein)/R=Neuinstallation notwendig (Status, Fehler: GROSS=schlecht)
||/ Name Version Architektur Beschreibung
+++-=========================-==========================-========-===================================================
ii adduser 3.113+nmu3 all add and remove users and groups
ii alsa-base 1.0.25+3~deb7u1 all ALSA driver configuration files
ii alsa-utils 1.0.25-4 armhf Utilities for configuring and using ALSA
ii apt 0.9.7.8+rpi1 armhf commandline package manager
ii apt-utils 0.9.7.8+rpi1 armhf package managment related utility programs
ii aptitude 0.6.8.2-1 armhf terminal-based package manager
ii aptitude-common 0.6.8.2-1 all architecture indepedent files for the aptitude package manager
ii aspell 0.60.7~20110707-1 armhf GNU Aspell spell-checker
ii aspell-en 7.1-0-1 all English dictionary for GNU Aspell
ii base-files 7.1wheezy1+rpi1 armhf Debian base system miscellaneous files
ii base-passwd 3.5.26 armhf Debian base system master password and group files
ii bash 4.2+dfsg-0.1 armhf GNU Bourne Again SHell
ii bash-completion 1:2.0-1 all programmable completion for the bash shell
ii binutils 2.22-8 armhf GNU assembler, linker and binary utilities
ii blt 2.4z-4.2 armhf the BLT extension library for Tcl/Tk - run-time package
ii bsdmainutils 9.0.3 armhf collection of more utilities from FreeBSD
ii bsdutils 1:2.20.1-5.3 armhf Basic utilities from 4.4BSD-Lite
ii build-essential 11.5+b1 armhf Informational list of build-essential packages
ii bzip2 1.0.6-4 armhf high-quality block-sorting file compressor - utilities
ii ca-certificates 20130119 all Common CA certificates
ii cifs-utils 2:5.5-1 armhf Common Internet File System utilities
ii console-setup 1.88 all console font and keymap setup program
ii console-setup-linux 1.88 all Linux specific part of console-setup
ii consolekit 0.4.5-3.1 armhf framework for defining and tracking users, sessions and seats
ii coreutils 8.13-3.5 armhf GNU core utilities
ii cpio 2.11+dfsg-0.1 armhf GNU cpio -- a program to manage archives of files
ii cpp 4:4.6.3-8 armhf GNU C preprocessor (cpp)
ii cpp-4.6 4.6.3-14+rpi1 armhf GNU C preprocessor
ii cron 3.0pl1-124 armhf process scheduling daemon
ii cups-bsd 1.5.3-5 armhf Common UNIX Printing System(tm) - BSD commands
ii cups-client 1.5.3-5 armhf Common UNIX Printing System(tm) - client programs (SysV)
ii cups-common 1.5.3-5 all Common UNIX Printing System(tm) - common files
ii curl 7.26.0-1+wheezy3 armhf command line tool for transferring data with URL syntax
ii dash 0.5.7-3 armhf POSIX-compliant shell
ii dbus 1.6.8-1+deb7u1 armhf simple interprocess messaging system (daemon and utilities)
ii dbus-x11 1.6.8-1+deb7u1 armhf simple interprocess messaging system (X11 deps)
ii dconf-gsettings-backend:armhf 0.12.1-3 armhf simple configuration storage system - GSettings back-end
ii dconf-service 0.12.1-3 armhf simple configuration storage system - D-Bus service
ii debconf 1.5.49 all Debian configuration management system
ii debconf-i18n 1.5.49 all full internationalization support for debconf
ii debconf-utils 1.5.49 all debconf utilities
ii debian-reference-common 2.50 all Debian system administration guide, common files
ii debian-reference-en 2.50 all Debian system administration guide, English original
ii debianutils 4.3.2 armhf Miscellaneous utilities specific to Debian
ii desktop-base 7.0.3 all common files for the Debian Desktop
ii desktop-file-utils 0.20-0.1 armhf Utilities for .desktop files
ii dictionaries-common 1.12.11 all Common utilities for spelling dictionary tools
ii diffutils 1:3.2-6 armhf File comparison utilities
ii dillo 3.0.2-2 armhf Small and fast web browser
ii dmsetup 2:1.02.74-7+rpi1 armhf Linux Kernel Device Mapper userspace library
ii dphys-swapfile 20061020-4raspi.1 all Autogenerate and use a swap file
ii dpkg 1.16.10 armhf Debian package management system
ii dpkg-dev 1.16.10 all Debian package development tools
ii e2fslibs:armhf 1.42.5-1.1 armhf ext2/ext3/ext4 file system libraries
ii e2fsprogs 1.42.5-1.1 armhf ext2/ext3/ext4 file system utilities
ii ed 1.6-2 armhf classic UNIX line editor
ii fake-hwclock 0.5 all Save/restore system clock on machines without working RTC hardware
ii fakeroot 1.18.4-2 armhf tool for simulating superuser privileges
ii fbset 2.1-25 armhf framebuffer device maintenance program
ii file 5.11-2 armhf Determines file type using "magic" numbers
ii findutils 4.4.2-4 armhf utilities for finding files--find, xargs
ii firmware-atheros 0.36+wheezy.1 all Binary firmware for Atheros wireless cards
ii firmware-brcm80211 0.36+wheezy.1 all Binary firmware for Broadcom 802.11 wireless cards
ii firmware-libertas 0.36+wheezy.1 all Binary firmware for Marvell Libertas 8xxx wireless cards
ii firmware-ralink 0.36+wheezy.1 all Binary firmware for Ralink wireless cards
ii firmware-realtek 0.36+wheezy.1 all Binary firmware for Realtek wired and wireless network adapters
ii fontconfig 2.9.0-7.1 armhf generic font configuration library - support binaries
ii fontconfig-config 2.9.0-7.1 all generic font configuration library - configuration
ii fonts-droid 20111207+git-1 all handheld device font with extensive style and language support
ii fonts-freefont-ttf 20120503-1 all Freefont Serif, Sans and Mono Truetype fonts
ii fuse 2.9.0-2+deb7u1 armhf Filesystem in Userspace
ii g++ 4:4.6.3-8 armhf GNU C++ compiler
ii g++-4.6 4.6.3-14+rpi1 armhf GNU C++ compiler
ii galculator 1.3.4-1 armhf A GTK+ 2.0 based calculator
ii gcc 4:4.6.3-8 armhf GNU C compiler
ii gcc-4.5-base:armhf 4.5.3-12+rpi1 armhf The GNU Compiler Collection (base package)
ii gcc-4.6 4.6.3-14+rpi1 armhf GNU C compiler
ii gcc-4.6-base:armhf 4.6.3-14+rpi1 armhf GCC, the GNU Compiler Collection (base package)
ii gcc-4.7-base:armhf 4.7.2-5+rpi1 armhf GCC, the GNU Compiler Collection (base package)
ii gconf-service 3.2.5-1+build1 armhf GNOME configuration database system (D-Bus service)
ii gconf2 3.2.5-1+build1 armhf GNOME configuration database system (support tools)
ii gconf2-common 3.2.5-1+build1 all GNOME configuration database system (common files)
ii gdb 7.4.1+dfsg-0.1 armhf The GNU Debugger
ii gdbserver 7.4.1+dfsg-0.1 armhf The GNU Debugger (remote server)
ii gettext-base 0.18.1.1-9 armhf GNU Internationalization utilities for the base system
ii ghostscript 9.05~dfsg-6.3 armhf interpreter for the PostScript language and for PDF
ii gir1.2-glib-2.0 1.32.1-1 armhf Introspection data for GLib, GObject, Gio and GModule
ii git 1:1.7.10.4-1+wheezy1+rpi2 armhf fast, scalable, distributed revision control system
ii git-core 1:1.7.10.4-1+wheezy1+rpi2 all fast, scalable, distributed revision control system (obsolete)
ii git-man 1:1.7.10.4-1+wheezy1+rpi2 all fast, scalable, distributed revision control system (manual pages)
ii gksu 2.0.2-6 armhf graphical frontend to su
ii glib-networking:armhf 2.32.3-1 armhf network-related giomodules for GLib
ii glib-networking-common 2.32.3-1 all network-related giomodules for GLib - data files
ii glib-networking-services 2.32.3-1 armhf network-related giomodules for GLib - D-Bus services
ii gnome-accessibility-themes 3.4.2-2.1 all Accessibility themes for the GNOME desktop
ii gnome-icon-theme 3.4.0-2 all GNOME Desktop icon theme
ii gnome-themes-standard 3.4.2-2.1 armhf Standard GNOME themes
ii gnome-themes-standard-data 3.4.2-2.1 all Data files for GNOME standard themes
ii gnupg 1.4.12-7+deb7u1 armhf GNU privacy guard - a free PGP replacement
ii gpgv 1.4.12-7+deb7u1 armhf GNU privacy guard - signature verification tool
ii gpicview 0.2.3-2 armhf lightweight image viewer
ii grep 2.12-2 armhf GNU grep, egrep and fgrep
ii groff-base 1.21-9 armhf GNU troff text-formatting system (base system components)
ii gsettings-desktop-schemas 3.4.2-3 all GSettings deskop-wide schemas
ii gsfonts 1:8.11+urwcyr1.0.7~pre44-4.2 all Fonts for the Ghostscript interpreter(s)
ii gsfonts-x11 0.22 all Make Ghostscript fonts available to X11
ii gtk2-engines:armhf 1:2.20.2-2 armhf theme engines for GTK+ 2.x
ii gvfs:armhf 1.12.3-4 armhf userspace virtual filesystem - GIO module
ii gvfs-backends 1.12.3-4 armhf userspace virtual filesystem - backends
ii gvfs-common 1.12.3-4 all userspace virtual filesystem - common data files
ii gvfs-daemons 1.12.3-4 armhf userspace virtual filesystem - servers
ii gvfs-fuse 1.12.3-4 armhf userspace virtual filesystem - fuse server
ii gvfs-libs:armhf 1.12.3-4 armhf userspace virtual filesystem - private libraries
ii gzip 1.5-1.1 armhf GNU compression utilities
ii hardlink 0.2.0 armhf Hardlinks multiple copies of the same file
ii hicolor-icon-theme 0.12-1 all default fallback theme for FreeDesktop.org icon themes
ii hostname 3.11 armhf utility to set/show the host name or domain name
ii idle 2.7.3-4 all IDE for Python using Tkinter (default version)
ii idle-python2.7 2.7.3-6 all IDE for Python (v2.7) using Tkinter
ii idle-python3.2 3.2.3-7 all IDE for Python (v3.2) using Tkinter
ii idle3 3.2.3-6 all IDE for Python using Tkinter (default version)
ii ifplugd 0.28-19 armhf configuration daemon for ethernet devices
ii ifupdown 0.7.8 armhf high level tools to configure network interfaces
ii info 4.13a.dfsg.1-10 armhf Standalone GNU Info documentation browser
ii initramfs-tools 0.109.1 all generic modular initramfs generator
ii initscripts 2.88dsf-41 armhf scripts for initializing and shutting down the system
ii insserv 1.14.0-5 armhf boot sequence organizer using LSB init.d script dependency information
ii install-info 4.13a.dfsg.1-10 armhf Manage installed documentation in info format
ii iproute 20120521-3 armhf networking and traffic control tools
ii iptables 1.4.14-3.1 armhf administration tools for packet filtering and NAT
ii iputils-ping 3:20101006-1 armhf Tools to test the reachability of network hosts
ii isc-dhcp-client 4.2.2.dfsg.1-5+deb70u6 armhf ISC DHCP client
ii isc-dhcp-common 4.2.2.dfsg.1-5+deb70u6 armhf common files used by all the isc-dhcp* packages
ii iso-codes 3.41-1 all ISO language, territory, currency, script codes and their translations
ii jackd 5 all JACK Audio Connection Kit (default server package)
ii jackd2 1.9.8~dfsg.4+20120529git007cdc37-5+rpi armhf JACK Audio Connection Kit (server and example clients)
ii java-common 0.47 all Base of all Java packages
ii kbd 1.15.3-9 armhf Linux console font and keytable utilities
ii keyboard-configuration 1.88 all system-wide keyboard preferences
ii klibc-utils 2.0.1-3.1+rpi1 armhf small utilities built with klibc for early boot
ii kmod 9-3 armhf tools for managing Linux kernel modules
ii krb5-locales 1.10.1+dfsg-5+deb7u1 all Internationalization support for MIT Kerberos
ii leafpad 0.8.18.1-3 armhf GTK+ based simple text editor
ii less 444-4 armhf pager program similar to more
ii lesstif2:armhf 1:0.95.2-1.1 armhf OSF/Motif 2.1 implementation released under LGPL
ii lightdm 1.2.2-4 armhf simple display manager
ii lightdm-gtk-greeter 1.1.6-2 armhf simple display manager (GTK+ greeter)
ii linux-libc-dev:armhf 3.2.46-1+rpi1 armhf Linux support headers for userspace development
ii locales 2.13-38+rpi2 all Embedded GNU C Library: National Language (locale) data [support]
ii login 1:4.1.5.1-1 armhf system login tools
ii logrotate 3.8.1-4 armhf Log rotation utility
ii lsb-base 4.1+Debian8+rpi1 all Linux Standard Base 4.1 init script functionality
ii lua5.1 5.1.5-4 armhf Simple, extensible, embeddable programming language
ii luajit 2.0.0~beta11+git20121024-1 armhf Just in time compiler for Lua programming language version 5.1
ii lxappearance 0.5.2-1+b1 armhf LXDE GTK+ theme switcher
ii lxde 4+nmu1 all LXDE metapackage
ii lxde-common 0.5.5-6 all LXDE configuration data
ii lxde-core 4+nmu1 all LXDE core metapackage
ii lxde-icon-theme 0.5.0-1 all LXDE standard icon theme
ii lxinput 0.3.2-1 armhf LXDE keyboard and mouse configuration
ii lxmenu-data 0.1.2-2 all LXDE freedesktop.org menu specification
ii lxpanel 0.5.10-1 armhf LXDE panel
ii lxpolkit 0.1.0-4 armhf LXDE PolicyKit authentication agent
ii lxrandr 0.1.2-3 armhf LXDE monitor configuration tool
ii lxsession 0.4.6.1-4 armhf LXDE default session manager
ii lxsession-edit 0.2.0-3 armhf LXDE application session editor
ii lxshortcut 0.1.2-3 armhf LXDE application shortcut editor
ii lxtask 0.1.4-3+rpi1 armhf LXDE task manager
ii lxterminal 0.1.11-4 armhf LXDE terminal emulator
ii make 3.81-8.2 armhf An utility for Directing compilation.
ii makedev 2.3.1-92 all creates device files in /dev
ii man-db 2.6.2-1 armhf on-line manual pager
ii manpages 3.44-1 all Manual pages about using a GNU/Linux system
ii manpages-dev 3.44-1 all Manual pages about using GNU/Linux for development
ii mawk 1.3.3-17 armhf a pattern scanning and text processing language
ii menu 2.1.46 armhf generates programs menu for all menu-aware applications
ii menu-xdg 0.5 all freedesktop.org menu compliant window manager scripts
ii midori 0.4.3+dfsg-0.1 armhf fast, lightweight graphical web browser
ii mime-support 3.52-1 all MIME files 'mime.types' & 'mailcap', and support programs
ii module-init-tools 9-3 all transitional dummy package (module-init-tools to kmod)
ii mount 2.20.1-5.3 armhf Tools for mounting and manipulating filesystems
ii mountall 2.46 armhf filesystem mounting tool
ii multiarch-support 2.13-38+rpi2 armhf Transitional package to ensure multiarch compatibility
ii nano 2.2.6-1 armhf small, friendly text editor inspired by Pico
ii ncdu 1.8-1 armhf ncurses disk usage viewer
ii ncurses-base 5.9-10 all basic terminal type definitions
ii ncurses-bin 5.9-10 armhf terminal-related programs and man pages
ii ncurses-term 5.9-10 all additional terminal type definitions
ii net-tools 1.60-24.2 armhf The NET-3 networking toolkit
ii netbase 5.0 all Basic TCP/IP networking system
ii netcat-openbsd 1.105-7 armhf TCP/IP swiss army knife
ii netcat-traditional 1.10-40 armhf TCP/IP swiss army knife
ii netsurf-common 2.9-2 all Small web browser with CSS support common files
ii netsurf-gtk 2.9-2 armhf Small web browser with CSS support for GTK
ii nfs-common 1:1.2.6-4 armhf NFS support files common to client and server
ii ntp 1:4.2.6.p5+dfsg-2 armhf Network Time Protocol daemon and utility programs
ii obconf 1:2.0.3+20110805+debian-1 armhf preferences manager for Openbox window manager
ii omxplayer 0.2.6~git20130427~fcfb7911 armhf Command line media player for Raspberry Pi
ii openbox 3.5.0-7 armhf standards compliant, fast, light-weight, extensible window manager
ii openssh-blacklist 0.4.1+nmu1 all list of default blacklisted OpenSSH RSA and DSA keys
ii openssh-blacklist-extra 0.4.1+nmu1 all list of non-default blacklisted OpenSSH RSA and DSA keys
ii openssh-client 1:6.0p1-4 armhf secure shell (SSH) client, for secure access to remote machines
ii openssh-server 1:6.0p1-4 armhf secure shell (SSH) server, for secure access from remote machines
ii openssl 1.0.1e-2+rpi1 armhf Secure Socket Layer (SSL) binary and related cryptographic tools
ii oracle-java7-jdk 1.7.0+update40 armhf Java™ Platform, Standard Edition 7 Development Kit
ii parted 2.3-12 armhf disk partition manipulator
ii passwd 1:4.1.5.1-1 armhf change and administer password and group data
ii patch 2.6.1-3 armhf Apply a diff file to an original
ii pciutils 1:3.1.9-6 armhf Linux PCI Utilities
ii pcmanfm 0.9.10-3 armhf extremely fast and lightweight file manager
ii penguinspuzzle 20120902-1 armhf 3d puzzle game for Raspberry Pi (web version at penguinspuzzle.appspot.com)
ii perl 5.14.2-21+rpi2 armhf Larry Wall's Practical Extraction and Report Language
ii perl-base 5.14.2-21+rpi2 armhf minimal Perl system
ii perl-modules 5.14.2-21+rpi2 all Core Perl modules
ii pistore 1.1.16693 armhf Pi Store is the official store for Rasp. Pi apps and games.
ii pkg-config 0.26-1 armhf manage compile and link flags for libraries
ii plymouth 0.8.5.1-5 armhf Graphical Boot Animation and Logger
ii policykit-1 0.105-3 armhf framework for managing administrative policies and privileges
ii poppler-data 0.4.5-10 all encoding data for the poppler PDF rendering library
ii poppler-utils 0.18.4-6 armhf PDF utilities (based on Poppler)
ii procps 1:3.3.3-3 armhf /proc file system utilities
ii psmisc 22.19-1+deb7u1 armhf utilities that use the proc file system
ii pypy-upstream 2.1-1 armhf PyPy interpreter - Upstream binary build
ii python 2.7.3-4 all interactive high-level object-oriented language (default version)
ii python2.7 2.7.3-6 armhf Interactive high-level object-oriented language (version 2.7)
ii python2.7-minimal 2.7.3-6 armhf Minimal subset of the Python language (version 2.7)
ii python3 3.2.3-6 all interactive high-level object-oriented language (default python3 version)
ii python3.2 3.2.3-7 armhf Interactive high-level object-oriented language (version 3.2)
ii python3.2-minimal 3.2.3-7 armhf Minimal subset of the Python language (version 3.2)
ii qdbus 4:4.8.2+dfsg-11+rpi1 armhf Qt 4 D-Bus tool
ii qjackctl 0.3.9-2 armhf User interface for controlling the JACK sound server
ii raspberrypi-artwork 20120715 all Copy of the Raspberry Pi logo
ii raspberrypi-bootloader 1.20130902-1 armhf Raspberry Pi bootloader
ii raspbian-archive-keyring 20120528.2 all GnuPG archive keys of the raspbian archive
ii raspi-config 20130925-1 all Simple configuration for Raspberry Pi
ii raspi-copies-and-fills 0.4-1 armhf Optimised memcpy/memset implementation for ARM11 used in Raspberry Pi
ii readline-common 6.2+dfsg-0.1 all GNU readline and history libraries, common files
ii rpcbind 0.2.0-8 armhf converts RPC program numbers into universal addresses
ii rpi-update 20130510 all Raspberry Pi firmware updating tool
ii rsync 3.0.9-4 armhf fast, versatile, remote (and local) file-copying tool
ii rsyslog 5.8.11-3 armhf reliable system and kernel logging daemon
ii ruby1.9.1 1.9.3.194-8.1+deb7u1 armhf Interpreter of object-oriented scripting language Ruby
ii samba-common 2:3.6.6-6 all common files used by both the Samba server and client
ii scratch 1.4.20130916-1 all easy to use programming environment for ages 8 and up - data
ii sed 4.2.1-10 armhf The GNU sed stream editor
ii sensible-utils 0.0.7 all Utilities for sensible alternative selection
ii sgml-base 1.26+nmu4 all SGML infrastructure and SGML catalog file support
ii shared-mime-info 1.0-1 armhf FreeDesktop.org shared MIME database and spec
ii smartsim 1.2.1-4 armhf Digital logic circuit design and simulation package.
ii smbclient 2:3.6.6-6 armhf command-line SMB/CIFS clients for Unix
ii sonic-pi 1.0 armhf Sonic Pi is a music programming environment aimed at new programmers.
ii squeak-plugins-scratch 1.4.0.2~svn.r83-1 armhf Squeak plugins for the Scratch programming environment
ii squeak-vm 1:4.10.2.2774-1 armhf The Squeak Smalltalk System (virtual machine)
ii ssh 1:6.0p1-4 all secure shell client and server (metapackage)
ii strace 4.5.20-2.3 armhf A system call tracer
ii sudo 1.8.5p2-1+nmu1 armhf Provide limited super user privileges to specific users
ii supercollider 1:3.4.5-1wheezy1 armhf real time audio synthesis programming language
ii supercollider-common 1:3.4.5-1wheezy1 all common files for SuperCollider
ii supercollider-server 1:3.4.5-1wheezy1 armhf real time audio synthesis server
ii sysv-rc 2.88dsf-41 all System-V-like runlevel change mechanism
ii sysvinit 2.88dsf-41 armhf System-V-like init utilities
ii sysvinit-utils 2.88dsf-41 armhf System-V-like utilities
ii tar 1.26+dfsg-0.1 armhf GNU version of the tar archiving utility
ii tasksel 3.14.1 all Tool for selecting tasks for installation on Debian systems
ii tasksel-data 3.14.1 all Official tasks used for installation of Debian systems
ii tcl8.5 8.5.11-2 armhf Tcl (the Tool Command Language) v8.5 - run-time files
ii tcpd 7.6.q-24 armhf Wietse Venema's TCP wrapper utilities
ii tk8.5 8.5.11-2 armhf Tk toolkit for Tcl and X11, v8.5 - run-time files
ii traceroute 1:2.0.18-3 armhf Traces the route taken by packets over an IPv4/IPv6 network
ii triggerhappy 0.3.4-2 armhf global hotkey daemon for Linux
ii tsconf 1.0-11 all touch screen library common files
ii ttf-dejavu-core 2.33-3 all Vera font family derivate with additional characters
ii tzdata 2013c-0wheezy1 all time zone and daylight-saving time data
ii ucf 3.0025+nmu3 all Update Configuration File: preserve user changes to config files.
ii udev 175-7.2 armhf /dev/ and hotplug management daemon
ii udisks 1.0.4-7 armhf storage media interface
ii unzip 6.0-8 armhf De-archiver for .zip files
ii update-inetd 4.43 all inetd configuration file updater
ii usbmuxd 1.0.7-2 armhf USB multiplexor daemon for iPhone and iPod Touch devices
ii usbutils 1:005-3 armhf Linux USB utilities
ii util-linux 2.20.1-5.3 armhf Miscellaneous system utilities
ii vim-common 2:7.3.547-7 armhf Vi IMproved - Common files
ii vim-tiny 2:7.3.547-7 armhf Vi IMproved - enhanced vi editor - compact version
ii weston 1.1.0-0rpi2013060501 armhf reference implementation of a Wayland compositor
ii wget 1.13.4-3 armhf retrieves files from the web
ii whiptail 0.52.14-11.1 armhf Displays user-friendly dialog boxes from shell scripts
ii wireless-tools 30~pre9-8 armhf Tools for manipulating Linux Wireless Extensions
ii wpagui 1.0-3 armhf graphical user interface for wpa_supplicant
ii wpasupplicant 1.0-3 armhf client support for WPA and WPA2 (IEEE 802.11i)
ii x11-common 1:7.7+3~deb7u1 all X Window System (X.Org) infrastructure
ii x11-utils 7.7~1 armhf X11 utilities
ii x11-xkb-utils 7.7~1 armhf X11 XKB utilities
ii x11-xserver-utils 7.7~3 armhf X server utilities
ii xarchiver 1:0.5.2+20090319+dfsg-4.1 armhf GTK+ frontend for most used compression formats
ii xauth 1:1.0.7-1 armhf X authentication utility
ii xdg-utils 1.1.0~rc1+git20111210-6 all desktop integration utilities from freedesktop.org
ii xfonts-encodings 1:1.0.4-1 all Encodings for X.Org fonts
ii xfonts-utils 1:7.7~1 armhf X Window System font utility programs
ii xinit 1.3.2-1 armhf X server initialisation tool
ii xkb-data 2.5.1-3 all X Keyboard Extension (XKB) configuration data
ii xml-core 0.13+nmu2 all XML infrastructure and XML catalog file support
ii xpdf 3.03-10 armhf Portable Document Format (PDF) reader
ii xserver-common 2:1.12.4-6 all common files used by various X servers
ii xserver-xorg 1:7.7+3~deb7u1 armhf X.Org X server
ii xserver-xorg-core 2:1.12.4-6 armhf Xorg X server - core server
ii xserver-xorg-input-all 1:7.7+3~deb7u1 armhf X.Org X server -- input driver metapackage
ii xserver-xorg-input-evdev 1:2.7.0-1+b2 armhf X.Org X server -- evdev input driver
ii xserver-xorg-input-synaptics 1.6.2-2 armhf Synaptics TouchPad driver for X.Org server
ii xserver-xorg-video-fbdev 1:0.4.2-4+b2 armhf X.Org X server -- fbdev display driver
ii xz-utils 5.1.1alpha+20120614-2 armhf XZ-format compression utilities
ii zenity 3.4.0-2 armhf Display graphical dialog boxes from shell scripts
ii zenity-common 3.4.0-2 all Display graphical dialog boxes from shell scripts (common files)
ii zlib1g:armhf 1:1.2.7.dfsg-13 armhf compression library - runtime
ii zlib1g-dev:armhf 1:1.2.7.dfsg-13 armhf compression library - development
Wir stellen fest, es ist noch kein Apache, PHP, Nginx, Postfix/Exim/Dovecot, oder eine Entwicklungsumgebung (build-essential) installiert. Für einen Server sollte man /var und /tmp und evtl /home in extra Partitionen auslagern, um das System resistent gegen Überlaufen von Plattenplatz zu machen. Schauen wir mal, wieviel /var derzeit die Partition belastet:
root@acca:/tmp# du -s /mnt/var 109920 /mnt/var
Das Auslagern von /var bringt uns zusammen mit dem bereits freien Speicher noch nicht genügend Luft, wir sollten die Partition vergrössern.
Zuerst lösen wir den mount, vergewissern uns über den derzeitigen Stand, Vergrössern die Partition, Prüfen und lassen das ext4 Filesystem entsprechend anwachsen:
root@acca:/tmp# umount /mnt root@acca:/tmp# parted /dev/sdb print Modell: Multiple Card Reader (scsi) Festplatte /dev/sdb: 64,4GB Sektorgröße (logisch/physisch): 512B/512B Partitionstabelle: msdos Nummer Anfang Ende Größe Typ Dateisystem Flags 1 4194kB 62,9MB 58,7MB primary fat16 LBA 2 62,9MB 2962MB 2899MB primary ext4 root@acca:/tmp# parted /dev/sdb resizepart 2 4000MB Informationen: Möglicherweise müssen Sie /etc/fstab anpassen. root@acca:/tmp# parted /dev/sdb print Modell: Multiple Card Reader (scsi) Festplatte /dev/sdb: 64,4GB Sektorgröße (logisch/physisch): 512B/512B Partitionstabelle: msdos Nummer Anfang Ende Größe Typ Dateisystem Flags 1 4194kB 62,9MB 58,7MB primary fat16 LBA 2 62,9MB 4000MB 3937MB primary ext4 root@acca:/tmp# resize2fs /dev/sdb2 resize2fs 1.42.8 (20-Jun-2013) Bitte zuerst „e2fsck -f /dev/sdb2“ laufen lassen. root@acca:/tmp# e2fsck -f /dev/sdb2 e2fsck 1.42.8 (20-Jun-2013) Durchgang 1: Prüfe Inodes, Blocks und Größen Durchgang 2: Prüfe die Verzeichnisstruktur Durchgang 3: Prüfe Verzeichnis-Verknüpfungen Durchgang 4: Überprüfe die Referenzzähler Durchgang 5: Überprüfe die zusammengefasste Gruppeninformation /dev/sdb2: 72857/177056 Dateien (0.1% nicht zusammenhängend), 427737/707840 Blöcke root@acca:/tmp# resize2fs /dev/sdb2 resize2fs 1.42.8 (20-Jun-2013) Die Grösse des Dateisystems auf /dev/sdb2 wird auf 961202 (4k) Blöcke geändert. Das Dateisystem auf /dev/sdb2 ist nun 961202 Blöcke groß.
Wir testen durch einen mount:
root@acca:/tmp# mount /dev/sdb2 /mnt root@acca:/tmp# df /mnt Dateisystem 1K-Blöcke Benutzt Verfügbar Verw% Eingehängt auf /dev/sdb2 3718608 1602300 1907684 46% /mnt
So, jetzt ist es an der Zeit, den Raspberry Pi zum Leben zu erwecken und mit der vorbereiteten SD Karte zu booten.
root@acca:/tmp# umount /mnt
Erstes Starten des Raspberry Pi
Diese Schritte erfordern den Anschluss des Raspberry Pi an einen HDMI Monitor, USB Tastatur sowie Ethernet. Am besten man hat einen DHCP Server im Heimnetz, dann holt sich der Pi bequem die IP Adresse und konfiguriert sein Netzwerk selbst (später ersetzen wir die Netzwerkkonfiguration).
- Karte und alles einstecken, das Netzteil zuletzt, damit man den ersten Boot nicht verpasst
- nachdem die Bootmeldungen durch sind, sollte das Konfigurationsprogramm (raspi-config) automatisch starten
- wir verlassen das Menü erstmal mit zwei Mal <TAB> <Return>
- jetzt sehen wir einen Prompt auf der Textconsole, der user heisst "pi"
Um nicht immer den Monitor umschalten zu müssen und mit mehreren Tastaturen zu arbeiten ermöglichen wir jetzt den root remote login:
- der ssh Server ist bereits installiert und aktiviert
- Herausfinden der IP Adresse mit "ifconfig"
- Ändern des root Passworts mit "sudo passwd"
Folgende Schritte führen wir weiter in einem Terminal unseres Linux Desktops aus.
Einloggen auf dem Raspberry Pi unter Verwendung der ermittelten IP Adresse:
ssh root@192.168.1.70 The authenticity of host '192.168.1.70 (192.168.1.70)' can't be established. ECDSA key fingerprint is 4d:39:54:5d:17:72:7b:87:90:e1:a9:bc:ca:7a:1b:0c. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.1.70' (ECDSA) to the list of known hosts. root@192.168.1.70's password: Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Wed Sep 25 22:07:25 2013 /usr/bin/xauth: file /root/.Xauthority does not exist root@raspberrypi:~#
Schauen wir uns ein bisschen um:
uname -a
Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux
root@raspberrypi:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 3784144 1770452 1821452 50% /
/dev/root 3784144 1770452 1821452 50% /
devtmpfs 86160 0 86160 0% /dev
tmpfs 18884 244 18640 2% /run
tmpfs 5120 0 5120 0% /run/lock
tmpfs 37760 0 37760 0% /run/shm
/dev/mmcblk0p1 57288 18560 38728 33% /boot
root@raspberrypi:~# mount
/dev/root on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=86160k,nr_inodes=21540,mode=755)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=18884k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=37760k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=ascii,shortname=mixed,errors=remount-ro)
root@raspberrypi:~# free
total used free shared buffers cached
Mem: 188840 135432 53408 0 9768 100848
-/+ buffers/cache: 24816 164024
Swap: 102396 0 102396
root@raspberrypi:~# find /etc/apt/sources.list*
/etc/apt/sources.list
/etc/apt/sources.list.d
/etc/apt/sources.list.d/collabora.list
/etc/apt/sources.list.d/raspi.list
Erstes Paket Update
apt-get update apt-get -y dist-upgrade apt-get clean
Jetzt ist der richtige Moment an den Kühlschrank zu gehen ;-)
Weitere Pakete installieren
Zur Vorbereitung der endgültigen Systems installieren wir weitere Pakete
apt-get install lvm2 apt-get clean
Optimale Konfiguration
Für den Serverbetrieb konfigurieren wir den Boot Flash mit "raspi-config"
- "4 Internationalisation Options", "I1 Change Locale", Sternchen bei "en_GB.UTF-8 UTF-8" weg und bei "de_DE.UTF-8 UTF-8" dran, Default locale "de_DE.UTF-8"
- "4 Internationalisation Options", "I2 Change Timezone", "Europe", "Berlin"
- "8 Advanced Options", "A3 Memory Split", "16"
- "Finish", "No Reboot"
Ausschalten
poweroff
Endgültige Partitionen erstellen
Zu diesem Zweck entnehmen wir dem runtergefahrenen Pi die SD Karte und stecken sie wieder in unseren Desktop PC. Wir erstellen eine weitere primäre Partition, die später als LVM physical volume dient.
root@acca:/tmp# fdisk /dev/sdb
Befehl (m für Hilfe): p
Disk /dev/sdb: 64.4 GB, 64440238080 bytes
64 Köpfe, 32 Sektoren/Spur, 61455 Zylinder, zusammen 125859840 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Festplattenidentifikation: 0x0002c262
Gerät boot. Anfang Ende Blöcke Id System
/dev/sdb1 8192 122879 57344 c W95 FAT32 (LBA)
/dev/sdb2 122880 7812500 3844810+ 83 Linux
Befehl (m für Hilfe): n
Partition type:
p primary (2 primary, 0 extended, 2 free)
e extended
Select (default p): p
Partitionsnummer (1-4, Vorgabe: 3):
Benutze den Standardwert 3
Erster Sektor (2048-125859839, Vorgabe: 2048): 7812501
Last Sektor, +Sektoren or +size{K,M,G} (7812501-125859839, Vorgabe: 125859839):
Benutze den Standardwert 125859839
Befehl (m für Hilfe): p
Disk /dev/sdb: 64.4 GB, 64440238080 bytes
64 Köpfe, 32 Sektoren/Spur, 61455 Zylinder, zusammen 125859840 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Festplattenidentifikation: 0x0002c262
Gerät boot. Anfang Ende Blöcke Id System
/dev/sdb1 8192 122879 57344 c W95 FAT32 (LBA)
/dev/sdb2 122880 7812500 3844810+ 83 Linux
/dev/sdb3 7812501 125859839 59023669+ 83 Linux
Befehl (m für Hilfe): t
Partitionsnummer (1-4): 3
Hex code (L um eine Liste anzuzeigen): 8e
Der Dateisystemtyp der Partition 3 ist nun 8e (Linux LVM)
Befehl (m für Hilfe): p
Disk /dev/sdb: 64.4 GB, 64440238080 bytes
64 Köpfe, 32 Sektoren/Spur, 61455 Zylinder, zusammen 125859840 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Festplattenidentifikation: 0x0002c262
Gerät boot. Anfang Ende Blöcke Id System
/dev/sdb1 8192 122879 57344 c W95 FAT32 (LBA)
/dev/sdb2 122880 7812500 3844810+ 83 Linux
/dev/sdb3 7812501 125859839 59023669+ 8e Linux LVM
Befehl (m für Hilfe): w
Die Partitionstabelle wurde verändert!
Rufe ioctl() um Partitionstabelle neu einzulesen.
Synchronisiere Platten.
Wir erzeugen das physical volume:
root@acca:/tmp# pvcreate /dev/sdb3 Physical volume "/dev/sdb3" successfully created root@acca:/tmp# pvscan PV /dev/mapper/sda5_crypt VG kubuntu-vg lvm2 [931,27 GiB / 44,00 MiB free] PV /dev/sdb3 lvm2 [56,29 GiB] Total: 2 [987,56 GiB] / in use: 1 [931,27 GiB] / in no VG: 1 [56,29 GiB]
(/dev/mapper/sda5_crypt ist hier die verschlüsselte root Partition des Desktop PCs)
root@acca:/tmp# pvs PV VG Fmt Attr PSize PFree /dev/mapper/sda5_crypt kubuntu-vg lvm2 a-- 931,27g 44,00m /dev/sdb3 lvm2 a-- 56,29g 56,29g
Erzeugen einer volume group
root@acca:/tmp# vgcreate root-vg /dev/sdb3 Volume group "root-vg" successfully created
Jetzt erzeugen wir logical volumes:
- /var und /tmp sind für den Systembetrieb essentiell, 1G sollte genügend Luft geben
- /home lasse ich auf dem root Filesystem, weil bei mir dort keine nennenswerten Daten anfallen
- /backup nimmt die periodischen backups und evtl rsnapshots auf
- /opt nimmt alle selbst kompilierte Software und Datenbereiche der Anwendungen auf
Anlegen und Formatieren der Partitionen:
root@acca:/tmp# lvcreate -n var -L 1G root-vg
Logical volume "var" created
root@acca:/tmp# lvcreate -n tmp -L 1G root-vg
Logical volume "tmp" created
root@acca:/tmp# lvcreate -n backup -L 10G root-vg
Logical volume "backup" created
root@acca:/tmp# lvcreate -n opt -L 10G root-vg
Logical volume "opt" created
root@acca:/tmp# lvs
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
root kubuntu-vg -wi-ao--- 928,30g
swap_1 kubuntu-vg -wi-ao--- 2,93g
backup root-vg -wi-a---- 10,00g
opt root-vg -wi-a---- 10,00g
tmp root-vg -wi-a---- 1,00g
var root-vg -wi-a---- 1,00g
root@acca:/tmp# mkfs.ext4 /dev/mapper/root--vg-var
mke2fs 1.42.8 (20-Jun-2013)
Dateisystem-Label=
OS-Typ: Linux
Blockgröße=4096 (log=2)
Fragmentgröße=4096 (log=2)
Stride=0 Blöcke, Stripebreite=0 Blöcke
65536 Inodes, 262144 Blöcke
13107 Blöcke (5.00%) reserviert für den Superuser
Erster Datenblock=0
Maximale Dateisystem-Blöcke=268435456
8 Blockgruppen
32768 Blöcke pro Gruppe, 32768 Fragmente pro Gruppe
8192 Inodes pro Gruppe
Superblock-Sicherungskopien gespeichert in den Blöcken:
32768, 98304, 163840, 229376
Platz für Gruppentabellen wird angefordert: erledigt
Inode-Tabellen werden geschrieben: erledigt
Erstelle Journal (8192 Blöcke): erledigt
Schreibe Superblöcke und Dateisystem-Accountinginformationen: erledigt
root@acca:/tmp# mkfs.ext4 /dev/mapper/root--vg-tmp
mke2fs 1.42.8 (20-Jun-2013)
Dateisystem-Label=
OS-Typ: Linux
Blockgröße=4096 (log=2)
Fragmentgröße=4096 (log=2)
Stride=0 Blöcke, Stripebreite=0 Blöcke
65536 Inodes, 262144 Blöcke
13107 Blöcke (5.00%) reserviert für den Superuser
Erster Datenblock=0
Maximale Dateisystem-Blöcke=268435456
8 Blockgruppen
32768 Blöcke pro Gruppe, 32768 Fragmente pro Gruppe
8192 Inodes pro Gruppe
Superblock-Sicherungskopien gespeichert in den Blöcken:
32768, 98304, 163840, 229376
Platz für Gruppentabellen wird angefordert: erledigt
Inode-Tabellen werden geschrieben: erledigt
Erstelle Journal (8192 Blöcke): erledigt
Schreibe Superblöcke und Dateisystem-Accountinginformationen: erledigt
root@acca:/tmp# mkfs.ext4 /dev/mapper/root--vg-backup
mke2fs 1.42.8 (20-Jun-2013)
Dateisystem-Label=
OS-Typ: Linux
Blockgröße=4096 (log=2)
Fragmentgröße=4096 (log=2)
Stride=0 Blöcke, Stripebreite=0 Blöcke
655360 Inodes, 2621440 Blöcke
131072 Blöcke (5.00%) reserviert für den Superuser
Erster Datenblock=0
Maximale Dateisystem-Blöcke=2684354560
80 Blockgruppen
32768 Blöcke pro Gruppe, 32768 Fragmente pro Gruppe
8192 Inodes pro Gruppe
Superblock-Sicherungskopien gespeichert in den Blöcken:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Platz für Gruppentabellen wird angefordert: erledigt
Inode-Tabellen werden geschrieben: erledigt
Erstelle Journal (32768 Blöcke): erledigt
Schreibe Superblöcke und Dateisystem-Accountinginformationen: erledigt
root@acca:/tmp# mkfs.ext4 /dev/mapper/root--vg-opt
mke2fs 1.42.8 (20-Jun-2013)
Dateisystem-Label=
OS-Typ: Linux
Blockgröße=4096 (log=2)
Fragmentgröße=4096 (log=2)
Stride=0 Blöcke, Stripebreite=0 Blöcke
655360 Inodes, 2621440 Blöcke
131072 Blöcke (5.00%) reserviert für den Superuser
Erster Datenblock=0
Maximale Dateisystem-Blöcke=2684354560
80 Blockgruppen
32768 Blöcke pro Gruppe, 32768 Fragmente pro Gruppe
8192 Inodes pro Gruppe
Superblock-Sicherungskopien gespeichert in den Blöcken:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Platz für Gruppentabellen wird angefordert: erledigt
Inode-Tabellen werden geschrieben: erledigt
Erstelle Journal (32768 Blöcke): erledigt
Schreibe Superblöcke und Dateisystem-Accountinginformationen: erledigt
Anlegen von Mount Verzeichnissen (die meisten existieren schon), Anpassen der fstab:
root@acca:/tmp# mount /dev/sdb2 /mnt root@acca:/tmp# mkdir /mnt/backup root@acca:/tmp# blkid /dev/sdb1: SEC_TYPE="msdos" LABEL="boot" UUID="2654-BFC0" TYPE="vfat" /dev/sdb2: UUID="548da502-ebde-45c0-9ab2-de5e2431ee0b" TYPE="ext4" /dev/sdb3: UUID="aKqzo1-RdJL-Qeld-5SdK-Njyt-8PJX-yj3pnj" TYPE="LVM2_member" /dev/mapper/root--vg-var: UUID="7e50a7e5-94f0-4c16-8e06-cb53ef9ffe4b" TYPE="ext4" /dev/mapper/root--vg-tmp: UUID="dbb28339-37de-4c4a-82d0-1650cfd12a52" TYPE="ext4" /dev/mapper/root--vg-backup: UUID="d13c3bd7-6eff-41d5-a24c-71fbf2e9ae71" TYPE="ext4" /dev/mapper/root--vg-opt2: UUID="ba5c235e-fe2a-4b38-a767-5c4788e3ad80" TYPE="ext4" root@acca:/tmp# vi /mnt/etc/fstab root@acca:/tmp# cat /mnt/etc/fstab proc /proc proc defaults 0 0 /dev/mmcblk0p1 /boot vfat defaults 0 2 /dev/mmcblk0p2 / ext4 defaults,noatime 0 1 UUID=7e50a7e5-94f0-4c16-8e06-cb53ef9ffe4b /var ext4 defaults,noatime 0 2 UUID=dbb28339-37de-4c4a-82d0-1650cfd12a52 /tmp ext4 defaults,noatime 0 2 UUID=ba5c235e-fe2a-4b38-a767-5c4788e3ad80 /opt ext4 defaults,noatime 0 2 UUID=d13c3bd7-6eff-41d5-a24c-71fbf2e9ae71 /backup ext4 defaults,noatime 0 2
Kopieren der bestehenden Daten in /var und /opt in die Partitionen. Ein einfaches "mv" würde es auch tun, aber so kann man ggf. nochmals alt und neu vergleichen:
root@acca:/tmp# mkdir /mnt2 root@acca:/mnt/var# mount /dev/root-vg/var /mnt2 root@acca:/mnt/opt# cd /mnt/var root@acca:/mnt/var# tar cf - .|(cd /mnt2;tar xf -) root@acca:/mnt/var# umount /mnt2 root@acca:/mnt/var# mount /dev/root-vg/opt /mnt2 root@acca:/mnt/var# cd /mnt/opt root@acca:/mnt/opt# tar cf - .|(cd /mnt2;tar xf -) root@acca:/mnt/var# umount /mnt2 root@acca:/mnt/var# cd /tmp
Löschen der entsprechenden Originaldaten im Root Filesystem:
root@acca:/tmp# \rm -rf /mnt/var /mnt/opt /mnt/tmp root@acca:/tmp# mkdir /mnt/var /mnt/opt /mnt/tmp
Read/Write für alle auf der /tmp Partition:
root@acca:/tmp# mount /dev/mapper/root--vg-tmp /mnt2 root@acca:/tmp# chmod ugo+rwx /mnt2 root@acca:/tmp# umount /mnt2
Aushängen des root Filesystems zum Entnehmen der Karte
root@acca:/tmp# umount /mnt
Booten mit endgültigen Partitionen
Einloggen vom Desktop aus und Anzeigen von Speicher, Swap und Partitionen:
jengelha@medea:~$ ssh root@192.168.1.70
root@192.168.1.70's password:
Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Nov 9 13:46:11 2013 from 192.168.1.63
root@raspberrypi:~# free
total used free shared buffers cached
Mem: 237608 56908 180700 0 9224 26356
-/+ buffers/cache: 21328 216280
Swap: 102396 0 102396
root@raspberrypi:~# df -T
Dateisystem Typ 1K-Blöcke Benutzt Verfügbar Verw% Eingehängt auf
rootfs rootfs 3784144 1526180 2065724 43% /
/dev/root ext4 3784144 1526180 2065724 43% /
devtmpfs devtmpfs 110544 0 110544 0% /dev
tmpfs tmpfs 23764 256 23508 2% /run
tmpfs tmpfs 5120 0 5120 0% /run/lock
tmpfs tmpfs 47520 0 47520 0% /run/shm
/dev/mmcblk0p1 vfat 57288 18560 38728 33% /boot
/dev/mapper/root--vg-var ext4 1032088 212372 767288 22% /var
/dev/mapper/root--vg-tmp ext4 1032088 34064 945596 4% /tmp
/dev/mapper/root--vg-opt ext4 10321208 191300 9605620 2% /opt
/dev/mapper/root--vg-backup ext4 10321208 154100 9642820 2% /backup
Man sieht, nach Anpassung des GPU Speichers haben wir jetzt immerhin 237608 kB statt 188840 kB.
Installation von Server und Build Paketen
Folgendes gibt Gelegenheit für eine weitere Kaffeepause:
apt-get install postfix mailutils screen mysql-client mysql-server php5 php5-common \ php5-fpm php5-mcrypt php5-mysql php5-cgi php5-cli php5-gd php5-curl php-apc ufw emacs23-nox \ libssh2-php mercurial software-properties-common nginx uwsgi uwsgi-plugin-python python-virtualenv apt-get clean apt-get autoremove
Initialisieren des USB Speichersticks
Am besten erledigt man dies auch am Desktop, da es einfach schneller geht.
Prüfen der Sticks
root@acca:/tmp# fdisk -l /dev/sdc Disk /dev/sdc: 62.9 GB, 62914560000 bytes 237 Köpfe, 12 Sektoren/Spur, 43206 Zylinder, zusammen 122880000 Sektoren Einheiten = Sektoren von 1 × 512 = 512 Bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Festplattenidentifikation: 0xb1bfa153 Gerät boot. Anfang Ende Blöcke Id System /dev/sdc1 2640 122879999 61438680 b W95 FAT32
Löschen von Restdaten
root@acca:/tmp# dd if=/dev/zero of=/dev/sdc bs=4M &
Partitionieren:
root@acca:/tmp# fdisk /dev/sdc
Das Gerät enthält weder eine gültige DOS-Partitionstabelle,
noch einen „Sun“, „SGI“ oder „OSF disklabel“
Building a new DOS disklabel with disk identifier 0x5aef973b.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warnung: Schreiben wird ungültiges Flag 0x0000 in Part.-tabelle 4 korrigieren
Befehl (m für Hilfe): p
Disk /dev/sdc: 62.9 GB, 62914560000 bytes
64 Köpfe, 32 Sektoren/Spur, 60000 Zylinder, zusammen 122880000 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Festplattenidentifikation: 0x5aef973b
Gerät boot. Anfang Ende Blöcke Id System
Befehl (m für Hilfe): o
Building a new DOS disklabel with disk identifier 0x10b593b5.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warnung: Schreiben wird ungültiges Flag 0x0000 in Part.-tabelle 4 korrigieren
Befehl (m für Hilfe): p
Disk /dev/sdc: 62.9 GB, 62914560000 bytes
64 Köpfe, 32 Sektoren/Spur, 60000 Zylinder, zusammen 122880000 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Festplattenidentifikation: 0x10b593b5
Gerät boot. Anfang Ende Blöcke Id System
Befehl (m für Hilfe): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partitionsnummer (1-4, Vorgabe: 1):
Benutze den Standardwert 1
Erster Sektor (2048-122879999, Vorgabe: 2048):
Benutze den Standardwert 2048
Last Sektor, +Sektoren or +size{K,M,G} (2048-122879999, Vorgabe: 122879999):
Benutze den Standardwert 122879999
Befehl (m für Hilfe): t
Partition 1 ausgewählt
Hex code (L um eine Liste anzuzeigen): 8e
Der Dateisystemtyp der Partition 1 ist nun 8e (Linux LVM)
Befehl (m für Hilfe): p
Disk /dev/sdc: 62.9 GB, 62914560000 bytes
64 Köpfe, 32 Sektoren/Spur, 60000 Zylinder, zusammen 122880000 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Festplattenidentifikation: 0x10b593b5
Gerät boot. Anfang Ende Blöcke Id System
/dev/sdc1 2048 122879999 61438976 8e Linux LVM
Befehl (m für Hilfe): w
Die Partitionstabelle wurde verändert!
Rufe ioctl() um Partitionstabelle neu einzulesen.
Synchronisiere Platten.
Aus/Einstecken, Formatieren, volume group, logical volume, Formatieren:
root@acca:/tmp# pvcreate /dev/sdc1
Physical volume "/dev/sdc1" successfully created
root@acca:/tmp# vgcreate stick-vg /dev/sdc1
Volume group "stick-vg" successfully created
root@acca:/tmp# vgs
VG #PV #LV #SN Attr VSize VFree
kubuntu-vg 1 2 0 wz--n- 931,27g 44,00m
stick-vg 1 0 0 wz--n- 58,59g 58,59g
root@acca:/tmp# lvcreate -n stick -L 48G stick-vg
Logical volume "stick" created
root@acca:/tmp# mkfs.ext4 /dev/mapper/stick--vg-stick
mke2fs 1.42.8 (20-Jun-2013)
Dateisystem-Label=
OS-Typ: Linux
Blockgröße=4096 (log=2)
Fragmentgröße=4096 (log=2)
Stride=0 Blöcke, Stripebreite=0 Blöcke
3145728 Inodes, 12582912 Blöcke
629145 Blöcke (5.00%) reserviert für den Superuser
Erster Datenblock=0
Maximale Dateisystem-Blöcke=4294967296
384 Blockgruppen
32768 Blöcke pro Gruppe, 32768 Fragmente pro Gruppe
8192 Inodes pro Gruppe
Superblock-Sicherungskopien gespeichert in den Blöcken:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Platz für Gruppentabellen wird angefordert: erledigt
Inode-Tabellen werden geschrieben: erledigt
Erstelle Journal (32768 Blöcke): erledigt
Schreibe Superblöcke und Dateisystem-Accountinginformationen: erledigt
root@acca:/tmp# mount /dev/mapper/stick--vg-stick /mnt
root@acca:/tmp# df -T /mnt
Dateisystem Typ 1K-Blöcke Benutzt Verfügbar Verw% Eingehängt auf
/dev/mapper/stick--vg-stick ext4 49410864 53116 46824784 1% /mnt
Belastungs- und Performancetests
Testen der Disk Performance
SD Karte:
apt-get install hdparm root@raspberrypi:~# hdparm -tT /dev/mmcblk0 /dev/mmcblk0: Timing cached reads: 290 MB in 2.00 seconds = 144.66 MB/sec Timing buffered disk reads: 60 MB in 3.10 seconds = 19.36 MB/sec
Stick:
pi@raspberrypi ~ $ sudo hdparm -tT /dev/sda /dev/sda: Timing cached reads: 312 MB in 2.01 seconds = 155.22 MB/sec Timing buffered disk reads: 34 MB in 3.13 seconds = 10.86 MB/sec
Load Test: paralleles Compile
Legendär wird normalerweise ein Linux Kernel multithreaded kompiliert, um die CPU unter Vollast zu setzen und Disk IO zu erzeugen. Beim Pi wäre das allerdings eine Angelegenheit von wohl so um einen vollen Tag herum. Deswegen nehme ich was kleineres: http://nginx.org/ .
Wichtig ist, dass man bei allen Vergleichen identische Vorraussetzungen schafft. Swap und Caches sollten vor dem Benchmark gelöscht sein. Wir arbeiten als user "pi".
Messwerkzeug
sudo apt-get install time
Prüfen und Zurücksetzen der IO Caches
pi@raspberrypi ~ $ free
total used free shared buffers cached
Mem: 237608 202064 35544 0 7216 128132
-/+ buffers/cache: 66716 170892
Swap: 102396 0 102396
pi@raspberrypi ~ $ sudo dphys-swapfile swapoff
pi@raspberrypi ~ $ sudo dphys-swapfile swapon
pi@raspberrypi ~ $ sudo bash -c "echo 3 > /proc/sys/vm/drop_caches"
pi@raspberrypi ~ $ free
total used free shared buffers cached
Mem: 237608 78452 159156 0 1192 17708
-/+ buffers/cache: 59552 178056
Swap: 102396 0 102396
Hmm, so richtig "clean" sieht das ja nicht aus, geht's besser?
Test auf dem tmp Filesystem:
pi@raspberrypi ~ $ sudo apt-get -y install libssl-dev libpcre3-dev
pi@raspberrypi ~ $ sudo mkdir /opt/tools/nginx
pi@raspberrypi ~ $ cd /tmp
pi@raspberrypi /tmp $ ngversion=1.4.3 # stable version see http://nginx.org/
pi@raspberrypi /tmp $ wget http://nginx.org/download/nginx-${ngversion}.tar.gz
pi@raspberrypi /tmp $ tar xfz nginx-${ngversion}.tar.gz
cd /tmp/nginx-${ngversion}
pi@raspberrypi /tmp/nginx-1.4.3 $ make clean >& /dev/null
pi@raspberrypi /tmp/nginx-1.4.3 $ ./configure --prefix=/opt/tools/nginx/${ngversion} --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx --user=www-data --group=www-data --without-http_autoindex_module \
--without-http_ssi_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_ssl_module \
--with-http_stub_status_module --with-http_gzip_static_module
# hier die Caches löschen wie oben gezeigt
pi@raspberrypi /tmp/nginx-1.4.3 $ \time --verbose make
Ergebnis single-threaded make:
Command being timed: "make"
User time (seconds): 616.90
System time (seconds): 24.14
Percent of CPU this job got: 95%
Elapsed (wall clock) time (h:mm:ss or m:ss): 11:09.40
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 30248
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 95
Minor (reclaiming a frame) page faults: 815498
Voluntary context switches: 3911
Involuntary context switches: 22633
Swaps: 0
File system inputs: 35744
File system outputs: 24168
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
Wiederholung dieses Laufs ohne Leeren der Caches um zu sehen wieviel Einfluss das hat, Ergebnis:
Command being timed: "make"
User time (seconds): 614.75
System time (seconds): 25.11
Percent of CPU this job got: 97%
Elapsed (wall clock) time (h:mm:ss or m:ss): 10:55.23
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 30244
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 815546
Voluntary context switches: 3306
Involuntary context switches: 22649
Swaps: 0
File system inputs: 0
File system outputs: 24168
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
Fazit: Entweder ich mache hier noch was falsch, oder aber das Caching bringt hier gar nichts, ist das Memory Subsystem wirklich so lahm??
Multi-thread jobs unter dem "wall time" Aspekt machen mit einer langsamen Single-Core CPU keinen Sinn, treiben das System aber in den swap und lasten das Gesamtsystem maximal aus.
Hier ein Lauf nach make clean, configure, caches clean mit make -j2, zwei Threads, Ergebnis:
Command being timed: "make -j2"
User time (seconds): 625.86
System time (seconds): 26.56
Percent of CPU this job got: 97%
Elapsed (wall clock) time (h:mm:ss or m:ss): 11:09.38
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 30244
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 97
Minor (reclaiming a frame) page faults: 815634
Voluntary context switches: 3889
Involuntary context switches: 77701
Swaps: 0
File system inputs: 34600
File system outputs: 24168
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
Acht Threads:
Command being timed: "make -j8"
User time (seconds): 626.62
System time (seconds): 34.36
Percent of CPU this job got: 95%
Elapsed (wall clock) time (h:mm:ss or m:ss): 11:29.04
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 28868
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 3597
Minor (reclaiming a frame) page faults: 1105405
Voluntary context switches: 9300
Involuntary context switches: 92813
Swaps: 0
File system inputs: 517912
File system outputs: 24168
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
16 Threads:
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
-o objs/src/http/ngx_http_upstream_round_robin.o \
src/http/ngx_http_upstream_round_robin.c
{standard input}: Assembler messages:
{standard input}: Warning: end of file not at end of a line; newline inserted
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive
cc: internal compiler error: Getötet (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
make[1]: *** [objs/src/http/ngx_http.o] Fehler 4
make[1]: *** Warte auf noch nicht beendete Prozesse...
make[1]: Leaving directory `/tmp/nginx-1.4.3'
make: *** [build] Fehler 2
Command exited with non-zero status 2
Command being timed: "make -j16"
User time (seconds): 427.60
System time (seconds): 79.40
Percent of CPU this job got: 49%
Elapsed (wall clock) time (h:mm:ss or m:ss): 17:12.55
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 29228
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 45049
Minor (reclaiming a frame) page faults: 2270485
Voluntary context switches: 80570
Involuntary context switches: 145533
Swaps: 0
File system inputs: 5448272
File system outputs: 8448
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 2
Offenbar sind 16 Threads zuviel, hier müsste der swap Speicher voll ausgeschöpft gewesen sein.
DOS Partitionstabelle
Aufbau einer DOS Partitionstabelle / Master Boot Record siehe http://de.wikipedia.org/wiki/Master_Boot_Record .
sfdisk
Enthalten im Paket util-linux.
Sichern (Auslesen): sfdisk /dev/sdx > /tmp/sdx_partitiontable.bin
Zurückspielen: sfdisk /dev/sdx < /tmp/sdx_partitiontable.bin
DOS Bootloader
Sichern (Auslesen): dd if=/dev/sdx bs=446 count=1 of=/tmp/sdx_bootsector.bin
Zurückspielen: dd of=/dev/sdx bs=446 count=1 if=/tmp/sdx_bootsector.bin
Cubieboard
Performance Tests
Performance Test Harddisk an SATA HGST HTS541010A9E680 hdparm -tT /dev/sdb
/dev/sdb:
Timing cached reads: 546 MB in 2.00 seconds = 272.67 MB/sec Timing buffered disk reads: 264 MB in 3.02 seconds = 87.55 MB/sec
Load Test: single threaded compile von nginx-1.4.3
Command being timed: "make"
User time (seconds): 230.17
System time (seconds): 15.79
Percent of CPU this job got: 97%
Elapsed (wall clock) time (h:mm:ss or m:ss): 4:11.76
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 30784
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 97
Minor (reclaiming a frame) page faults: 840879
Voluntary context switches: 3868
Involuntary context switches: 15634
Swaps: 0
File system inputs: 37586
File system outputs: 25376
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
Fortsetzung folgt