i have to write python script in my work. My script must print all devices which meet some conditions. One of this conditions is superblock. Device must have superblock.
other conditions:
- any partitions is not mounted - DONE
- any partition is not in raid - DONE
- uuid is not in fstab - DONE
- arr uuid is in mdadm.conf - DONE
- device has superblock - ?????
is there anyone who has some idea how to do it? I have to confess that i dont have any. It's not necessary to manage it by python. Is there ANY way how to check it ? :)
Thank you very much.
You can grep the output of
dumpe2fs device_name
for existance of "superblock at".Here's an example on my Centos 5 linux system:
More information on dumpe2fs:
http://linux.die.net/man/8/dumpe2fs