OPNsense Forum

English Forums => 23.7 Legacy Series => Topic started by: wbennett on October 08, 2023, 07:54:36 pm

Title: Limiting drive writes to the same area on the drive.
Post by: wbennett on October 08, 2023, 07:54:36 pm
Good day,

Just wondering how the logging retention affects the hard drive. I am currently keeping logs for seven days and I am not sure if, after the logs are flushed and a new seven day log starts, the same part of the drive is being written to for each seven day retention?

Thanks for any assistance.

Title: Re: Limiting drive writes to the same area on the drive.
Post by: bartjsmit on October 09, 2023, 07:48:03 am
you're fine - ZFS is a copy on write system https://en.wikipedia.org/wiki/Copy-on-write
Title: Re: Limiting drive writes to the same area on the drive.
Post by: wbennett on October 09, 2023, 01:48:33 pm
you're fine - ZFS is a copy on write system https://en.wikipedia.org/wiki/Copy-on-write
I am using UFS, would that be any different?
Title: Re: Limiting drive writes to the same area on the drive.
Post by: bartjsmit on October 09, 2023, 10:57:06 pm
UFS does not use copy on write. If you are worried about uneven drive wear because of logging you either need to switch to ZFS or configure a central logging server
Title: Re: Limiting drive writes to the same area on the drive.
Post by: Patrick M. Hausen on October 09, 2023, 11:00:53 pm
Besides ... any particular reason why you are worried? Are you using an SSD as your boot drive? What's its TBW? Even with the same area written again and again the SSD controller usually will have your back. What you perceive as "the same area" in reality is far from it.
Title: Re: Limiting drive writes to the same area on the drive.
Post by: wbennett on October 09, 2023, 11:58:07 pm
UFS does not use copy on write. If you are worried about uneven drive wear because of logging you either need to switch to ZFS or configure a central logging server
Is the only way to switch to ZFS a complete reinstall?
Title: Re: Limiting drive writes to the same area on the drive.
Post by: Patrick M. Hausen on October 10, 2023, 12:04:25 am
Yes, but again, why are you worried? An SSD does not care if it's the same area or not. The manufacturer gurantees a certain number of terabytes written (TBW), regardless of the location. The controller creates an illusion of a certain capacity and certain fixed block addresses while spreading the wear over all cells all the time.

Look up the TBW value in your SSD's data sheet, compare with the actual number reported by smartctl -a ...
Title: Re: Limiting drive writes to the same area on the drive.
Post by: CJ on October 10, 2023, 04:30:10 pm
Yes, but again, why are you worried? An SSD does not care if it's the same area or not. The manufacturer gurantees a certain number of terabytes written (TBW), regardless of the location. The controller creates an illusion of a certain capacity and certain fixed block addresses while spreading the wear over all cells all the time.

Look up the TBW value in your SSD's data sheet, compare with the actual number reported by smartctl -a ...

IIRC, it's actually impossible to write to the same area with an SSD as the controller will straight out lie to you.