Published on

Fedora 21 Server setup

Authors

This is the (almost) complete list of actions performed at the command line to bring up a 'desktop server' to 'operational standard' from USB drive with the 1.9Gb "Fedora Server ISO" installed on it onto the server's brand new SSD drive.

Update machine after initial USB install

This is using the machines actual console :

yum install yum-plugin-fastestmirror
yum update
yum install joe
reboot

Configure machine for static IP

Using this helpful page and again using the machine's actual console (so that remainder can be done via SSH) :

ifconfig
# enp3s0 is the adapter name

joe /etc/sysconfig/network-scripts/ifcfg-enp3s0
------
TYPE="Ethernet"

#BOOTPROTO="dhcp"
BOOTPROTO=static
IPADDR=192.168.1.4
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=192.168.1.2

DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="enp3s0"
UUID="4771d65c-037d-4806-aaca-d0aae1c1f05f"
ONBOOT="yes"
HWADDR="74:D4:35:85:F1:53"
PEERDNS="yes"
PEERROUTES="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
------

Then, restart the interface (still at the console!!) :

ifdown enp3s0
ifup enp3s0

Check the contents of /etc/resolv.conf :

# Generated by NetworkManager
search herald
nameserver 192.168.1.2

Ok to reboot, and see whether keyboard is now necessary, etc :

shutdown -h now

Install essential tools

yum install git

Copy lots of stuff from previous HD

This was simple enough (once the appropriate entry was added to /etc/fstab to mount the old disk) :

#
# /etc/fstab
# Created by anaconda on Tue Jan 13 23:26:30 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#

# This are the mounts created by the Fedora 21 installer
/dev/mapper/fedora--server-root /                       ext4    defaults        1 1
UUID=e03e963b-fcfc-44fe-a777-a7f3647858d7 /boot                   ext4    defaults        1 2
/dev/mapper/fedora--server-swap swap                    swap    defaults        0 0

# This is the new entry, with the 'device location' found by
# inspecting the contents of /dev/mapper (and contrasting with above)
/dev/mapper/fedora-root /mnt/data                       ext4    defaults        1 1

On to the copying :

# Internal 'sketchpad' for miscellaneous works-in-progree
rsync -avz --progress  /mnt/data/home/andrewsm/sketchpad .

# Bring over settings so that logins work elsewhere (clone old HD's settings)
rsync -avz --progress  /mnt/data/home/andrewsm/.ssh .

More tools

Now that machine is looking more like home (and proven itself somewhat stable), pull in more heavy-weight packages :

yum install gcc python cmake make

Nvidia Proprietary Driver install (for Nvidia card)

http://www.if-not-true-then-false.com/2014/fedora-20-nvidia-guide/

yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
lspci | grep -i nvidia
gcc --version
yum install akmod-nvidia "kernel-devel-uname-r == $(uname -r)"

# Backup old initramfs nouveau image ##
mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
# Create new initramfs image ##
dracut /boot/initramfs-$(uname -r).img $(uname -r)

As detailed in Nvidia's instructions, and the text document, get the CUDA repo RPM from Nvidia's CUDA download page :

wget http://developer.download.nvidia.com/compute/cuda/repos/fedora20/x86_64/cuda-repo-fedora20-6.5-14.x86_64.rpm
yum install cuda-repo-fedora*
yum install cuda
# This installs the JDK, mesa-libGL, lots of libX...
reboot

Build one of the samples, to prove that the driver, CUDA and card are all operational :

cd /usr/local/cuda/samples/1_Utilities/deviceQuery

# This is apparently required, and not one of the listed dependencies
yum install gcc-c++

make
./deviceQuery

----
./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "GeForce GTX 760"
  CUDA Driver Version / Runtime Version          6.5 / 6.5
  CUDA Capability Major/Minor version number:    3.0
  Total amount of global memory:                 2048 MBytes (2147287040 bytes)
  ( 6) Multiprocessors, (192) CUDA Cores/MP:     1152 CUDA Cores
  GPU Clock rate:                                1137 MHz (1.14 GHz)
  Memory Clock rate:                             3100 Mhz
  Memory Bus Width:                              256-bit
  L2 Cache Size:                                 524288 bytes
  Maximum Texture Dimension Size (x,y,z)         1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096)
  Maximum Layered 1D Texture Size, (num) layers  1D=(16384), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(16384, 16384), 2048 layers
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total number of registers available per block: 65536
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  2048
  Maximum number of threads per block:           1024
  Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
  Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and kernel execution:          Yes with 1 copy engine(s)
  Run time limit on kernels:                     No
  Integrated GPU sharing Host Memory:            No
  Support host page-locked memory mapping:       Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support:                        Disabled
  Device supports Unified Addressing (UVA):      Yes
  Device PCI Bus ID / PCI location ID:           1 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 6.5, CUDA Runtime Version = 6.5, NumDevs = 1, Device0 = GeForce GTX 760
Result = PASS

To enable compilation, etc, of CUDA and access to OpenCL libraries, etc, add to ~/.bash_profile :

export PATH=$PATH:/usr/local/cuda-6.5/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-6.5/lib64
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda-6.5/lib64

Install numpy / theano / ipython Prerequisites

yum install libyaml-devel zeromq-devel
yum install openblas-devel atlas-devel gcc-gfortran
yum install python-virtualenv
yum install libpng-devel freetype-devel
yum install hdf5-devel

Rebuilding libgpuarray, etc : Hints

Check that this now builds both CUDA and OpenCL (still complains about CLBLAS for the moment):

. env/bin/activate
cd env/libgpuarray
git pull
rm -rf Build
mkdir Build
cd Build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
cd ..
python setup.py develop
cd ../..

Remove superfluous RPMs

Actually, this is unnessary, since the server install doesn't include these anyway (doesn't hurt to try, though) :

yum remove transmission* claws-mail* midori*
yum remove pidgin* remmina* liferea* abiword* orage* parole* ristretto*

Install EncFS (for sync-able encrypted folders)

This is for regular (sync-able) file-system files that can be encrypted/decrypted on the fly. Very usefull in conjunction with unison :

yum install fuse-encfs

# remove '#' before user_allow_other
joe /etc/fuse.conf

The following script mounts an encrypted folder simply :

#!/bin/bash

#Capture the full path (required for mounting)
p=`pwd`
fusermount -u ${p}/Finance

DIALOGTEXT="Enter the Personal-Finance EncFS Password"
encfs \
 -o allow_other \
 --extpass="zenity --title 'EncFS Password' --entry --hide-text --text '$DIALOGTEXT'" \
 ${p}/.Finance-encfs/ ${p}/Finance/

And the following script un-mounts it :

#!/bin/bash
fusermount -u Finance