Skip to content

Instantly share code, notes, and snippets.

@LincolnBryant
Created May 27, 2016 15:47
Show Gist options
  • Save LincolnBryant/396ab747cd6bef103584d709b39a6553 to your computer and use it in GitHub Desktop.
Save LincolnBryant/396ab747cd6bef103584d709b39a6553 to your computer and use it in GitHub Desktop.
CVMFS within LXD

CVMFS over LXD

Install CVMFS from CERN:

# dpkg -i /home/lincolnb/cvmfs-release-latest_all.deb
# apt update
# apt install cvmfs

Edit fuse conf:

vim /etc/fuse.conf

# /etc/fuse.conf - Configuration file for Filesystem in Userspace (FUSE)

# Set the maximum number of FUSE mounts allowed to non-root users.
# The default is 1000.
#mount_max = 1000

# Allow non-root users to specify the allow_other or allow_root mount options.
user_allow_other

Edit autofs:

# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
#/misc  /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#       "nosuid" and "nodev" options unless the "suid" and "dev"
#       options are explicitly given.
#
#/net   -hosts
/cvmfs /etc/auto.cvmfs

Restart autofs

# systemctl restart autofs

Create mountpoint for CVMFS scratchdir

# zfs create -o mountpoint=/scratch -o compression=on tank/scratch
# chown cvmfs: /scratch

Create the persistent bind mount

# lxc config device add centos cvmfs disk source=/cvmfs path=/cvmfs

Launch into the container:

# lxc exec centos -- /bin/bash

Load a module:

# source /cvmfs/oasis.opensciencegrid.org/osg/modules/lmod/current/init/bash
# module load R
# R

R version 3.1.1 (2014-07-10) -- "Sock it to Me"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> 1+1
[1] 2
> q()
Save workspace image? [y/n/c]: n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment