NFS-Freigabe für Homeverzeichnisse

wenn ich in der Konsole als root mount /home ausführe bekomme ich die Meldung dass /dev/sda5 bereits nach /home gemountet ist.

Es schein also an dem bereits vorhanden mount:

/dev/sda5 /home

zu liegen. Aber der kommt ja per Vorgabe aus dem Image.

Habe gerade mal geschaut. Auf dem Master wurd unter /home überhaupt kein Verzeichnis “s.gehr” angelegt

Ja das wird wohl Probleme machen. Da gibts für dich nun 3 Möglichkeiten:

  1. Manuelles anpassen der /etc/fstab
  2. Erstellung eines eigenen Images
  3. Verwendung eines Partionierungs-Scriptes

Für die letzte Variante könntest du folgendes Script (basiert auf LVM) als Vorlage nehmen:

#!/bin/sh
#
# Copyright (C) 2015 Univention GmbH
#
# http://www.univention.de/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero General Public License version 3
# (GNU AGPL V3) as published by the Free Software Foundation.
#
# Binary versions of this program provided by Univention to you as
# well as other copyrighted, protected or trademarked materials like
# Logos, graphics, fonts, specific documentations and configurations,
# cryptographic keys etc. are subject to a license agreement between
# you and Univention and not subject to the GNU AGPL V3.
#
# In the case you use this program under the terms of the GNU AGPL V3,
# the program is provided in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public
# License with the Debian GNU/Linux or Univention distribution in file
# /usr/share/common-licenses/AGPL-3; if not, see
# <http://www.gnu.org/licenses/>.

set -x

# Get device
partition_device="$1"

# Set partition sizes for LVM
swap_lvm_size="-L2G"
root_lvm_size="-L200G"
data_lvm_size="-L10G"

plymouth --ping && plymouth message --text="Starting partitioning with script simple_partition.example"

# remove lvms
lvm vgchange -an
lvm pvdisplay | sed -n 's/ *PV Name *//p' > /tmp/pvs
while read line; do
        lvm pvremove -ff -y $line
done < /tmp/pvs

# Create GPT
parted --script "${partition_device}" mklabel GPT

# Create msdos partition table
#parted --script "${partition_device}" mklabel msdos

# Create partitions
parted --script --align optimal "${partition_device}" mkpart primary 0% 1MB # BIOS boot
parted --script "${partition_device}" set 1 bios_grub on
parted --script --align optimal "${partition_device}" mkpart primary 1MB 500MB # /boot
parted --script --align optimal "${partition_device}" mkpart primary 500MB 100% # LVM
 
# Create PV
lvm pvcreate "${partition_device}3"
 
# Create volume group
lvm vgcreate vg_ucc "${partition_device}"3
 
# Create swap
lvm lvcreate ${swap_lvm_size} -n swap vg_ucc
mkswap /dev/mapper/vg_ucc-swap

# Create  /
lvm lvcreate ${root_lvm_size} -n rootfs vg_ucc
mkfs.ext4 -q /dev/mapper/vg_ucc-rootfs

# Create /data
lvm lvcreate ${data_lvm_size} -n data vg_ucc
mkfs.ext4 -q -m0 /dev/mapper/vg_ucc-data
 
# Create boot filesystem
/sbin/mkfs.ext4 -q "${partition_device}2"

# Mount the root filesystem
mkdir -p /ucc_tmp/root
mount /dev/mapper/vg_ucc-rootfs /ucc_tmp/root

# Mark device as root device
touch /ucc_tmp/root/ucc_root_device

# Create fstab file
echo "/dev/loop0    /   ext4   errors=remount-ro   0   1" >>/ucc_tmp/fstab
echo "${partition_device}2     /boot ext4 defaults    0   2" >>/ucc_tmp/fstab
echo "/dev/mapper/vg_ucc-swap    swap    swap    0    0" >>/ucc_tmp/fstab
echo "/dev/mapper/vg_ucc-data    /data    ext4    defaults    0    2" >>/ucc_tmp/fstab

# Mark /boot in order to copy files from the image to the partition
echo "${partition_device}2 ext4 /boot" >> /ucc_tmp/root/copy_files

exit 0

Dieses mußt du unter /var/lib/univention-client-boot/partition-scripts/ ablegen, z.B. als desktop_lvm.sh und ausführbar machen. Am Client-Objekt mußt du via UMC “partition_script=desktop_lvm.sh” als erweiterten Startparameter hinterlegen.

Das sollte beim ersten Login automatisch angelegt werden.

Hallo, also im Beutzer-Objekt -> Konto -> Posix war die Home-Freigabe nicht ausgwählt. Nachgeholt, gespeichert.

Danach war das Verzeichnis auf dem Master dann auch da.

Allerdings kollidiert es trotzdem mit dem /dev/sda5 Eintrag in der fstab. Dieser hat Vorang. Ich habe mich jetzt erst mal für die Anpassung der fstab entschieden da es bei drei Clients überschaubar ist.

Langfristig werde ich mir die anderen beiden Möglichkeiten anschauen aber ich denke ich sollte erst mal das Handbuch vom UCS durch arbeiten um einen Überblick zu haben.

Danke für die Hilfe!

Mastodon