conf_disk: bug fixes, splitted init function to library, language concistancy fixes
This commit is contained in:
@@ -1,26 +1,27 @@
|
||||
# Configuration du disque de calcul
|
||||
# Secondary drive configuration
|
||||
|
||||
export VER_conf_disks="0.0.6"
|
||||
export VER_conf_disks="0.0.7"
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Cas de ZFS
|
||||
# ZFS case
|
||||
conf_zfs()
|
||||
{
|
||||
prnt I "Création du volume calcul en ZFS."
|
||||
|
||||
# On crée les répertoires d'accueil
|
||||
mkdir -pv /calcul/$HOSTNAME
|
||||
# Create destination directory
|
||||
mkdir -pv $CALCMOUNTPOINT
|
||||
|
||||
# Installation de ZFS
|
||||
# Install ZFS
|
||||
pkginst zfsutils-linux
|
||||
|
||||
# Chargement du module et vérification
|
||||
# Load ZFS module to check it works
|
||||
modprobe zfs || (
|
||||
prnt E "Échec de chargement du module noyau, abandon."
|
||||
die 2
|
||||
)
|
||||
sleep 1
|
||||
|
||||
# Create filesystem
|
||||
prnt I "Création du pool zcalc..."
|
||||
if [[ $FORCEBLANK ]]; then
|
||||
local opt="--force"
|
||||
@@ -29,13 +30,18 @@ conf_zfs()
|
||||
prnt I "Effacement des donnée de $drv..."
|
||||
dd if=/dev/zero of=$drv bs=1024 count 1000000
|
||||
fi
|
||||
|
||||
# Empty cache and inform kernel of the change
|
||||
sync
|
||||
partprobe
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ $(zpool create zcalc -m /calcul/$HOSTNAME $CALCLEVEL $opt $CALCDRV) ]]; then
|
||||
# On active la compression par défaut
|
||||
if [[ $(zpool create zcalc -m $CALCMOUNTPOINT $CALCLEVEL $opt $CALCDRV) ]]; then
|
||||
# We activate lz4 compression by default
|
||||
zpool set zcalc compression=lz4
|
||||
|
||||
# If a VM is projected we create associated volume
|
||||
if [[ $WITH_VM == true ]]; then
|
||||
prnt I "Création du conteneur pour la future VM..."
|
||||
zfs create zcalc/vm
|
||||
@@ -47,7 +53,7 @@ conf_zfs()
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Création des partitions pour XFS et Ext4
|
||||
# Creation partitions for XFS or Ext4
|
||||
mkpart()
|
||||
{
|
||||
prnt I "Création d'une nouvelle table de partition GPT..."
|
||||
@@ -58,7 +64,7 @@ mkpart()
|
||||
conf_ext4()
|
||||
{
|
||||
mkpart
|
||||
# A finir
|
||||
# Todo
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -67,20 +73,20 @@ conf_xfs()
|
||||
prnt I "Installation des outils XFS..."
|
||||
pkginst xfsprogs
|
||||
mkpart
|
||||
# A finir
|
||||
# todo
|
||||
}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
conf_disks()
|
||||
{
|
||||
[[ $STOP_CONF_DISK ]] && return 0
|
||||
[[ -n $STOP_CONF_DISK ]] && return 0
|
||||
|
||||
if [[ ! $CALCDRV ]]; then
|
||||
prnt I "Pas de disque de calcul défini, rien à faire."
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
||||
prnt I "Installation des outils de partitionnement..."
|
||||
pkginst parted
|
||||
|
||||
|
||||
Reference in New Issue
Block a user