diff --git a/subiquity/common/filesystem/manipulator.py b/subiquity/common/filesystem/manipulator.py index b5b4ec26..a55b6915 100644 --- a/subiquity/common/filesystem/manipulator.py +++ b/subiquity/common/filesystem/manipulator.py @@ -42,7 +42,9 @@ class FilesystemManipulator: def create_mount(self, fs, spec): if spec.get("mount") is None: return - mount = self.model.add_mount(fs, spec["mount"]) + mount = self.model.add_mount( + fs, spec["mount"], on_remote_storage=spec.get("on-remote-storage", False) + ) if self.model.needs_bootloader_partition(): vol = fs.volume if vol.type == "partition" and boot.can_be_boot_device(vol.device): @@ -240,6 +242,9 @@ class FilesystemManipulator: def partition_disk_handler(self, disk, spec, *, partition=None, gap=None): log.debug("partition_disk_handler: %s %s %s %s", disk, spec, partition, gap) + if disk.on_remote_storage(): + spec["on-remote-storage"] = True + if partition is not None: if "size" in spec and spec["size"] != partition.size: trailing, gap_size = gaps.movable_trailing_partitions_and_gap_size( @@ -294,6 +299,9 @@ class FilesystemManipulator: log.debug("logical_volume_handler: %s %s %s", vg, lv, spec) + if vg.on_remote_storage(): + spec["on-remote-storage"] = True + if lv is not None: if "name" in spec: lv.name = spec["name"] diff --git a/subiquity/models/filesystem.py b/subiquity/models/filesystem.py index 3aad81e8..ffc1f7f4 100644 --- a/subiquity/models/filesystem.py +++ b/subiquity/models/filesystem.py @@ -2166,10 +2166,13 @@ class FilesystemModel: raise Exception("can only remove unmounted filesystem") self._remove(fs) - def add_mount(self, fs, path): + def add_mount(self, fs, path, *, on_remote_storage=False): if fs._mount is not None: raise Exception(f"{fs} is already mounted") - m = Mount(m=self, device=fs, path=path) + options = None + if on_remote_storage: + options = "defaults,_netdev" + m = Mount(m=self, device=fs, path=path, options=options) self._actions.append(m) return m