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:
parent
d5701dac28
commit
5eefdc1e9a
4 changed files with 17 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue