Updating free space available after red_format() #21
-
[Originally asked 2020-09-16] Hello, After formatting a Reliance Edge volume and mounting it again, it seems that if I try to obtain the number of blocks by calling "red_statvfs()" it is not updating its values. My goal is to make sure that after it formats I have access to its full storage capacity again. Are there other ways to get this information? [EDIT] The function "red_statvfs()" is actually working as usual, the problem was I did not check if formatting was successful. Please disconsider the topic. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'm glad you figured this out! Here is what we were going to share, just for future reference, and perhaps to help others: The f_bfree and f_bavail members of the REDSTATFS structure are taken straight from the free block count in the metaroot. During reformat, both metaroots are rewritten with a reset free block count. Thus, those values should be reset, assuming the red_format(), red_mount(), and red_statvfs() all completed successfully. If nothing is failing, then perhaps you are running into some unexpected error condition, e.g.: a) silent failure to overwrite the metaroots during the reformat; or b) data cache synchronization problems which cause the code to see stale values in the REDSTATFS or metaroot structures. |
Beta Was this translation helpful? Give feedback.
I'm glad you figured this out! Here is what we were going to share, just for future reference, and perhaps to help others:
The f_bfree and f_bavail members of the REDSTATFS structure are taken straight from the free block count in the metaroot. During reformat, both metaroots are rewritten with a reset free block count. Thus, those values should be reset, assuming the red_format(), red_mount(), and red_statvfs() all completed successfully.
If nothing is failing, then perhaps you are running into some unexpected error condition, e.g.: a) silent failure to overwrite the metaroots during the reformat; or b) data cache synchronization problems which cause the code to see stale values in the R…