Skip to content

Commit 0dfa465

Browse files
committed
add warning about device mapper based auto_mounts
Signed-off-by: Zen <[email protected]>
1 parent a638651 commit 0dfa465

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/ugrd/fs/mounts.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,13 @@ def _autodetect_dm(self, mountpoint, device=None) -> None:
541541
major, minor = _get_device_id(source_device)
542542
self.logger.debug("[%s] Major: %s, Minor: %s" % (source_device, major, minor))
543543

544+
# If the mountpoint is in auto_mounts, log a big error about it being prone to failure
545+
if mountpoint in self["auto_mounts"]:
546+
self.logger.error(f"Found a device mapper mount in auto_mounts: {c_(mountpoint, 'yellow', bold=True)}")
547+
self.logger.warning(
548+
"auto_mounts is used for mounts before LVM/LUKS init (during mount_fstab). Device mapper mounts defined here may fail to activate and stop the boot process!"
549+
)
550+
544551
# Get the virtual block device name using the major/minor
545552
for name, info in self["_vblk_info"].items():
546553
if info["major"] == str(major) and info["minor"] == str(minor):
@@ -1045,7 +1052,7 @@ def export_mount_info(self) -> None:
10451052
if not self["hostonly"]:
10461053
self.logger.info("Root mount infomrmation can be defined under the '[mounts.root]' section.")
10471054
raise ValidationError(
1048-
"Root mount source information is not set, when hostonly mode is disabled, it must be manually defined."
1055+
"Root mount source information is not set. When hostonly mode is disabled, it must be manually defined."
10491056
)
10501057
raise ValidationError(
10511058
"Root mount source information is not set even though hostonly mode is enabled. Please report a bug."

0 commit comments

Comments
 (0)