Outils pour utilisateurs

Outils du site


blog

Sauvegarder son système à chaud grâce à Mondorescue

Voir : MondoRescue

Installation

/etc/apt/sources.list.d/mondo.list

deb ftp://ftp.mondorescue.org//debian 7 contrib
deb-src ftp://ftp.mondorescue.org//debian 7 contrib
Utilisation

Exemple de sauvegarde en ligne de commande

#mondoarchive -OV -i -N -g -d /var/backup -T /var/tmp -S /var/tmp -E "/var/lib/mysql|/var/backup|/var/webapps" -s 4480m -p $HOSTNAME
 
mondoarchive -k /boot/vmlinuz-$(uname -r) -OV -i -N -g -d /backup -T /tmp -S /tmp -E "/home|/media|/var/cache|/var/tmp|/run|/mnt" -s 4480m -p $HOSTNAME
Autre

i-want-my-lvm

/sbin/lvmdiskscan
/sbin/lvm
i=2
LVM version >= 2.0 found.
Just before you extrapolate mountlist to include RAID partitions,
extrapolate it to include the following LVM drives and partitions:-
>>>>> /dev/sda5 
To get started, type:-
(insmod dm-mod)
(insmod dm_mod)
# lvm vgchange -an
# echo y | lvm pvcreate -ff /dev/sda5
# lvm vgscan

Create and activate the VG's (volume groups).
# lvm vgcreate root-vg -l 0 -p 0 -s 4.00m /dev/sda5 
# lvm vgchange -a y root-vg

Finally, create the LV's (logical volumes).
# lvm lvcreate -L 4096m -r auto -n lv_root root-vg
# lvm lvcreate -L 1024m -r auto -n lv_swap root-vg
# lvm lvcreate -L 10240m -r auto -n lv_home root-vg
# lvm lvcreate -L 3072m -r auto -n lv_tmp root-vg
# lvm lvcreate -L 6144m -r auto -n lv_usr root-vg
# lvm lvcreate -L 6144m -r auto -n lv_var root-vg
# lvm lvcreate -L 12288m -r auto -n lv_opt root-vg

# lvm vgscan
Now you may format the LV's:-
(mkfs -t foo /dev/root-vg/lv_root or something like that)
(mkfs -t foo /dev/root-vg/lv_swap or something like that)
(mkfs -t foo /dev/root-vg/lv_home or something like that)
(mkfs -t foo /dev/root-vg/lv_tmp or something like that)
(mkfs -t foo /dev/root-vg/lv_usr or something like that)
(mkfs -t foo /dev/root-vg/lv_var or something like that)
(mkfs -t foo /dev/root-vg/lv_opt or something like that)

Finally, to shut down and delete the volumes, do this:-
(lvm lvremove -f /dev/root-vg/lv_root)
(lvm lvremove -f /dev/root-vg/lv_swap)
(lvm lvremove -f /dev/root-vg/lv_home)
(lvm lvremove -f /dev/root-vg/lv_tmp)
(lvm lvremove -f /dev/root-vg/lv_usr)
(lvm lvremove -f /dev/root-vg/lv_var)
(lvm lvremove -f /dev/root-vg/lv_opt)
(lvm vgchange -a n root-vg)
(lvm vgremove root-vg)
(rmmod dm-mod & rmmod dm_mod & )
2025/03/24 15:06

Ansible AWS - Cloud

Voir : Pourquoi ansible n’est pas un bon choix pour créer son infra AWS

~/.boto

[Credentials]
aws_access_key_id = 01234ABC
aws_secret_access_key = 01234ABC
 
[Boto]
debug = 0
 
proxy = 192.168.56.1
proxy_port = 3128
#ec2_region_name = us-east-2
#ec2_region_endpoint = ec2.us-east-2.amazonaws.com

~/.aws/credentials

[default]
aws_access_key_id = 01234ABC
aws_secret_access_key = 01234ABC

~/.aws/config

[default]
#region = us-west-2
region = us-east-2
output = table

pb.yml

#! /usr/bin/env ansible-playbook
 
---

- name: Configure new server
  hosts: localhost

  vars:
    ansible_python_interpreter: /usr/bin/python3

  roles:
    - aws

roles/aws/tasks/main.yml

---

- ec2_instance:
    name: "test-ansible"
    key_name: "jean@vmdeb1"
    #vpc_subnet_id: subnet-5ca1ab1e
    instance_type: t2.micro
    #security_group: default
    security_group: 'sg-018f964b5b82d2361'
    network:
      assign_public_ip: true
    image_id: ami-05829248ffee66250
  register: new_ec2_instance

- name: DEBUG
  debug: var=new_ec2_instance.instances[0].network_interfaces[0].association.public_ip
 
2025/03/24 15:06

Pare-feu iptables openwrt IPV4

Note : iptables est remplacé maintenant par nftables

Voir aussi :

Pour ICMP voir icmp.txt

TODO : Copie sur git

#!/bin/sh
#
# rc.icmp	Advanced ICMP Filtering with iptables
#
# Version Hx:	$Id: rc.icmp,v 1.00 2003/01/28 09:04:10 david Exp $
# 		$Id: rc.icmp,v 1.01 2013/09/07 16:59:38 david Exp $
#
 
################################################################
#                                                              #
# Internet Control Message Protocol (ICMP), documented in RFC  #
# 792, is a required protocol tightly integrated with IP. ICMP #
# messages, delivered in IP packets, are used for out-of-band  #
# messages related to network operation or misoperation. Since #
# ICMP relies on IP, packet delivery is unreliable (as         #
# opposed to TCP).                                             #
#                                                              #
# ICMP functions typically include :                           #
#   - Announce network errors                                  #
#   - Announce network congestion (source quench)              #
#   - Assist troubleshooting (ping)                            #
#   - Announce timeouts (traceroute)                           # 
#                                                              #
# Be cautious; blocking ICMP can have unpredictable results.   #
# You may find that your TCP/IP connectivity may break.        #
#                                                              #
# A good resource for ICMP filtering can be found at:          #
# www.oregontechsupport.com/articles/ICMP_Scanning_v3.0.pdf    #
#                                                              #
# Netfilter (iptables) can implement the ICMP Extension by     #
# name (e.g., "host unreachable"), numeric type (e.g., "3"),   #
# or a numeric type and code separated by a "/" (e.g., "3/3"). #
################################################################
 
################################################################
# ICMP echo-reply (type 0)                                     #
#                                                              #
# Ping scanning is typically used to determine which hosts on  #
# a network are up. Typically this is done by sending ICMP     #
# ECHO request packets to the target host.                     #
################################################################
iptables -A OUTPUT -p icmp --icmp-type 0 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type 0 -j ACCEPT
iptables -A FORWARD -p icmp --icmp-type 0 -j ACCEPT
 
################################################################
# ICMP types 1-2 are unassigned                                #
################################################################
 
################################################################
# ICMP destination-unreachable (type 3)                        #
#                                                              #
# Filtering "fragmentation-needed" traffic is a BAD idea.      #
#                                                              #
# Codes                                                        #
#   0  network-unreachable                                     #
#   1  host-unreachable                                        #
#   2  protocol-unreachable                                    #
#   3  port-unreachable                                        #
#   4  fragmentation-needed                                    #
#   5  source-route-failed                                     #
#   6  network-unknown                                         #
#   7  host-unknown                                            #
#   8  Source Host Isolated                                    #
#   9  network-prohibited                                      #
#   10  host-prohibited                                        #
#   11  TOS-network-unreachable                                #
#   12  TOS-host-unreachable                                   #
#   13  communication-prohibited [RFC1812]                     #
#   14  host-precedence-violation [RFC1812]                    #
#   15  precedence-cutoff [RFC1812]                            #
################################################################
 
iptables -A INPUT -p icmp --icmp-type 3/4 -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type 3/4 -j ACCEPT
iptables -A FORWARD -p icmp --icmp-type 3/4 -j ACCEPT
 
iptables -A FORWARD -p icmp --icmp-type 3/3 -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type 3/3 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type 3/3 -j ACCEPT
 
iptables -A FORWARD -p icmp --icmp-type 3/1 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type 3/1 -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type 3/1 -j ACCEPT
 
################################################################
# ICMP Source Quench (type 4)                                  #
#                                                              #
# This is detailed in RFC 792.  Filtering this type of         #
# traffic is generally considered a BAD idea.                  #
################################################################
 
iptables -A INPUT -p icmp --icmp-type 4 -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type 4 -j ACCEPT
iptables -A FORWARD -p icmp --icmp-type 4 -j ACCEPT
 
################################################################
# ICMP Redirect (type 5)                                       #
#                                                              #
# Codes                                                        #
#   0  Redirect Datagram for the Network (or subnet)           #
#   1  Redirect Datagram for the Host                          #
#   2  Redirect Datagram for the Type of Service and Network   #
#   3  Redirect Datagram for the Type of Service and Host      #
################################################################
 
if [ -f /proc/sys/net/ipv4/conf/all/accept_redirects ]; then
	echo "   Kernel ignores all ICMP redirects"
	echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects
fi
 
################################################################
# ICMP Alternate Host Address (type 6)                         #
# ICMP Unassigned (type 7)                                     #
################################################################
 
################################################################
# ICMP Echo Request (type 8)                                   #
################################################################
 
iptables -A INPUT -p icmp --icmp-type 8 -m limit --limit 2/s -j ACCEPT
iptables -A INPUT -p icmp --icmp-type 8 -j LOG --log-prefix "ICMP/in/8 Excessive: "
iptables -A INPUT -p icmp --icmp-type 8 -j DROP
iptables -A OUTPUT -p icmp --icmp-type 8 -j ACCEPT
iptables -A FORWARD -p icmp --icmp-type 8 -j ACCEPT
 
if [ -f /proc/sys/net/ipv4/icmp_echo_ignore_all ]; then
   echo "   Kernel answers ICMP Echo requests"
   echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all
fi
 
################################################################
# Prevention: Smurf IP Denial-of-Service Attacks               #
#                                                              #
# See http://www.cert.org/advisories/CA-1998-01.html           #
################################################################
 
if [ -f /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts ]; then
   echo "   Kernel ignores ICMP Echo requests sent to broadcast/multicast addresses"
   echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
fi
 
################################################################
# ICMP Router Advertisement (type 9)                           #
# ICMP Router Solicitation (type 10)                           #
#                                                              #
# These are described in RFC 1256.                             #
################################################################
 
################################################################
# ICMP Time Exceeded (type 11)                                 #
#                                                              #
# Codes                                                        #
#   0  Time to Live exceeded in Transit                        #
#   1  Fragment Reassembly Time Exceeded                       #
################################################################
 
iptables -A INPUT -p icmp --icmp-type 11 -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type 11 -j ACCEPT
iptables -A FORWARD -p icmp --icmp-type 11 -j ACCEPT
 
################################################################
# ICMP Parameter Problem (type 12)                             #
#                                                              #
# Codes                                                        #
#   0  Pointer indicates the error                             #
#   1  Missing a Required Option [RFC1108]                     #
#   2  Bad Length                                              # 
################################################################
 
iptables -A INPUT -p icmp --icmp-type 12 -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type 12 -j ACCEPT
iptables -A FORWARD -p icmp --icmp-type 12 -j ACCEPT
 
################################################################
# ICMP Timestamp (type 13)                                     #
# ICMP Timestamp Reply (type 14)                               #
# ICMP Information Request (type 15)                           #
# ICMP Information Reply (type 16)                             #
# ICMP Address Mask Request (type 17)                          #
# ICMP Address Mask Reply (type 18)                            #
# ICMP Reserved (types 19-29)                                  #
# ICMP Traceroute (type 30)                                    #
# ICMP Datagram Conversion Error (type 31)                     #
################################################################
 
################################################################
# ICMP bogus error responses                                   #
#                                                              #
# Sometimes you will come across routers that send out invalid #
# responses to broadcast frames. This is a violation of RFC    #
# 1122, "Requirements for Internet Hosts -- Communication      #
# Layers". As a result, these events are logged by the kernel. #
# To avoid filling up your logfile with unnecessary clutter,   #
# you can tell the kernel not to issue these warnings.         #
################################################################
 
if [ -f /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses ]; then
   echo "   Kernel ignores bogus responses to broadcast frames"
   echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
fi
 
################################################################
# ICMP Catch-all                                               #
#                                                              #
# There are many more ICMP types than this, but most aren't    #
# implemented in large-scale (yet).  We can safely say that    #
# anything not specifically allowed above should be blocked.   #
################################################################
 
iptables -A INPUT -p icmp -m limit -j LOG --log-prefix "ICMP/IN: "
iptables -A OUTPUT -p icmp -m limit -j LOG --log-prefix "ICMP/OUT: "
iptables -A FORWARD -p icmp -m limit -j LOG --log-prefix "ICMP/FWD: "
iptables -A INPUT -p icmp -j DROP
iptables -A OUTPUT -p icmp -j DROP
iptables -A FORWARD -p icmp -j DROP 
 
################################################################
# This document was lovingly handcrafted on a Dell Latitude    #
# C400 laptop running Slackware Linux 8.1, in case anyone      #
# asks.                                                        #
################################################################
 
# This work is licensed under a Creative 
# Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License, 
# available at http://creativecommons.org/licenses/by-nc-nd/3.0/
2025/03/24 15:06

DRAFT Oops j'ai fait un boulette

Exemple de connerie 1
chown -R oracle:dba /

Comment la rattraper (en ajustant ctime & mtime par les valeurs qu'il est possible de trouver avec la commande stat) :

Pour info : Différence en CTIME (change time) et MTIME (modification time)

Voir aussi :

man ls
  [--time={atime,access,use,ctime,status}]
$ cat foo
Hello, World

Met à jour atime (access time), mais pas ctime (change time) ni mtime (modification time)

chmod 777 foo

Met à jour ctime mais pas atime ni mtime. Car le fichier n'est pas modifié, seulement les métadonnées (droits)

echo "Goodbye, World!" > foo

Met à jour ctime et mtime mais pas atime.

Machine de référence

find / ! -wholename "/proc/*" -type f -fprintf jbset_f.sh "chown %u:%g \"%p\" \n" 
find / ! -wholename "/proc/*" -type d -fprintf jbset_d.sh "chown %u:%g \"%p\" \n" 
find / ! -wholename "/proc/*" -type l -fprintf jbset_l.sh "chown -h %u:%g \"%p\" \n" 
find / ! -wholename "/proc/*" ! -type d -a ! -type f -a ! -type l -fprintf jbset_o.sh "chown %u:%g \"%p\" \n" 
find / ! -wholename "/proc/*" -type f -perm /u+s -fprintf jbset_suid.sh "chmod %m \"%p\" \n" 
find / ! -wholename "/proc/*" -type f -perm /g+s -fprintf jbset_guid.sh "chmod %m \"%p\" \n"

Machine à corriger

bash jbset_f.sh 2>jbset_f.err
bash jbset_d.sh 2>jbset_d.err
bash jbset_l.sh 2>jbset_l.err
bash jbset_o.sh 2>jbset_o.err

On repositionne les SUID & GUID.

bash jbset_suid.sh 2>jbset_suid.err
bash jbset_guid.sh 2>jbset_guid.err

On jete un petit coup d'oeil sur les logs

cat *.err | grep -v "No such file or directory"

Fichiers restants à modifier

find / -ctime -1 -mtime +2 -user oracle -group dba

Root propriétaire des fichiers restants

find / -ctime -1 -mtime +2 -user oracle -group dba -type f ! -iname "*oracle*" ! -iwholename "*oracle*"  -print0 |xargs -0 chown root:root
find / -ctime -1 -mtime +2 -user oracle -group dba -type d ! -iname "*oracle*" ! -iwholename "*oracle*"  -print0 |xargs -0 chown root:root
find / -ctime -1 -mtime +2 -user oracle -group dba -type l ! -iname "*oracle*" ! -iwholename "*oracle*"  -print0 |xargs -0 chown -h root:root

On jete un coup d'oeil :

find / -user oracle -group dba | grep -iv oracle

Un reboot est nécessaire pour les devices de type char/block/socket de /proc /dev /sys.

Il faudra (peut-être) redéfinir les droits Oracle tel que initialement prévu.

Exemple de connerie 2
chmod -R 777 /etc

Comment la rattraper :

find /etc/ ! -type l ! -type d -exec ls -l {} \; | awk '    
{ u=substr($1,2,3); gsub("\-","",u);
  g=substr($1,5,3); gsub("\-","",g);
  o=substr($1,8,3); gsub("\-","",o);
  print "chmod u="u",g="g",o="o,$NF
}' >/tmp/liste.ksh
 
find /etc/ -type d -exec ls -ld {} \; | awk '
{ u=substr($1,2,3); gsub("\-","",u);
  g=substr($1,5,3); gsub("\-","",g);
  o=substr($1,8,3); gsub("\-","",o);
  print "chmod u="u",g="g",o="o,$NF
}' >>/tmp/liste.ksh
2025/03/24 15:06

NFSv4 sous Debian

Protocole

Voir :

Étape Date Réf Création 1984 NFSv2 1989 RFC 1094 NFSv3 1995 RFC 1813 NFSv4 2003 RFC 3530 NFSv4.1 2010 RFC 5661 NFSv4.2 2016 RFC 7862

En NFSv4 contrairement aux versions précédentes seul le port TCP 2049 suffit

Sur le serveur

cat /proc/fs/nfsd/versions
+2 +3 +4 +4.1 -4.2
apt-get install nfs-kernel-server
lsmod  | grep nfs
nfsv4                 410783  1 
dns_resolver           12641  1 nfsv4
nfsd                  263032  13 
auth_rpcgss            51211  2 nfsd,rpcsec_gss_krb5
nfs_acl                12511  1 nfsd
nfs                   188136  2 nfsv4
lockd                  83389  2 nfs,nfsd
fscache                45542  2 nfs,nfsv4
sunrpc                237402  33 nfs,nfsd,rpcsec_gss_krb5,auth_rpcgss,lockd,nfsv4,nfs_acl

/etc/default/nfs-common

NEED_STATD=no
STATDOPTS=
NEED_GSSD=no
 
# Nécessaire que si mapping d'utilisateur en NFSv4
NEED_IDMAPD=no

/etc/default/nfs-kernel-server

# /usr/sbin/rpc.mountd --manage-gids -N 2 -N 3 -V 4 -V 4.1
# man rpc.mountd
#RPCMOUNTDOPTS="--manage-gids"
RPCMOUNTDOPTS="--manage-gids -N 2 -N 3 -V 4 -V 4.1"

/etc/exports

# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#
/export         192.168.1.0/24(rw,sync,fsid=0,crossmnt,no_subtree_check) 127.0.0.1(rw,sync,fsid=0,crossmnt,no_subtree_check)
/export/partage 192.168.1.0/24(rw,sync,nohide,insecure,no_subtree_check) 127.0.0.1(rw,sync,nohide,insecure,no_subtree_check)
chown jean: /export/partage/

Après avoir modifié le fichier /etc/exports

exportfs -ra
killall rpc.statd
service nfs-common restart
service nfs-kernel-server restart

Notes : pour une base de donnée Postgres sur le serveur il faut absolument mettre l'option hard et il est recommandé de mettre coté serveur sync

The only firm requirement for using NFS with PostgreSQL is that the file system is mounted using the hard option. With the hard option, processes can “hang” indefinitely if there are network problems, so this configuration will require a careful monitoring setup. The soft option will interrupt system calls in case of network problems, but PostgreSQL will not repeat system calls interrupted in this way, so any such interruption will result in an I/O error being reported.

It is not necessary to use the sync mount option. The behavior of the async option is sufficient, since PostgreSQL issues fsync calls at appropriate times to flush the write caches. (This is analogous to how it works on a local file system.) However, it is strongly recommended to use the sync export option on the NFS server on systems where it exists (mainly Linux). Otherwise, an fsync or equivalent on the NFS client is not actually guaranteed to reach permanent storage on the server, which could cause corruption similar to running with the parameter fsync off. The defaults of these mount and export options differ between vendors and versions, so it is recommended to check and perhaps specify them explicitly in any case to avoid any ambiguity.

Source: https://www.postgresql.org/docs/current/creating-cluster.html

Sur le client

Voir : https://learn.microsoft.com/fr-fr/azure/azure-netapp-files/performance-linux-mount-options

apt-get install nfs-common
lsmod |grep nfs
nfsv4                 410783  1 
dns_resolver           12641  1 nfsv4
nfsd                  263032  2 
auth_rpcgss            51211  2 nfsd,rpcsec_gss_krb5
nfs_acl                12511  1 nfsd
nfs                   188136  2 nfsv4
lockd                  83389  2 nfs,nfsd
sunrpc                237402  14 nfs,nfsd,rpcsec_gss_krb5,auth_rpcgss,lockd,nfsv4,nfs_acl
fscache                45542  2 nfs,nfsv4

/etc/default/nfs-common

NEED_STATD=no
STATDOPTS=
NEED_GSSD=no
# Nécessaire que si mapping d'utilisateur en NFSv4
NEED_IDMAPD=no

/etc/fstab

192.168.1.10:/partage  /mnt/nfs nfs4    _netdev,noatime,bg,soft,rw,nodev,nosuid,noexec,noauto,proto=tcp,port=2049,vers=4.1,timeo=5,retrans=5,actimeo=10,retry=5  0  0
killall rpc.statd
systemctl disable rpcbind
service rpcbind stop
service nfs-common restart

Notes

Les uid des utilisateur doivent coïncider (sinon il est possible de mapper les utilisateurs sur le nom mais dans ce cas il faut activer Kerberos) Voir “you need to use Kerberos for the mapping to have any effect” https://help.ubuntu.com/community/NFSv4Howto Voir

  • /etc/idmapd.conf
  • rpc.mountd --manage-gids (RPCMOUNTDOPTS)
  • apt-get install nscd

Après avoir modifier /etc/idmap.conf faire

nfsidmap -c

Dans la conf actuelle, root ne peut pas écrire sur la partition NFS

Le service rpcbind semble nécessaire qu'une seul fois au lancement de nfs-kernel-server Sinon pas d'écoute sur le port TCP 2049. Semble possible sur RedHat Ho can I disable rpcbind on NFSv4-only servers

Voir /var/lib/nfs/

Disable rpcbind on NFS server (RedHat)

Source : https://www.spinics.net/linux/fedora/fedora-users/msg513100.html

systemctl mask --now rpc-statd.service rpcbind.service rpcbind.socket
systemctl restart nfs-server
Obtenir des info sur le montage / quelle version de NFS
nfsstat -m
Client Autofs

/etc/auto.master

/mnt/nfs        /etc/auto.nfs --ghost,--timeout=60

/etc/auto.nfs

partage  -fstype=nfs4,noatime,bg,soft,rw,nodev,nosuid,noexec,proto=tcp,port=2049,vers=4.1,timeo=5,retrans=5,actimeo=10,retry=5  192.168.1.10:/partage
Démonter une partition NFS en erreur
umount -lf /mnt/nfs
Liste des partages

Montez le répertoire / et observez son contenu.

# mount myserver:/ /mnt/
#cd /mnt/
exports
# ls exports
foo
bar
showmount -e 127.0.0.1

La commande showmount n'affiche que les exportations des versions 2 et 3 de NFS. \ Cependant si le serveur gère simultanément NFSv4 et NFSv3, cette méthode fonctionnera quand même.

Autres

Quel port le serveur écoute

# rpcinfo -p | grep nfs
rsize=8192,wsize=8192

Rationale: This issue is a bug on the NFS server that involves handling of delegations. NOTE: Disabling delegations may impact performance and depends on your workload. For more information, see What is the performance impact of disabling or enabling NFS4 delegations?. Disable delegations on the NFS server with the following commands:

echo 0 > /proc/sys/fs/leases-enable
sysctl -w fs.leases-enable=0

Diag

mount.nfs4 -v -o noauto,sec=sys,proto=tcp,port=2049,vers=4.2 127.0.0.1:/export/files /mnt/nfs/
mount -t nfs4 127.0.0.1:files /mnt/nfs/ -v
 
journalctl -u nfs-server -f
dmesg

Source https://access.redhat.com/solutions/3915571

tshark -Y 'tcp.port == 2049' -r tcpdump.pcap > tcpdump.txt
tshark -Y 'frame.number == 961595' -V -r tcpdump.pcap > tcpdump-frame-961595.txt
grep -A 30 SEQUENCE tcpdump-frame-961595.txt 
tshark -r tcpdump.pcap -Y 'rpc.msgtyp == 1 && nfs' | wc -l
tshark -r tcpdump.pcap -Y 'rpc.msgtyp == 1 && nfs.sequence.flags.recallable_state_revoked == 1' | wc -l

Err nfs-server.service is masked (RedHat)

# systemctl enable --now nfs-server.service
Failed to enable unit: Unit file /etc/systemd/system/nfs-server.service is masked.
# ls -l /etc/systemd/system/nfs-server.service
lrwxrwxrwx. 1 root root 9 Apr 24  2024 /etc/systemd/system/nfs-server.service -> /dev/null
# rm /etc/systemd/system/nfs-server.service
rm: remove symbolic link '/etc/systemd/system/nfs-server.service'? y
# systemctl enable --now nfs-server.service
Created symlink /etc/systemd/system/multi-user.target.wants/nfs-server.service → /usr/lib/systemd/system/nfs-server.service.
Job for nfs-server.service canceled.
2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki