Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Content imported from a Scroll Translations translation file.
Sv translation
languageen

Create the Store with LVM

It is recommended to create the STORE machine without the disk for the storage being mounted by the installation routines. 

Useful Commands

The following commands are useful to see the current configuration of the machine,

Translations Ignore


Code Block
languagebash
# Show free space on existing devices
df -h

# Show drives
ls /dev/sd*

# Show partitions
fdisk -l

# Show partitions
ls /dev/sd*

# Re-scan the SCSI bus
echo "- - -" > /sys/class/scsi_host/host0/scan
echo "- - -" > /sys/class/scsi_host/host1/scan
echo "- - -" > /sys/class/scsi_host/host2/scan
...

# View physical volumes managed by LVM
lvm pvs

# Display logical volumes managed by LVM
lvm lvs

# Display logical volume groups managed by LVM
lvm vgs

# Where is what mounted
mount


Some of the information above may be required to complete installation.

It is important to know where the disk to be used is, and where the space is. 

Usually, we recommend adding a second disk drive to the machine for the storage. 

The following assumes that the disk was added as /dev/sdb on the machine, and is not yet partitioned. 

If this is not the case, or the drive is not /dev/sdb or the space was added to an existing partition, then the commands below will have to be (carefully) modified to take this into account.

Creation Steps

Create a Partition


Translations Ignore


Code Block
languagebash
fdisk /dev/sdb
 
# --> Edit the partitions on /dev/sdb
 
n
# --> Create new partition
p
# --> New primary partition
1
# --> Create new partition 1 (view output at fdisk -1 above)
Enter
# --> Confirmation that the first available cylinder should be used
Enter
# --> Confirmation that the last available cylinder is to be used (gives the maximum size in total)
t
# --> Change partition type
8e
# --> Linux LVM
w
# --> When OK, write


Create LVM Physical Volume

This command creates a physical volume which can be managed by LVM.

The above commands will have created a partition /dev/sdb1. If you are working on a different partition, then modify accordingly.

Translations Ignore


Code Block
languagebash
lvm pvcreate /dev/sdb1


Create a Volume Group

This command creates a volume group called vg_jtelshared. The volume group can be expanded later, by adding more physical volumes. 

Translations Ignore


Code Block
languagebash
lvm vgcreate "vg_jtelshared" /dev/sdb1


Create a Logical Volume

Finally, a logical volume lv_jtelshared is created on the volume group which contains the aggregated space.

Translations Ignore


Code Block
languagebash
lvm lvcreate -l +100%FREE vg_jtelshared -n lv_jtelshared


Create File System

Now, the file system is created. Here we use xfs, though you can use something else if you really want.

Translations Ignore


Code Block
languagebash
mkfs.xfs -L data /dev/vg_jtelshared/lv_jtelshared


Prepare Mount Point

The data should be mounted to the directory /srv/jtel/shared.

The following commands prepare for this:

Translations Ignore


Code Block
languagebash
mkdir /srv/jtel
mkdir /srv/jtel/shared 
chown -R jtel:jtel /srv/jtel/shared


Add to fstab to Mount at Boot

The following adds a line to fstab to mount the file system at boot:

Translations Ignore


Code Block
languagebash
cat <<EOFF >> /etc/fstab
/dev/mapper/vg_jtelshared-lv_jtelshared /srv/jtel/shared        xfs     defaults 0   0
EOFF


Mount the File System

Translations Ignore


Code Block
languagebash
mount /srv/jtel/shared


Checks

Translations Ignore


Code Block
languagebash
df -h


This should show an entry for /srv/jtel/shared with the expected amount of free space.

Install and Configure Access to STORE

Install Samba

These commands install the samba server and client and lsof.

Translations Ignore


Code Block
dnf -y install samba samba-client lsof


Configure Samba

The following creates a samba configuration file with a minimum configuration.

Translations Ignore


Code Block
# SMB Conf
cat <<EOFF > /etc/samba/smb.conf
[global]
        workgroup = JTEL
    security    security = user
        passdb backend = tdbsam
        min protocol = SMB3
    reset on zero  ntlm authvc = yes
 
[homesshared]
    comment = jtel ACD commentShared =Directory
 Home Directories
  public = no
    validread usersonly = no
 %S, %D%w%S
  writable = yes
    browseablelocking = Noyes
    path = /srv/jtel/shared
    readcreate onlymask = No0644
        inherit aclsdirectory mask = Yes0755
 
[shared]
   force commentuser = jtel ACD Shared Directory
    readforce onlygroup = nojtel
    publicacl =allow yes
execute always   writable = yes
    locking = yes
    path = /srv/jtel/shared
    guest ok = yes
    create mask = 0644
    directory mask = 0755
    force user = jtel
    force group = jtel
    acl allow execute always = True
 
EOFF

Setup SeLinux and the Firewall

The following command sets up selinux for the smb service and opens the necessary ports in the firewall:

Translations Ignore
Code Block
setsebool -P samba_enable_home_dirs=on samba_export_all_rw=on use_samba_home_dirs=on use_nfs_home_dirs=on
firewall-cmd --zone=public --add-port=445/tcp --add-port=139/tcp --add-port=138/udp --add-port=137/udp --permanent
firewall-cmd --reload

Enable and Start Samba

The following commands setup the SMB and NMB services to autostart, and start them.

Translations Ignore
Code Block
titleStart SAMBA
systemctl enable nmb
systemctl enable smb
systemctl start nmb
systemctl start smb

Manually link /home/jtel/shared

Finally, link the /home/jtel/shared folder. 

Translations Ignore
Code Block
titlelink /home/jtel/shared
ln -s /srv/jtel/shared /home/jtel/shared

Setup Access to the Samba Server

jtel User Access

The following command creates the smb credentials for the jtel user.

Status
colourRed
titleCaution Password

Translations Ignore
Code Block
printf '<password>\n<password>\n' | smbpasswd -a -s jtel

Further User Access

If necessary, add further users to samba - replacing password with the actual password for the user. Here, for example, the windows administrator user:

Status
colourRed
titleCaution Password

Translations Ignore
Code Block
useradd -m Administrator
printf '<password>\n<password>\n' | smbpasswd -a -s Administrator

Test the file mount

Finally, test the file mount from one of the other machines. Either by connecting to STORE, or by using the windows explorer to attach to \\acd-store\shared

Sv translation
languagede
True
EOFF


Setup SeLinux and the Firewall

The following command sets up selinux for the smb service and opens the necessary ports in the firewall:


Translations Ignore


Code Block
setsebool -P samba_enable_home_dirs=on samba_export_all_rw=on use_samba_home_dirs=on use_nfs_home_dirs=on
firewall-cmd --zone=public --add-port=445/tcp --add-port=139/tcp --add-port=138/udp --add-port=137/udp --permanent
firewall-cmd --reload


Enable and Start Samba

The following commands setup the SMB and NMB services to autostart, and start them.

Translations Ignore


Code Block
systemctl enable nmb
systemctl enable smb
systemctl start nmb
systemctl start smb


Manually link /home/jtel/shared

Finally, link the /home/jtel/shared folder. 

Translations Ignore


Code Block
ln -s /srv/jtel/shared /home/jtel/shared


Setup Access to the Samba Server

jtel User Access

The following command creates the smb credentials for the jtel user.

Status
colourRed
titleCaution Password

Translations Ignore


Code Block
printf '<password>\n<password>\n' | smbpasswd -a -s jtel


Further User Access

If necessary, add further users to samba - replacing password with the actual password for the user. Here, for example, the windows administrator user:

Status
colourRed
titleCaution Password

Translations Ignore


Code Block
useradd -m Administrator
printf '<password>\n<password>\n' | smbpasswd -a -s Administrator


Test the file mount

Finally, test the file mount from one of the other machines. Either by connecting to STORE, or by using the windows explorer to attach to \\acd-store\shared



Sv translation
languagede

Status
colourRed
titleTHIS PAGE IS ONLY AVAILABLE IN ENGLISH

Sv translation
languagefr

Créez la magasin avec LVM

Il est recommandé de créer la machine MAGASIN sans que le disque de stockage soit monté par les routines d'installation. 

Commandes utiles

Les commandes suivantes sont utiles pour voir la configuration actuelle de la machine,

Translations Ignore


Code Block
languagebash
# Afficher l'espace libre sur les périphériques existantsdf -h# Afficher les disques /dev/sd*# Afficher les partitionsfdisk -l# Afficher les partitions /dev/sd*# Re-balayer le bus SCSI "- - -" > /sys/class/scsi_host/host0/scanecho "- - -" > /sys/class/scsi_host/host1/scanecho "- - -" > /sys/class/scsi_host/host2/scan...# Afficher les volumes physiques gérés par LVMlvm pvs# Afficher les volumes logiques gérés par LVMlvm lvs# Afficher les groupes de volumes logiques gérés par LVMlvm vgs# Où se trouve la monture


Certaines des informations ci-dessus peuvent être nécessaires pour terminer l'installation.

Il est important de savoir où se trouve le disque à utiliser, et où se trouve l'espace. 

En général, nous recommandons d'ajouter un deuxième lecteur de disque à la machine pour le stockage. 

Ce qui suit suppose que le disque a été ajouté en tant que /dev/sdb sur la machine, et n'est pas encore partitionné. 

Si ce n'est pas le cas, ou si le disque n'est pas /dev/sdb ou l'espace a été ajouté à une partition existante, alors les commandes ci-dessous devront être (soigneusement) modifiées pour en tenir compte.

Étapes de la création

Créer une partition

Erstellen des Stores mit LVM

Die meisten Linux / CentOS Installationen von uns arbeiten mit LVM. Diese Anleitung beschreibt, wie die Rolle STORE auf ein System mittels LVM installiert werden kann.

Schritt 1 - Feststellen der aktuellen config

Translations Ignore
Code Block
languagebash
titleDisplay of discs
# Show free space
df -h
# Partitionen anzeigen
fdisk -l
# Show partitions
ls /dev/sd*
# If the disk cannot yet be seen, re-scan the SCSI bus
echo "- - -" > /sys/class/scsi_host/host0/scan
# View physical volumes managed by LVM
lvm pvs
# Display logical volumes managed by LVM
lvm lvs
# Display logical volume groups managed by LVM
lvm vgs
# Where is what mounted
mount

Die Informationen oben werden nun gebraucht. Die Konfiguration sollte geprüft werden, nicht das bereits ein LVM für das Storage vorgesehen ist.

Schritt 2 - Anlegen einer neuen Partition

Hier ist es erforderlich, dass man weiß, wo der zusätzlicher Platz zu finden ist. Es gibt 2 Varianten - entweder eine neue Platte, oder eine erweiterte Platte. 

In beiden Fällen, wird eine neue Partition angelegt. Hier in diesen Beispiel, wurde eine neue Platte genutzt, die auf /dev/sdb zu finden ist.

Die Befehle unten sowie die Partitionsnummer (bei einer vorhandenen Platte ist die Partition dann nicht mehr zwingend 1), entsprechend anpassen.

Display of discs


Translations Ignore


Code Block
title
languagebashPartitioning with
fdisk
fdisk /dev/sdb
 
 # --> EditModifier theles partitions onsur /dev/sda
 
n
sdb n # --> CreateCréer newune nouvelle partition
 p
 # --> Nouvelle Newpartition primaryprimaire partition
1
 # --> Créer Createune newnouvelle partition 1 (viewvoir la outputsortie atsur fdisk -1 above)
Enter
ci-dessus) Entrer # --> Confirmer Confirmationque thatle thepremier firstcylindre availabledisponible cylinderdoit shouldêtre be used
Enter
utilisé Entrer # --> ConfirmationConfirmer thatque thele lastdernier availablecylindre cylinderdisponible isdoit toêtre be usedutilisé (givesdonne thela maximumtaille sizemaximale inau total)
 t
 # --> ChangeModifier le type de partition type
8e
 # --> LVM Linux LVM
w
 # --> When OK, write
 
reboot now

Schritt 3 - Hereinnahme in LVM - Device Erzeugen

Translations Ignore
Quand c'est bon, écrire


Créer un volume physique de LVM

Cette commande crée un volume physique qui peut être géré par LVM.

Les commandes ci-dessus auront créé une partition /dev/sdb1. Si vous travaillez sur une autre partition, modifiez en conséquence.

Translations Ignore


Code Block
languagebash
lvm pvcreate /dev/sdb1


Créer un Group Volume

Cette commande crée un groupe de volume appelé vg_jtelshared. Le groupe de volumes peut être élargi ultérieurement, en ajoutant d'autres volumes physiques. 

Translations Ignore


Code Block
languagebash
lvm vgcreate "vg_jtelshared" /dev/sdb1


Créer un volume logique

Enfin, un volume logique lv_jtelshared est créé sur le groupe de volume qui contient l'espace agrégé.

Code Block
languagebash
titleCreate device for LVM
# Here is the previous edition of /dev/sd* --> this is the new record (the 1st partition on /dev/sdb, i.e. the second hard disk, newly created partition)
lvm pvcreate /dev/sdb1

Schritt 4 - Volume Group anlegen

Translations Ignore


Code Block
languagebash
titleCreate LVM
lvm vgcreate "vg_jtelshared" /dev/sdb1

Schritt 5 - Logical Volume anlegen

Translations Ignore
Code Block
languagebash
titleCreate LVM
lvm lvcreate -l +100%FREE vg_jtelshared -n lv_jtelshared

Schritt 6 - File System erzeugen


Créer un système de fichiers

Maintenant, le système de fichiers est créé. Ici, nous utilisons xfs, mais vous pouvez utiliser autre chose si vous le souhaitez vraiment.

Translations Ignore
Translations Ignore


Code Block
languagebash
titleCreate file system
mkfs.xfs -L data /dev/vg_jtelshared/lv_jtelshared

Schritt 7 - Mount Point vorbereiten


Préparer le point de montage

Les données doivent être montées dans le répertoire /srv/jtel/shared.

Les commandes suivants s'y préparent :

Translations Ignore


Code Block
languagebash
mkdir
Translations Ignore
Code Block
languagebash
titlePrepare mount point
mkdir /srv/jtel
 mkdir /srv/jtel/shared 
 chown -R jtel:jtel /srv/jtel/shared

Schritt 8 - Mount Point in fstab festlegen und mounten


Ajouter à la fstab de Monture en Boot

Ce qui suit ajoute une ligne à fstab pour monter le système de fichiers au démarrage fstab Eintrag :

Translations Ignore


Code Block
languagebash
titlevi /etc/fstab
vicat <<EOFF >> /etc/fstab
...
(add the following line)
 
/dev/mapper/vg_jtelshared-lv_jtelshared /srv/jtel/shared        xfs     defaults 0 0  0
Und mounten:
EOFF


Monter le système de fichiers

Translations Ignore


Code Block
languagebashtitlemount
mount /srv/jtel/shared
Schritt 9 - Zwischenergebnis prüfen


Vérifications

Translations Ignore


Code Block
languagebash
titleCheck final result
df -h
Es sollte ein Eintrag für 


Il devrait y avoir une entrée pour /srv/jtel/shared

 existieren mit entsprechend freier Platz. 

avec la quantité d'espace libre prévue.

Installer et configurer l'accès au MAGASIN

Installer SAMBA

Ces commandes installent le serveur et le client samba et lsof.

Install Samba and lsof

Translations Ignore


Code Block
titleInstall SAMBA
yumdnf -y install samba samba-client lsof
Configure


Configurer Samba

Ce qui suit crée un fichier de configuration samba avec une configuration minimale.

Translations Ignore


Code Block
titleConfigure SAMBA
# SMB Conf cat <<EOFF > /etc/samba/smb.conf
 [global]
 workgroup = JTEL security = user passdb workgroupbackend = SAMBA
tdbsam min protocol = SMB3 reset on zero securityvc = user
yes [shared] comment = jtel ACD Shared Directory passdbpublic backend = tdbsam
no read only = no writable = yes printinglocking = cups
yes path = /srv/jtel/shared create mask = 0644 printcapdirectory namemask = cups
0755        load printers = yes
        cups options = raw
        min protocol = NT1
        ntlm auth = yes

[homes]
        comment = Home Directories
        valid users = %S, %D%w%S
        browseable = No
        read only = No
        inherit acls = Yes

[printers]
        comment = All Printers
        path = /var/tmp
        printable = Yes
        create mask = 0600
        browseable = No

[print$]
        comment = Printer Drivers
        path = /var/lib/samba/drivers
        write list = root
        create mask = 0664
        directory mask = 0775

[shared]
    comment = jtel ACD Shared Directory
    read only = no
    public = yes
    writable = yes
    locking = yes
    path = /srv/jtel/shared
    guest ok = yes
    create mask = 0644
    directory mask = 0755
    force user = jtel
    force group = jtel
    acl allow execute always = True

EOFF
sed -i -e "s/MYGROUP/WORKGROUP/g" /etc/samba/smb.conf

Setup SeLinux, jtel User access and Firewall for Samba

Replace <password> with the password for the jtel user:

Translations Ignore
Code Block
titleSeLinux, jtel User, Firewall
setsebool -P samba_enable_home_dirs=on samba_export_all_rw=on use_samba_home_dirs=on use_nfs_home_dirs=on
printf '<password>\n<password>\n' | smbpasswd -a -s jtel
firewall-cmd --zone=public --add-port=445/tcp --add-port=139/tcp --add-port=138/udp --add-port=137/udp --permanent
firewall-cmd --reload
force user = jtel force group = jtel acl allow execute always = True EOFF


Configuration de SeLinux et du pare-feu

La commande suivante configure selinux pour le service smb et ouvre les ports nécessaires dans le pare-feu :


Translations Ignore


Code Block
setsebool -P samba_enable_home_dirs=on samba_export_all_rw=on use_samba_home_dirs=on use_nfs_home_dirs=on firewall-cmd --zone=public --add-port=445/tcp --add-port=139/tcp --add-port=138/udp --add-port=137/udp --permanent firewall-cmd --reload


Activer et démarrer Samba

Les commandes suivantes permettent de configurer les services SMB et NMB pour un démarrage automatique, et de les démarrer.

Translations Ignore


Code Block
systemctl enable nmb systemctl enable smb systemctl start nmb systemctl start smb


Lien manuel /home/jtel/partagé

Enfin, liez le dossier /home/jtel/shared. 

Translations Ignore


Code Block
ln -s /srv/jtel/shared /home/jtel/shared


Configuration de l'accès au serveur Samba

accès des utilisateurs à jtel

La commande suivante crée les identifiants smb pour l'utilisateur jtel.

Status
colourRed
titleMot de passe de précaution

Translations Ignore


Code Block

If necessary, add further users to samba - replacing password with the actual password for the user. Here, for example, the windows administrator user:

Translations Ignore
Code Block
titleMore SAMBA users
useradd -m Administrator
printf '<password>\n<password>\n' | smbpasswd -a -s Administrator

Test SAMBA

Translations Ignore
Code Block
titleStart SAMBA
systemctl enable nmb
systemctl enable smb
systemctl start nmb
systemctl start smb

Manually link /home/jtel/shared

Translations Ignore
 -s jtel 


Accès supplémentaire pour les utilisateurs

Si nécessaire, ajoutez d'autres utilisateurs à samba - en remplaçant le mot de passe par le mot de passe réel de l'utilisateur. Ici, par exemple, l'utilisateur administrateur de Windows :

Status
colourRed
titleMot de passe de précaution

Translations Ignore


Code Block
useradd -m Administrator printf '<password>\n<password>\n' | smbpasswd -a -s Administrator 


Testerla monture de fichier

Code Block
titlelink /home/jtel/shared
ln -s /srv/jtel/shared /home/jtel/shared

Test the file mount

Translations Ignore Code Block
titleTest file mount
# From the windows machines:   dir

Enfin, testez le montage de fichiers à partir d'une des autres machines. Soit en vous connectant à MAGASIN, soit en utilisant l'explorateur Windows pour joindre à

\\acd-store\shared