mounts: add possiblity to use norecovery with ro

To avoid kernel panics if the kernel attempts to recover the filesystem
when it's mounted as readonly. Offer the possiblity to use the
norecovery option for journaling file systems (Xfs, Ext4, Btrfs).
This commit is contained in:
Thomas Lavocat 2023-02-09 17:06:43 +01:00 committed by Achilleas Koutsou
parent d5701dac28
commit 5eefdc1e9a
4 changed files with 17 additions and 0 deletions

View file

@ -32,6 +32,11 @@ SCHEMA_2 = """
"description": "mount the source as a readonly device",
"type": "boolean",
"default": false
},
"norecovery": {
"description": "Don't load the journal on mounting",
"type": "boolean",
"default": false
}
}
}

View file

@ -32,6 +32,11 @@ SCHEMA_2 = """
"description": "mount the source as a readonly device",
"type": "boolean",
"default": false
},
"norecovery": {
"description": "Don't load the journal on mounting",
"type": "boolean",
"default": false
}
}
}

View file

@ -32,6 +32,11 @@ SCHEMA_2 = """
"description": "mount the source as a readonly device",
"type": "boolean",
"default": false
},
"norecovery": {
"description": "Don't load the journal on mounting",
"type": "boolean",
"default": false
}
}
}

View file

@ -129,6 +129,8 @@ class FileSystemMountService(MountService):
opts = []
if options.get("readonly"):
opts.append("ro")
if options.get("norecovery"):
opts.append("norecovery")
if "uid" in options:
opts.append(f"uid={options['uid']}")
if "gid" in options: