docs: async def remove(self, device, force=False, detach=False, eject=False,
                       lock=False):
          """
          Unmount or lock the device depending on device type.
  
          :param device: device object, block device path or mount path
          :param bool force: recursively remove all child devices
          :param bool detach: detach the root drive
          :param bool eject: remove media from the root drive
          :param bool lock: lock the associated LUKS cleartext slave
          :returns: whether all attempted operations succeeded
          """
          device = self._find_device(device)
          if device.is_filesystem:
              if device.is_mounted or not device.is_loop or detach is False:
                  success = await self.unmount(device)
          elif device.is_crypto:
              if force and device.is_unlocked:
                  await self.auto_remove(device.luks_cleartext_holder, force=True)
              success = await self.lock(device)
          elif (force
                and (device.is_partition_table or device.is_drive)
                and self.is_handleable(device)):
              kw = dict(force=True, detach=detach, eject=eject, lock=lock)
              tasks = [
                  self.auto_remove(child, **kw)
                  for child in self.get_all_handleable()
                  if _is_parent_of(device, child)
              ]
              results = await gather(*tasks)
              success = all(results)
          else:
              self._log.info(_('not removing {0}: unhandled device', device))
              success = False
          # if these operations work, everything is fine, we can return True:
          if lock and device.is_luks_cleartext:
              device = device.luks_cleartext_slave
              if self.is_handleable(device):
                  success = await self.lock(device)
          if eject:
              success = await self.eject(device)
          if (detach or detach is None) and device.is_loop:
              success = await self.delete(device, remove=False)
          elif detach:
              success = await self.detach(device)
          return success