Programming with GEOM

Hello!

Please tell me where I can find info about working with GEOM.
I write program and I have to get info about storage devices. I need information about present devices, partitioning schemes, partitions, FS of partitions.
Can I get this information through geom subsystem?

Later I want to make some work with storage - delete or create partitions or filesystems. Can geom do it for me?

Thank you for your answers.
 
Actually, you can do this from a higher level. gpart(8) can be used for getting the list of devices and partitioning schemes, then file(1) can be used to check filesystem types.

Code:
% gpart list
% gpart show
% gpart show ada0
% gpart show ada0s1
% file -s /dev/ada0s1a
% file -s /dev/ada0p4
 
Thank you for your answers.
But "gpart" or "geom" shows information only if there is already configured partitions/filesystems.
What if I have booted to LiveCD/DVD and I need to find any storage devices (to partition it and install system for example). This storage devices may not contain any partitions/filesystems and will not be shown with geom/gpart.
What is right way to find any connected storage devices?
 
Is it from a higher level (shell scripting for example) or a lower level (C/C++ for example)?
 
Back
Top