def GetRootDisk():
  try:
    returncode, stdout, _ = Exec(('/sbin/mount'))
  except ExecError:
    returncode = 'ExecError'

  if returncode != 0:
    raise Error(
        'Could not enumerate mounted disks, mount exit status %s' % returncode)

  for line in stdout.splitlines():
    try:
      device, _, mount_point, _ = line.split(' ', 3)
      if mount_point == '/' and re.search(r'^[/a-z0-9]+$', device, re.I):
        return device
    except ValueError:
      pass

  raise Error('Could not find root disk.')
Returns the device name of the root disk.
dataset/ETHPy150Open google/cauliflowervest/src/cauliflowervest/client/util.py/GetRootDisk