Swap configuration

69 views
Skip to first unread message

Gilles Martinoty

unread,
Apr 9, 2020, 8:38:09 AM4/9/20
to Alt-F
Hello,
I've just installed Alt-F 1.0 on my DNS-320, and everything works great.
I only have an issue with understanding the configuration about swap. This is my status and filesystems pages:

status.jpg


filesystem.jpg



What I understand (but I'm probably mistaken) is that my swap is /dev/md0, which is a RAID1 swap. Is it the correct way it should be configured?

Is there something useful to do with sda4 and sdb4?

Thank you and best regards,
Gilles

João Cardoso

unread,
Apr 9, 2020, 11:02:59 AM4/9/20
to Alt-F


On Thursday, 9 April 2020 13:38:09 UTC+1, Gilles Martinoty wrote:
Hello,
I've just installed Alt-F 1.0 on my DNS-320, and everything works great.
I only have an issue with understanding the configuration about swap. This is my status and filesystems pages:
...
 
What I understand (but I'm probably mistaken) is that my swap is /dev/md0,
yes, you are right 
which is a RAID1 swap.
You inherited the d-link disk partition, and they configure swap on top of a RAID1 (build from sda1 and sdb1); they do this even when there is only one disk, so the swap RAID1 will be in the degraded state. Alt-F just uses what it founds -- its its philosophy.

Is it the correct way it should be configured?

It make sense to have swap over RAID when you are using RAID for your filesystems. You use RAID1 because you want redundancy and want the system up and working even when one disk fails. If this happens, the system will continue to work as swap continues working on the degraded RAID.
If, on the other side, swap is not setup on top of RAID, as soon as a disk fails the whole system might crashes because swap stops being available.

Those are the pros of having swap over RAID.
The cons are that swap, which is already slow, becomes even (slightly) slower when over a RAID. And it will be difficult for your disks to spin down even when there is no user activity, because even with swap being moderately used (as it should be) both disks are needed.

I believe that the most frequent use case is that most users don't really need 24/7 availability, and most won't even dare to do the failed disk replacement by hotplugging, so when a disk fails the system will be brought down anyway. The only (significative) difference is that it will be shutdown cleanly, instead of crashing.

So, its up to you. You can keep swap over RAID1, following best practices, or you can downgrade it to use separate disks and priorities. Use Disk->utilities and use the "Recreate swap on all devices". Read the tooltip over the button.

For  (if/when) the next release, another button will allow to use RAID1 based swapping, and by default Alt-F will use swap over RAID1 when the user sets RAID to be used for their filesystems.


Is there something useful to do with sda4 and sdb4?

Use one of them for Alt-F packages, separating your data from Alt-F disk-installed programs and data. This if you haven't decide to use a dedicated USB pen for that purpose, which is the recommended procedure when possible. That is a FAQ (but don't know if it is in the FAQ)

Gilles Martinoty

unread,
Apr 10, 2020, 2:56:28 PM4/10/20
to Alt-F
Hi, 
Thank you very much for those thorough explanations. It's very useful to know why we do things, instead of just following a recipe.
Best regards,
Gilles
Reply all
Reply to author
Forward
0 new messages