Published on

Fedora 21 Server setup


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

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) :

# enp3s0 is the adapter name

joe /etc/sysconfig/network-scripts/ifcfg-enp3s0



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

ifdown enp3s0
ifup enp3s0

Check the contents of /etc/resolv.conf :

# Generated by NetworkManager
search herald

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)

yum localinstall --nogpgcheck$(rpm -E %fedora).noarch.rpm$(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 :

yum install cuda-repo-fedora*
yum install cuda
# This installs the JDK, mesa-libGL, lots of libX...

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++


./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
sudo make install
cd ..
python 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 :


#Capture the full path (required for mounting)
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 :

fusermount -u Finance