Created
July 21, 2024 15:14
-
-
Save slackingfred/c3058270a0fa53fe97e9ca773d28656f to your computer and use it in GitHub Desktop.
Systemd config to create swap file in Azure ephemeral volume (B1s and some other instance types, but not all) -- adapted from zram.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Swap with ephemeral volume | |
After=multi-user.target | |
[Service] | |
Type=oneshot | |
RemainAfterExit=true | |
ExecStartPre=/bin/fallocate -l 2560M /mnt/Win386.swp | |
ExecStartPre=/bin/chmod 0600 /mnt/Win386.swp | |
ExecStartPre=/sbin/mkswap /mnt/Win386.swp | |
ExecStart=/sbin/swapon /mnt/Win386.swp | |
ExecStop=/sbin/swapoff /mnt/Win386.swp | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment