256. Storage

256.1. Summary of Module Globals

List of Global Functions

List of Global Variables

    256.2. Global Functions

    256.2.1. AddFstabEntry

    Adds an entry into the fstab

    Function parameters

    • map e

    Return value

    • integer - (0 and higher == OK, otherwise error)

    256.2.2. AddMountPointInfo

    Adds mountpoint info to the target map and returns the changed map

    Function parameters

    • map<string,map> target

    Return value

    • map<string,map> - target

    256.2.3. AddSwapMp

    mark swap-partitions with pseudo Mountpoint swap in targetMap

    Function parameters

    • map<string,map> target

    Return value

    • map<string,map> - modified target

    256.2.4. AddWinInfo

    Adds ... and returns the changed map

    Function parameters

    • map<string,map> targets

    Return value

    • map<string,map> - targets

    256.2.5. CheckForEvmsRootFs

    CheckForEvmsRootFs --------------------------------------------------------------------- check if the root filesystem is a evms volume

    Return value

    • boolean

    256.2.6. CheckForLvmRootFs

    CheckForLvmRootFs --------------------------------------------------------------------- check if the root filesystem is a lvm logical volume

    Return value

    • boolean

    256.2.7. CheckSwapOn

    Check if swap paritition is availbe on a disk

    Function parameters

    • string disk

    Return value

    • boolean - true if swap available.

    256.2.8. Commit

    Return value

    • boolean

    256.2.9. CommitChanges

    Apply storage changes

    Return value

    • integer

    256.2.10. CreatePartition

    Creates a new partition

    Function parameters

    • string disk

    • string device

    • symbol ptype

    • integer id

    • integer start

    • integer len

    • symbol mby

    Return value

    • boolean - if successful

    256.2.11. DeletePartitionTable

    Delete the partition table and disk label of device

    Function parameters

    • string disk

    • integer size_k

    Return value

    • boolean

    256.2.12. DetectFs

    Detects a filesystem on a device

    Function parameters

    • string device

    Return value

    • symbol - filesystem

    256.2.13. EvmsDevDisk

    Returns ...

    Function parameters

    • string dev

    Return value

    • string - EvmsDevDisk

    256.2.14. FindFstabEntry

    Finds and returns fstab entry

    Function parameters

    • map fstab

    • string mount

    • string device

    • string uuid

    • string label

    Return value

    • map - fstab entry

     $[
       "spec" : "...",
       "file" : "...",
       "vfstype" : "...",
       "mntops" : "...",
       "freq" : ...,
       "passno" : ...,
     ]

    Example 82. 

       FindFstabEntry ($[], "", "", "", "")
    


    256.2.15. GetDeviceName

    Returns Device Name

    Function parameters

    • string disk

    • any partition

    Return value

    • string - device name

    Example 83. 

     Storage::GetDeviceName ("/dev/md", 1)


    256.2.16. GetDisk

    Returns disk identified by 'device' taken from the 'tg' (target) map

    Function parameters

    • map<string,map> tg

    • string device

    Return value

    • map<string,any>

    256.2.17. GetDiskPartition

    Returns map describing the disk partition

    Function parameters

    • string device

    Return value

    • map - DiskPartition

    256.2.18. GetFreeSpace

    Returns map of free space per partition

    Function parameters

    • string device

    • integer testsize

    • symbol used_fs

    • boolean verbose

    Return value

    • map

    256.2.19. GetLoopDev

    Find next free loop device.

    Function parameters

    • integer start

    Return value

    • string - loop_dev ( e.g.: /dev/loop1 )

    256.2.20. GetMountPoints

    GetMountPoints() collect mountpoint:device as map to get a sorted list usually starting with a "/". Exception is "swap" For directory mount points (key starting with /) the value is a list [partitionName, fsid, targetdevice, raid_type] For swap mount points, the value is a list of lists: [[partitionName, fsid, targetdevice, raid_type], ...]

    Return value

    • map

    256.2.21. GetOndiskTarget

    Returns map describing the disk target

    Return value

    • map< string, map >

    256.2.22. GetOtherLinuxPartitions

    Get list of all Linux Partitions on all real disks

    Return value

    • list - Partition list

    256.2.23. GetPartitionList

    Get list of all Partitions on all real disks

    Return value

    • list - Partition list

    256.2.24. GetPrimPartitions

    Returns list of primary partitions found

    Function parameters

    • map<string,map> targets

    • boolean foreign_os

    Return value

    • list - of primary partitions

    256.2.25. GetTargetMap

    Returns a system target map.

    Return value

    • map<string,map> - target map

     $[
        ... ?
     ]

    256.2.26. GetUsedRealDisksNew

    Get used real disks

    Function parameters

    • map<string,map> tg

    • boolean ignore_boot

    Return value

    • list<string> - disks List of disks

    256.2.27. InitializeDisk

    Set the flag if a disk needs to be initialized

    Function parameters

    • string disk

    • boolean value

    Return value

    • boolean

    256.2.28. IsPartitionable

    Checks if a container is partitionable

    Function parameters

    • map entry

    Return value

    • boolean - true if partitionable

    entry ~ $[ "type" : ... ? ]

    256.2.29. IsRealDisk

    Check if a disk is a real disk and not RAID or LVM

    Function parameters

    • map entry

    Return value

    • boolean - true if real disk

    entry ~ $[
       "type":`CT_DISK,
       "driver" : "?",
       "readonly" : false / true,
     ]

    256.2.30. IsResizable

    Returns whether a partition is resizable

    Function parameters

    • map part

    Return value

    • map - resizable ?

    256.2.31. Mount

    Mounts a device

    Function parameters

    • string dev

    • string mp

    Return value

    • boolean - if successful

    256.2.32. MountOpt

    Mounts a device

    Function parameters

    • string dev

    • string mp

    • string fstopt

    Return value

    • boolean - if successful

    256.2.33. ReReadTargetMap

    Rereads the system target map and returns it

    Return value

    • map<string,map> - target map

    256.2.34. ReadFstab

    Reads and returns fstab from directory

    Function parameters

    • string dir

    Return value

    • list

    256.2.35. Record

    Return value

    • void

    256.2.36. RemoveDmMapsTo

    Removes ... maps to ...

    Function parameters

    • string device

    Return value

    • void

    256.2.37. ResizeVolume

    Sets a new size for partition

    Function parameters

    • string device

    • string disk

    • integer new_size

    Return value

    • boolean - if successfull

    256.2.38. Rollback

    Return value

    • boolean

    256.2.39. SetPartition

    Sets partition 'part' into the 'tg' map and returns changed 'tg' map

    Function parameters

    • map<string,map> tg

    • map part

    Return value

    • map<string,map> - changed tg

    256.2.40. SetPartitionData

    Set <key> in partition <device> to the given <value> and return changed map <tg>

    Function parameters

    • map<string,map> tg

    • string device

    • string key

    • any value

    Return value

    • map<string,map> - changed target map

    256.2.41. SetPartitionFormat

    Sets whether a partition should be formatted

    Function parameters

    • string device

    • boolean format

    • symbol fs

    Return value

    • boolean - if successful

    256.2.42. SetPartitionId

    Sets partition ID

    Function parameters

    • string device

    • integer id

    Return value

    • boolean - if successful

    256.2.43. SetPartitionMount

    Sets a mountpoint for partition

    Function parameters

    • string device

    • string mp

    Return value

    • boolean - if successful

    256.2.44. SwappingPartitions

    Get List of swap partitions

    Return value

    • list - List of swap partitions

    256.2.45. Umount

    Umounts a device

    Function parameters

    • string dev

    Return value

    • boolean - if successful

    256.2.46. UnchangePartitionId

    Restores the original partition ID

    Function parameters

    • string device

    Return value

    • boolean - if succesful

    256.2.47. Update

    Updates fstab on disk

    Function parameters

    • map oldv

    • map newv

    Return value

    • void

    version $[
       // This means version 9.1
       "major" : 9,
       "minor" : 1,
     ]

    256.2.48. UpdateTargetMap

    Updates target map

    Return value

    • void

    256.2.49. WriteFstab

    Writes fstab to the disk

    Return value

    • void

    256.2.50. getDiskInfo

    Returns map with disk info

    Function parameters

    • string device

    • map disk

    Return value

    • map - disk info

    256.3. Global Variables

    256.4. Module Requirements

    256.4.1. Module Imports

    • Arch
    • AsciiFile
    • Directory
    • Encoding
    • FileSystems
    • FileUtils
    • HTML
    • Hotplug
    • Installation
    • Label
    • LibStorage
    • LibStorage::ContainerInfo
    • LibStorage::DiskInfo
    • LibStorage::DmInfo
    • LibStorage::DmPartCoInfo
    • LibStorage::DmPartInfo
    • LibStorage::DmraidCoInfo
    • LibStorage::DmraidInfo
    • LibStorage::EvmsCoInfo
    • LibStorage::EvmsInfo
    • LibStorage::LoopInfo
    • LibStorage::LvmLvInfo
    • LibStorage::LvmVgInfo
    • LibStorage::MdInfo
    • LibStorage::NfsInfo
    • LibStorage::PartitionAddInfo
    • LibStorage::PartitionInfo
    • LibStorage::StorageInterface
    • LibStorage::VolumeInfo
    • Misc
    • Mode
    • Partitions
    • Popup
    • ProductFeatures
    • Stage
    • StorageClients
    • StorageDevices
    • String

    256.4.2. Module Includes

    • storage/routines.ycp