Hi!
After successfully adding a proxmox5 Node to my cluster, i adapted the udev rules (/etc/udev/rules.d) to what the old server with PROXMOX 4 was configured.
I have 3 USB HDD's used for copying Backups to a second location. My udev rule is this one
##################################################################################
# Part 1: decrypt the backupdisk once it gets plugged in
##################################################################################
#ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", ATTRS{serial}=="57583131443236483452504B", \
RUN+="/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen $env{DEVNAME} backup-crypt"
#ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", ATTRS{serial}=="5758313144343643484B4541", \
RUN+="/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen $env{DEVNAME} backup-crypt"
#ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", ATTRS{serial}=="57584C314831363038503853", \
RUN+="/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen $env{DEVNAME} backup-crypt"
##################################################################################
# Part 2: as soon as the crypt container is opened, mount the filesystem inside it
##################################################################################
# we (also) match on change because the device name is known only after some time
ACTION=="add|change", SUBSYSTEM=="block", ENV{DM_NAME}=="backup-crypt", \
RUN+="/bin/mount /dev/mapper/$env{DM_NAME}"
This rule is working on a proxmox 4 node, but on a proxmox 5 node i get errors like this:
Mar 20 15:15:00 PROX5-1 systemd-udevd[104185]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104189]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104208]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104192]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104190]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104194]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104196]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104198]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104200]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
They are repeated endlessly. I can only stop it by restarting udev service.
I already tried a fsck, but the disk is ok. Can someone please tell me why udev does not work anymore?
Or another way to automount an encrypted USb Disk when plugging in??
Thank you
After successfully adding a proxmox5 Node to my cluster, i adapted the udev rules (/etc/udev/rules.d) to what the old server with PROXMOX 4 was configured.
I have 3 USB HDD's used for copying Backups to a second location. My udev rule is this one
##################################################################################
# Part 1: decrypt the backupdisk once it gets plugged in
##################################################################################
#ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", ATTRS{serial}=="57583131443236483452504B", \
RUN+="/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen $env{DEVNAME} backup-crypt"
#ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", ATTRS{serial}=="5758313144343643484B4541", \
RUN+="/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen $env{DEVNAME} backup-crypt"
#ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", ATTRS{serial}=="57584C314831363038503853", \
RUN+="/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen $env{DEVNAME} backup-crypt"
##################################################################################
# Part 2: as soon as the crypt container is opened, mount the filesystem inside it
##################################################################################
# we (also) match on change because the device name is known only after some time
ACTION=="add|change", SUBSYSTEM=="block", ENV{DM_NAME}=="backup-crypt", \
RUN+="/bin/mount /dev/mapper/$env{DM_NAME}"
This rule is working on a proxmox 4 node, but on a proxmox 5 node i get errors like this:
Mar 20 15:15:00 PROX5-1 systemd-udevd[104185]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104189]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104208]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104192]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104190]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104194]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104196]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104198]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
Mar 20 15:15:00 PROX5-1 systemd-udevd[104200]: Process '/sbin/cryptsetup --key-file /root/keyfiles/backup-hdd luksOpen backup-crypt' failed with exit code 1.
They are repeated endlessly. I can only stop it by restarting udev service.
I already tried a fsck, but the disk is ok. Can someone please tell me why udev does not work anymore?
Or another way to automount an encrypted USb Disk when plugging in??
Thank you