Skip to content

Instantly share code, notes, and snippets.

@jdmedeiros
Created March 22, 2024 23:33
Show Gist options
  • Save jdmedeiros/3db0d2aa1e672273ab1c0e36ea2ec5e8 to your computer and use it in GitHub Desktop.
Save jdmedeiros/3db0d2aa1e672273ab1c0e36ea2ec5e8 to your computer and use it in GitHub Desktop.
Open-Mount and Unmount-Close LUKS RAID6 Volume
[Unit]
Description=Open-Mount and Unmount-Close LUKS RAID6 Volume
After=local-fs-pre.targe
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=-/bin/mkdir -p /mnt/raid6NoLVM
ExecStartPre=-/bin/umount /mnt/raid6NoLVM
ExecStart=/usr/lib/systemd/systemd-cryptsetup attach md0_crypt /dev/md0
ExecStart=/bin/mount /dev/mapper/md0_crypt /mnt/raid6NoLVM
ExecStop=/bin/umount /mnt/raid6NoLVM
ExecStopPost=-/usr/lib/systemd/systemd-cryptsetup detach md0_crypt
# Omitting [Install] section to keep the service manual-start only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment