Scampicfx
Contributor
- Joined
- Jul 4, 2016
- Messages
- 125
Dear guys,
I'm a bit unsure regarding SWAP partition!
I read many postings here in the forums and while some postings recommend to disable SWAP, some others encourage to leave it enabled.
In this posting (https://forums.freenas.org/index.ph...talled-freenas-in-usb-disk.49865/#post-343367), Spearfoot recommends to give FreeNAS some swap space - regardless of how much memory is installed in the system. Furthermore, the GUI itself strongly discourages from disabling SWAP. Okay, fine, so I will leave Swap enabled! (although this gives me tons and tons of SWAP)
BUT, the reason of thinking about disabling SWAP is, because I am concerned about what happens when the disk, which houses the actual used SWAP-partition, fails. And it is only a matter of time: one day, every hdd will fail! So this is no theoretical question!
So, while continue reading, I came accross this thread: https://forums.freenas.org/index.php?threads/further-explanation-of-partitions-swap-on-disks.26231/
It's a good source of information. However, still some questions remain unanswered.
Talking about replacing disks, the guys in this thread recommend to disable SWAP first or "offline a disk" or power down the system and THEN replace the affected disk. The reason for this recommendation is, that unplugging a disk suddenly - while it is used as SWAP - may lead to a system crash.
Okay... But what happens, when I can't control this procedure? Let's say, the affected disk itself powers off becauses it is damaged? What happens in this case? I have no control at this point!
My FreeNAS OS is running on two mirrored SSDs. They have plenty of unused space. Is it possible to place SWAP-partition on this vdev? I don't want to place SWAP partition on every single disk. I would rather prefer to have SWAP mirrored, so that in case of SSD-crash the SWAP-partition does not get affected!
In the thread mentioned above, there is user embrais is building his own swap-file on a vdev. By creating a file and not a partition, he gains mirroring and redundancy. Okay... this sounds like a good solution....
But, the point I would like to ask:
By reading all the postings, I get the feeling that it is only a matter of time, when FreeNAS gets affected severely by a ssd or hdd failure. Why don't the devs provide any options in the GUI to solve this problem? Why don't I get some options to decide where to place the Swap-file / Swap-partition.
As mentioned above, this is no theoretical question. Every drive will fail - some after a few months, some after a couple of years! And these drives host the swap partition! The point is, that each time a hard drive fails, it could also completely destroy the SWAP partition. And one time, when the system is using the swap partition exactly at that moment the disk error occurs, it could lead to a system crash of FreeNAS. The GUI itself does not provide any options to solve this issue. So, I'm wondering why this is accepted as it is?
My impression is, that a dev should fix all critical issues he knows about. When I am coding projects myself, I always try to do so! I couldn't go to sleep knowing that there a possible critical problems in my software which could lead to a system crash and in worst cases to a loss of data? When I know there is an issue, I put in my best efforts to solve it as fast as possible.
So, to come to a conclusion, I'm wondering, if I understand this whole SWAP-thing correctly? So please give me a hint or advise, if I'm wrong with my assumptions above! I hope I am wrong :)
Thank you guys!
I'm a bit unsure regarding SWAP partition!
I read many postings here in the forums and while some postings recommend to disable SWAP, some others encourage to leave it enabled.
In this posting (https://forums.freenas.org/index.ph...talled-freenas-in-usb-disk.49865/#post-343367), Spearfoot recommends to give FreeNAS some swap space - regardless of how much memory is installed in the system. Furthermore, the GUI itself strongly discourages from disabling SWAP. Okay, fine, so I will leave Swap enabled! (although this gives me tons and tons of SWAP)
BUT, the reason of thinking about disabling SWAP is, because I am concerned about what happens when the disk, which houses the actual used SWAP-partition, fails. And it is only a matter of time: one day, every hdd will fail! So this is no theoretical question!
So, while continue reading, I came accross this thread: https://forums.freenas.org/index.php?threads/further-explanation-of-partitions-swap-on-disks.26231/
It's a good source of information. However, still some questions remain unanswered.
Talking about replacing disks, the guys in this thread recommend to disable SWAP first or "offline a disk" or power down the system and THEN replace the affected disk. The reason for this recommendation is, that unplugging a disk suddenly - while it is used as SWAP - may lead to a system crash.
Okay... But what happens, when I can't control this procedure? Let's say, the affected disk itself powers off becauses it is damaged? What happens in this case? I have no control at this point!
My FreeNAS OS is running on two mirrored SSDs. They have plenty of unused space. Is it possible to place SWAP-partition on this vdev? I don't want to place SWAP partition on every single disk. I would rather prefer to have SWAP mirrored, so that in case of SSD-crash the SWAP-partition does not get affected!
In the thread mentioned above, there is user embrais is building his own swap-file on a vdev. By creating a file and not a partition, he gains mirroring and redundancy. Okay... this sounds like a good solution....
But, the point I would like to ask:
By reading all the postings, I get the feeling that it is only a matter of time, when FreeNAS gets affected severely by a ssd or hdd failure. Why don't the devs provide any options in the GUI to solve this problem? Why don't I get some options to decide where to place the Swap-file / Swap-partition.
As mentioned above, this is no theoretical question. Every drive will fail - some after a few months, some after a couple of years! And these drives host the swap partition! The point is, that each time a hard drive fails, it could also completely destroy the SWAP partition. And one time, when the system is using the swap partition exactly at that moment the disk error occurs, it could lead to a system crash of FreeNAS. The GUI itself does not provide any options to solve this issue. So, I'm wondering why this is accepted as it is?
My impression is, that a dev should fix all critical issues he knows about. When I am coding projects myself, I always try to do so! I couldn't go to sleep knowing that there a possible critical problems in my software which could lead to a system crash and in worst cases to a loss of data? When I know there is an issue, I put in my best efforts to solve it as fast as possible.
So, to come to a conclusion, I'm wondering, if I understand this whole SWAP-thing correctly? So please give me a hint or advise, if I'm wrong with my assumptions above! I hope I am wrong :)
Thank you guys!
Last edited by a moderator: