Integrate SnapRAID parity drives into mergerfs pools
All checks were successful
Build and Release / build-and-release (push) Successful in 1m19s
All checks were successful
Build and Release / build-and-release (push) Successful in 1m19s
- Add SnapRAID parity drive detection to mergerfs discovery - Remove Pool Status health line as discussed - Update drive display to always show wear data when available - Include /mnt/parity drives as part of mergerfs pool structure
This commit is contained in:
@@ -210,7 +210,7 @@ impl DiskCollector {
|
||||
.collect();
|
||||
|
||||
// Convert numeric references to actual mount points if needed
|
||||
let member_paths = if raw_paths.iter().any(|path| !path.starts_with('/')) {
|
||||
let mut member_paths = if raw_paths.iter().any(|path| !path.starts_with('/')) {
|
||||
// Handle numeric format like "1:2" by finding corresponding /mnt/disk* paths
|
||||
self.resolve_numeric_mergerfs_paths(&raw_paths)?
|
||||
} else {
|
||||
@@ -218,6 +218,10 @@ impl DiskCollector {
|
||||
raw_paths
|
||||
};
|
||||
|
||||
// For SnapRAID setups, also include parity drives as part of the pool
|
||||
let snapraid_parity_paths = self.discover_snapraid_parity_drives()?;
|
||||
member_paths.extend(snapraid_parity_paths);
|
||||
|
||||
// Categorize as data vs parity drives
|
||||
let (data_drives, parity_drives) = match self.categorize_pool_drives(&member_paths) {
|
||||
Ok(drives) => drives,
|
||||
@@ -240,6 +244,16 @@ impl DiskCollector {
|
||||
Ok(pools)
|
||||
}
|
||||
|
||||
/// Discover SnapRAID parity drives
|
||||
fn discover_snapraid_parity_drives(&self) -> Result<Vec<String>> {
|
||||
let mount_devices = self.get_mount_devices()?;
|
||||
let parity_paths: Vec<String> = mount_devices.keys()
|
||||
.filter(|path| path.contains("parity"))
|
||||
.cloned()
|
||||
.collect();
|
||||
Ok(parity_paths)
|
||||
}
|
||||
|
||||
/// Categorize pool member drives as data vs parity
|
||||
fn categorize_pool_drives(&self, member_paths: &[String]) -> Result<(Vec<DriveInfo>, Vec<DriveInfo>)> {
|
||||
let mut data_drives = Vec::new();
|
||||
|
||||
Reference in New Issue
Block a user