Skip to content

Instantly share code, notes, and snippets.

@andreleoni
Created February 27, 2023 12:54
Show Gist options
  • Save andreleoni/5804ccd1f055f83dc757d1aa1bbe473d to your computer and use it in GitHub Desktop.
Save andreleoni/5804ccd1f055f83dc757d1aa1bbe473d to your computer and use it in GitHub Desktop.
Swapfile
# dd if=/dev/zero of=/swapfile bs=1M count=12k
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.23138 s, 872 MB/s
# losetup --find --show /swapfile
/dev/loop0
# mkswap /dev/loop0
Setting up swapspace version 1, size = 1024 MiB (1073737728 bytes)
no label, UUID=04b048e2-47ab-4ab0-a79e-7e1c481a10c9
# swapon /dev/loop0
@andreleoni
Copy link
Author

sudo swapon $(losetup --find --show /swapfile)

@andreleoni
Copy link
Author

sudo swapon $(sudo losetup --find --show /swapfile)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment