I've installed Debian Wheezy; after installation completed, I realized that I forgot to set the swap memory. So now, how can I configure the swap space?


Try this:

  1. Create a partition or RAID array or logical volume... (or use an existing one) for swap
  2. mkswap that partition
  3. Run blkid that-block-device
  4. Add an entry to /etc/fstab in the form UUID=7321174b-e4d8-4d9d-b223-113a1b8e9c9f swap swap sw 0 0 (see step 3 for actual UUID)
  5. swapon -a or reboot
  • 2
    You can also use a file instead of a partition. It's slower, but will get the job done if you don't have room for an additional partition. – jordanm Sep 17 '12 at 22:50

FYI. If you configure a swap space on an encrypted container, it will break! I strongly advise you to configure swap volume during the OS setup phase.

  • Edit: if you try to configure swap space on logical volume where the encrypted container resides outside of the logical volume, it will break. – Neocron Jul 22 '15 at 23:58
  • I am using swapfiles on encrypted volumes for years without setting them up in setup phase and never ran into problems. – Jodka Lemon Jul 23 '15 at 0:04
  • ..running Debian. – Jodka Lemon Jul 23 '15 at 0:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.