Local file systems, both supported and unsupported, are represented by LMI_LocalFileSystem class and its subclasses.
Each LMI_LocalFileSystem instance of supported filesystems have associated one instance of LMI_FileSystemSetting representing its configuration (e.g. inode size).
Supported filesystems are: ext2, ext3, ext4, xfs, btrfs. Only supported filesystems can be created! Actual set of supported filesystems can be obtained from LMI_FileSystemConfigurationCapabilities instance associated to LMI_FileSystemConfigurationService.
Following instance diagram shows four block devices:
Note
Currently the filesystem support is limited:
These limitations will be addressed in future releases.
Destroys a file system (LMI_LocalFileSystem) or other metadata, such as Physical Volume metadata or MD RAID metadata present (LMI_DataFormat) on a device.
Only unmounted filesystems and unused metadata can be deleted.
Use LMI_CreateFileSystem method. Following example formats /dev/sda3 with ext3:
# Find the /dev/sda3 device
sda3 = root.CIM_StorageExtent.first_instance(
Key="DeviceID", Value="/dev/sda3")
# Format it
(ret, outparams, err) = filesystem_service.LMI_CreateFileSystem(
FileSystemType = 11, # 11 = EXT3
InExtents= [sda3.path])
The resulting filesystem is the same as shown in diagram above.
Use the same LMI_CreateFileSystem method as above. Following example formats /dev/sda1 and dev/sda2 as one btrfs volume:
# Find the /dev/sda3 device
sda1 = root.CIM_StorageExtent.first_instance(
Key="DeviceID", Value="/dev/sda1")
sda2 = root.CIM_StorageExtent.first_instance(
Key="DeviceID", Value="/dev/sda2")
# Format them
(ret, outparams, err) = filesystem_service.LMI_CreateFileSystem(
FileSystemType = 11, # 11 = EXT3
InExtents= [sda1.path, sda2.path])
The resulting filesystem is the same as shown in diagram above.
Use LMI_CreateFileSystem method:
sda1 = root.CIM_StorageExtent.first_instance(
Key="DeviceID", Value="/dev/sda1")
fs = sda1.first_associator(ResultClass='LMI_LocalFileSystem')
(ret, outparams, err) = filesystem_service.DeleteFileSystem(
TheFileSystem = fs.path)
Note that with one btrfs on multiple block devices, the whole btrfs volume is destroyed.
In future, we might implement: