Disable swapfile in drive manager. Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
chrnobel
Posts: 7
Joined: Sun May 12, 2019 11:34 pm

Disable swapfile in drive manager.

Post by chrnobel »

Hi.

Under drive manager I can set the size of the swapfile, but I cannot select to disable it.
Where can I set the value to 0, meaning disabled swapfile.

I am going to make some headless video players (not connected to net), reading the video file from a USB stick.

My goal is to make it as robust as possible, as I know it will not be shutdown correctly, but simply powered off.

If I remove the swopfile, is it then possible to select the RO option in drive manager, and is there anything else I can do to prevent a corrupted SD card - and I don't need any cron functionality, as the only thing is shall do is starting video looping on start up, and do that forever, until powered off.
User avatar
WarHawk
Posts: 622
Joined: Thu Jul 20, 2017 8:55 am

Re: Disable swapfile in drive manager.

Post by WarHawk »

There still needs a tiny swap file just in case (for stability), but setting the swappiness to 0 will keep it from swapping until it absolutely needs it.
chrnobel
Posts: 7
Joined: Sun May 12, 2019 11:34 pm

Re: Disable swapfile in drive manager.

Post by chrnobel »

Maybe, but the question was, where can I set the swappines to 0 in drive-manager?

As I can see it, the only thing I am able to set is the size.

And as mentioned before, the goal is to make a headless device - so I would actually prefer a crash (and a restart) than a corrupted sd card.
User avatar
WarHawk
Posts: 622
Joined: Thu Jul 20, 2017 8:55 am

Re: Disable swapfile in drive manager.

Post by WarHawk »

chrnobel wrote: Wed May 15, 2019 8:51 am Maybe, but the question was, where can I set the swappines to 0 in drive-manager?

As I can see it, the only thing I am able to set is the size.

And as mentioned before, the goal is to make a headless device - so I would actually prefer a crash (and a restart) than a corrupted sd card.
https://askubuntu.com/questions/103915/ ... swappiness

Code: Select all

sysctl vm.swappiness=0
Actually it should be set to 1 not 0, zero disables completely on newer kernel
User avatar
MichaIng
Site Admin
Posts: 2334
Joined: Sat Nov 18, 2017 6:21 pm

Re: Disable swapfile in drive manager.

Post by MichaIng »

@chrnobel
Open dietpi-drive_manager, go to your root drive/partition select swapfile and enter 0.

This will disable and remove the swap file. Swappiness does not need to be adjusted. If you have an external drive, I would instead enable the swap file on that external drive.

I would not disable cron jobs, since those include some core maintenance tasks. Although if you want to run the system completely R/O, then this is probably okay. Note that DietPi (it's scripts) will most likely behave a bid strange or prompt errors when root is R/O. It is not really made for that. Some task for the feature to have a R/O mode.
chrnobel
Posts: 7
Joined: Sun May 12, 2019 11:34 pm

Re: Disable swapfile in drive manager.

Post by chrnobel »

MichaIng wrote: Mon May 20, 2019 12:21 am It is not really made for that. Some task for the feature to have a R/O mode.
Fair enough.

I have actually switched to Alpine instead, as it fits better to my need - runs entirely in RAM.
User avatar
MichaIng
Site Admin
Posts: 2334
Joined: Sat Nov 18, 2017 6:21 pm

Re: Disable swapfile in drive manager.

Post by MichaIng »

@chrnobel
If you don't require Debian functionalities but an in-RAM OS, I found TinyCore to be veeery tiny :).
Post Reply