Swap partition on DietPi?

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
dietpifan
Posts: 8
Joined: Sun Feb 26, 2017 2:44 pm

Swap partition on DietPi?

Post by dietpifan »

Is it possible to create a swap partition on a DietPi system?

I'm asking because I'm not totally clear on what DietPi does to save logs to RAM, and if there's anything else I should know about in regards to what DietPi does. Will there be any conflicts or is it as simple as just adding a UUID= line in /etc/fstab ?

I'd try it myself but don't wanna mess anything up, thought I'd ask you guys first :D
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: Swap partition on DietPi?

Post by Fourdee »

Hi,

DietPi uses a swapfile, rather than a swap partition. Swapfile allows for ondemand size/location changes.

You can change the size of the swap file in:
dietpi-config > advanced > swapfile

To change the location and size:

Code: Select all

/DietPi/dietpi/func/dietpi-set_dphys-swapfile 100 /mnt/mysuperdooperdrive/swapfile.file
Above will create a 100MB swapfile in location /mnt/mysuperdooperdrive/swapfile.file

Either way, if you want to specifically use a swap partition, /etc/fstab entry should be fine, just make sure to disable swapfile:

Code: Select all

/DietPi/dietpi/func/dietpi-set_dphys-swapfile 0 /var/swap
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
dietpifan
Posts: 8
Joined: Sun Feb 26, 2017 2:44 pm

Re: Swap partition on DietPi?

Post by dietpifan »

Thanks, Fourdee
Post Reply