zpool scrub cron job (Solved)
-
First of all I did some digging around but didn't find anything regarding what I was looking for but that doesn't mean it isn't out there and I didn't miss it but I thought I'd ask anyhow.
I recently switched hardware from a SuperMicro A1SRi-2758 to a SuperMicro M11SDV-8C+-LN4F because the 2758 was bottle knecked with my 1Gb, 200Mb and 200Mb connections and could not achieve better than 600Mbps without maxing out the CPU on top of the fact the dashboard was taking a few minutes to load. So yea, overkill, sure, but it should be good for some time to come, but I digress.
During the switch I did move from a SATA SSD to a NVMe, sure, not needed and sure all of the above including the 32GB of RAM is all overkill but I had the SSDs laying around, they're used and literally collecting dust, so why not.
Again, I digress, I also switched to zfs instead of ufs.Now, I may not be a FS pro but I do know that zfs needs or rather should do a occasional scrub and I also need to do trimming.
I looked in the cron jobs and I don't see anything scheduled to do a scrub nor do I see anything regarding trimming.My question is what command should I add to cron to do scrubbing and trimming or where else can the scrubbing and trimming be enabled?
Another question I have is why my root is showing only 11G available on a partitioned 477GB (512GB factory) drive?
Yes I do have "Use memory file system for /tmp and /var" enabled for obvious reasons with periodic RAM Disk Data Backups set to 2 hours.
RAM Disk Size is set to 1024 for /tmp and 6144 for /var
I'm assuming that the root in the screen shot is referring to the RAM disk but I'm not sure, which is why I ask, why is it only showing 11G of available space?Any help, questions and or comments all appreciated, thank you!
-
@visseroth said in zpool scrub cron job:
My question is what command should I add to cron to do scrubbing and trimming or where else can the scrubbing and trimming be enabled?
Hi, I have a cron-job (once a month) /sbin/zpool scrub zroot
(replace zroot with the name of your zfs pool)Trim is normally activated (if the SSD supports it) and is executed by the SSD Firmware.
Regards,
fireodo -
@fireodo ahh, thanks for that command, I've added it to my cron jobs.
Regarding Trim, yes, normally but not always which is why Linux, Windows and other operating systems have trim commands.
I guess it would be best to know for certain if your drive does or doesn't but either way it doesn't hurt to tell the drive to periodically trim just to be certain.As for my question about the 11GB of space, I figured that out, well sort of.
Basically the NVMe was only registering as a 11GB drive on that motherboard for some reason.
I swapped it for another and that one registered as 27GB, so I swapped it for another and that one registered correctly and has been put in place.
The first NVMe was a Intel NVMe
The second was a AData
The third is a Samsung Evo
I also found that var and tmp needed to be pinned so I could keep a eye on them...So back to my only question left.
Does anyone know the command to execute trim? -
So I did some more digging around.
In short it doesn't look like there is a Trim command for ZFS that I can seeUFS does have Trim capability as found here...
https://forum.pfsense.org/index.php?topic=113803.msg633795#msg633795On this thread...
https://forum.netgate.com/topic/102088/trim-for-ssd/17At the bottom you'll find...
@kpa said in Trim for SSD:All SSDs have automatic wear leveling. What TRIM does is to mark disk blocks that are no longer in use as empty so that the wear leveling has more free space to play with. If your disks are mostly empty the wear leveling will never come to a situation where the unused blocks become scarce and there's no reason to enable TRIM.
Apparently thought Trim is enabled by default on zfs and can be confirmed with...
sysctl -a | grep _trim