YaST2 Developers Documentation: configuration of raid:



functions
files
intro

configuration of raid:

raid_lib.ycp
---------------------- rd or Rd == raid device, a device like hda1 or /dev/system/usr that belongs to a raid

Imports

  • Mode
  • Partitions
  • Storage
  • Wizard

Local Functions

local get_raid_devices (integer raid_nr) -> list<term>

Build raid dev item list e.g.: [`item (`id ("2//dev/md"), "/dev/md2", false)]

Parameters:
raid_nr

local IsRaidCreated (string device, symbol what) -> boolean

Checks if a RAID is currently created or if it was already

Parameters:
device
what

local new_raid_list (list<term> all_raids) -> void

Update Raid ComboBox

Parameters:
all_raids

local get_raid_size_byte (list<map> partition_list, string subdevraidindex, string current_raid_type) -> integer

Get the current sum of raid devices which belong to raid "current_raid" [ $[ "fsid":142, "fstype":"RAID", "nr":"var", "region":[255, 16], "type":`primary, "fsid":131, "fstype":"Linux native", "nr":4, "region":[271, 844], ... out: 10000000200

Parameters:
partition_list
subdevraidindex
current_raid_type

local addRaid (string id, string current_raid) -> void

add a partition to the current raid

Parameters:
id
current_raid

local removeRaid (string id, string current_raid, symbol what) -> void

Removes a partition from its current raid.

Parameters:
id
current_raid
what

local isItemRd (string id) -> boolean

belongs the the partition "id" already to a raid

Parameters:
id

local CheckItemIsNotRaid (string id) -> boolean

belongs the the partition "id" already to a raid if YES: popup a proper Message and return(false)

Parameters:
id

local CheckItemIsRaid (string id) -> boolean

belongs the the partition "id" already to a raid? if NO: popup a proper Message and return(false)

Parameters:
id

local get_raid_widget_table (list<map> possRdList) -> list

partition list to widget table in: [ $["fsid":142, "fstype":"Linux raid", "nr":"var", "region":[255, 16], "type":`primary], $[ "fsid":131, "fstype":"Linux native", "nr":4, "region":[271, 844], ... out: [ `item(`id("/dev/hda1"), "/dev/hda1 ", " 2G ", " LVM ", "md1"), `item(`id("/dev/hda2"), "/dev/hda2 ", " 1G ", " Linux ", " ") ];

Parameters:
possRdList

local get_free_raid_nr (map<string,map> targetMap, integer min) -> string

number for /dev/mdX, 0 for /dev/md0, 1 for /dev/md1

Parameters:
targetMap
min

local add_main_dev_to_partition_map (map<string,map> targetMap) -> map

Add the main device ( "/dev/hda") to the partition map. partition = $[ "nr" : 1, "main_dev": "/dev/hda", ...... ]; Use change !!!!!!!!!

Parameters:
targetMap all targets
Return value:
nil

local all_raid_partitions (map<string,map> targetMap) -> list<map>

Parameters:
targetMap all targets
Return value:
a list with all partition that have a key raid_name != "".

local onepartition2raidtab (map raid, list<map> r_partitions) -> string

Create one raidtab entry.

Parameters:
raid raid partition map
r_partitions all raid partitions
Return value:
one raidtab entry

local create_raidtab (map<string,map> targets) -> string

Build the initial /etc/raidtab by installation. If no raids are to be created, an empty string in returned.

Parameters:
targets
Return value:
a string that has /etc/raidtab format.

local change_raidtab (map<string,map> targetMap) -> string

Change an existing /etc/raidtab ( in running system ) -> add new entries for new raids -> remove entries of deleted raids -> no change in /etc/raidtab for modified raids

Parameters:
targetMap all targets

YaST2 Developers Documentation