diff --git a/src/vmm_mad/remotes/lib/lxd/mapper/mapper.rb b/src/vmm_mad/remotes/lib/lxd/mapper/mapper.rb index 6d9cb78ade9..66efcac38a3 100644 --- a/src/vmm_mad/remotes/lib/lxd/mapper/mapper.rb +++ b/src/vmm_mad/remotes/lib/lxd/mapper/mapper.rb @@ -161,7 +161,11 @@ def unmap(one_vm, disk, directory) device = '' real_path = directory - real_path = File.realpath(directory) if File.symlink?(one_vm.sysds_path) + + is_rootfs = real_path =~ %r{.*/rootfs} + is_shared_ds = File.symlink?(one_vm.sysds_path) + + real_path = File.realpath(directory) if !is_rootfs && is_shared_ds sys_parts.each {|d| if d['mountpoint'] == real_path