YaST2 Developers Documentation: YaST OS Repair. Automatic error detection & repair tool for Linux.

YaST OS Repair. Automatic error detection & repair tool for Linux.

OSRFstab.ycp
YaST OS Repair. Automatic error detection & repair tool for Linux.

This module has an unstable interface.

Imports

  • AsciiFile
  • FileSystems
  • Hotplug
  • Initrd
  • Installation
  • Label
  • Mode
  • OSRExecute
  • OSRFsck
  • OSRLogFile
  • OSRPopup
  • OSRSystem
  • Partitions
  • Popup
  • Report
  • Storage
  • StorageDevices
  • SuSERelease

Global Variables

Global Functions

Local Variables

Local Functions

global fstabpath -> string

The path

local fstab_defaults -> map <string,map>

The default fstab entries (as maps) -> set in constructor

local digits -> string

All digits

local pos2field -> map

Line position to sense

local swapable_partition_list -> list<string>

Partitions which are swapable

local checked_partitions -> list<string>

All checked partitions (OSRFsck)

local fstab -> map

Example
 of map describing /etc/fstab:

    $[
	"comment"	: "^[ \t]*#.*",
	"delim"		: " \t",
	"l"		: $[
	    1	: $[
		"fields" : ["/dev/hda2", "/", "reiserfs", "defaults", "1", "1"],
		"line"	 :"/dev/hda2\t/\treiserfs\tdefaults 1 1"
	    ],
	    2	: $[
		"fields" : [
		    "/dev/hda3", "/local", "reiserfs", "defaults", "1", "2"],
		"line"	 : "/dev/hda3\t/local\treiserfs\tdefaults 1 2"
	    ],
	    3	: $[
		"fields" : [ "/dev/hda1", "swap", "swap", "pri=42", "0", "0"],
		"line"	 : "/dev/hda1\tswap\tswap\tpri=42 0 0"
	    ],
	    4	: $[
		"fields" : [
		    "devpts", "/dev/pts", "devpts", "mode=0620,gid=5","0", "0"],
		"line"	 : "devpts\t/dev/pts\tdevpts\tmode=0620,gid=5 0 0"
	    ],
	    ...
	    14	: $[
		"fields" : [
		    "nfs.suse.cz:/home", "/home", "nfs", "defaults", "0", "0"],
		"line"	 : "nfs.suse.cz:/home\t/home\tnfs\tdefaults 0 0"
	    ],
	    15	: $[
		"comment":true,
		"line":"#blah"
	    ]
	],
	"widths"	: [20, 20, 10, 21, 1, 1]
    ]
local root_mountpoint -> string

The root mount points e.g.: "/", "/mnt"

local valid_lines -> list<integer>

All checked valid lines e.g.: [1,2,3];

local not_valid_lines -> map

Not valid lines, e.g.: $[4: ["dev", false, true, true ,true ,true ,true ]],//spec error in line 4

local missing_devs -> list<string>

Devices without fstab entry e.g.: ["/dev/hdb7"]

global OSRFstab () -> void

Constructor: initialize data structures with default values

local fstab_default_exist (string exists, string key) -> list<string>

Parameters:
exists restrict the returned set only to the types with nonempty values of key 'exists'
key values of which key should be returned
local fstabline2map (list<string> line) -> map

e.g.: transform a fstab list to a fstab map. list: ["/dev/hda6", "/", "reiserfs", "defaults", "1", "1"] map : $[ "spec":"/dev/hda6", "file":"/" ... ]

Parameters:
line
global LinuxPartitions (list checked_partitions) -> list<string>

Find the list of all valid linux-partitions in the target-map.

Parameters:
checked_partitions
Return value:
The list of names of valid linux-partitions.
global MountablePartitions (list<string> linux_partition_list, string m_point) -> list<string>

Returns a list of names of all mountable partitions out of the specified list.

Parameters:
linux_partition_list
m_point the test mountpoint
Return value:
List of partition names successfully mounted to m_point.
global ValidRootPartitions (list<string> mount_possible_list, string mount_p) -> list<map>

Returns a list of names of all mountable partitions that contain a file /etc/fstab out of the specified list.

Parameters:
mount_possible_list
mount_p
Return value:
The list of partition-names that were successfully mounted to /mnt and contain a filesystem table.
global ReadFstab (string mount_p, boolean strict) -> boolean

Read the fstab file.

Parameters:
mount_p
strict
local remove_blanks (string c) -> string

Removes blanks from a string.

Parameters:
c
local uuid_string (list<string> line) -> string

Cat the uuid from a string.

Parameters:
line
local label_string (list<string> line) -> string

Cat the label from a string.

Parameters:
line
local check_fs_spec (list<string> line, map part) -> boolean

Check the spec (first) entry in a fstab line.

Parameters:
line
part
local check_fs_file (list<string> line) -> boolean

Check the file (second) entry in a fstab line.

Parameters:
line
local check_fs_vfstype (list<string> line, map part) -> boolean

Check the filesystem type (third) entry in a fstab line.

Parameters:
line
part
local check_fs_mntops (list<string> line) -> boolean

Check the mount options (fourth) entry in a fstab line.

Parameters:
line
local check_fs_freq (list<string> line, list<string> defaults) -> boolean

Check the freq (fifth) entry in a fstab line.

Parameters:
line
defaults
local check_fs_passno (list<string> line, list<string> defaults) -> boolean

Check the passno (sixth) entry in a fstab line.

Parameters:
line
defaults
local devname2part (string dev_name) -> map

Returns the partition map for a device. cdrom, floppy and zip devices are support too.

Parameters:
dev_name
local check_dev_entry (string p) -> boolean

Check if an entry for a device exist in the fstab.

Parameters:
p
local uuid2part (string uuidstring) -> map

Return the partition map for a special uuid.

Parameters:
uuidstring
local label2part (string labelstring) -> map

Return the partition map for a special label.

Parameters:
labelstring
local line2part (list<string> line) -> map

Return the partition map for a fstab line.

Parameters:
line
local check_fstab_line (integer lnr) -> boolean

Check one fstab line and return false if the line contains errors.

Parameters:
lnr
local devices2check () -> list<string>

All device that should be checked.

global Check (list<string> tswapable_partition_list, list<string> tchecked_partitions) -> boolean

Check if all entries in the fstab are valid and if all found devices have an entry in the fstab.

Parameters:
tswapable_partition_list
tchecked_partitions
local missing_devs_items (map new_entries) -> list<term>

Build items for table in missing devices dialog.

Parameters:
new_entries
local suggest_missing_entries () -> map

Build fstab entries for all existing devices that are not listed in the fstab.

global check_and_create_mount_points (map cmp) -> map

Parameters:
cmp : fstab line nr : mount point cmp : $[ 1 : "/hhh", 2 : "/mnt/uuu" ];
Return value:
create failed for mount points $[ 1 : "/hhh" ];
local SuggestMissingEntriesDialog () -> symbol

Dialog for existing devices that are not listed in the fstab.

local suggest_create_mp () -> map

local create_mp_items (map cmp) -> list<term>

Parameters:
cmp
local SuggestCreateMp () -> symbol

local suggest_remove_spec () -> list<integer>

Find all fstab entries (line nr) with not existing devices.

local remove_spec_items (list<integer> rm_entries, string ignore_label) -> list<term>

Build a item list for all fstab entries with not existing devices.

Parameters:
rm_entries
ignore_label
local SuggestRemoveSpecDialog () -> symbol

Dialog for all fstab entries with not existing devices.

local suggest_modify () -> map

Find all fstab lines with at least one invalid position

local modify_items (map nlines, string ignore_label, boolean existing) -> list<term>

Build a item list.

Parameters:
nlines
ignore_label
existing
local SuggestModifyDialog () -> symbol

Dialog for all fstab entries that have at least one invalid entry.

global Repair () -> symbol

Repair the fstab. Call sub dialogs.

global CheckRootEntry (string dev_name, list<string> tswapable_partition_list, list<string> tchecked_partitions) -> boolean

Parameters:
dev_name
tswapable_partition_list
tchecked_partitions
global BootDev () -> string

global SelectRoot (list<map> valid_root_partition_list) -> string

ask user to select the root partition

Parameters:
valid_root_partition_list
global ReadedSuccessfully () -> boolean

global UmountAll (list<map> umount_list) -> list<map>

Parameters:
umount_list
global UmountAllFrom (string root) -> list<map>

Parameters:
root
global RootDev (string root) -> list<map>

Parameters:
root
global MountAll (string root) -> list<map>

Mount all partitions specified in the fstab. If no fstab was readed try to find root partition and read fstab. Afterwards mount all partitions.

Parameters:
root