0

As part of a larger project, I'm currently writing a python script that runs Linux commands in a vApp.

I'm currently facing an issue where after working with a mounted iso, it may or may not unmount as expected.

To check the mount status, I want to run the df -hk /directory and du -sch /directory commands respectively, and compare the outputs.

If the iso is not unmounted, the result for the df command should return a larger value than the du command as the df command includes the mount size in the result, while du does not.

I'm just wondering how can i compare these values or if there is a better way for me to run this check in the first place.

Stephen Dunne
  • 55
  • 1
  • 11

1 Answers1

1

why don't you use /proc/mounts ? First column is you blockdevice, second is the mountpoint. If you mountpoint is not in /proc/mounts you have nothing mounted here.

user2563336
  • 196
  • 1
  • 8