Table of Contents
You should be very careful when you communicate with the
parted_server. If parted_server detects
any error it will exit immediately. This is safer approach then to try to
resolve somehow the error. However this also means that the user will not be
shown any information about what happened and why the installer freezed. The
log-file /var/log/partman can be used to see the reasons
why parted_server exited.
Synopsis:
cddevice_directoryopen_dialog OPENdevice_nameread_line status close_dialog case $status in OK) # The device has been opened successfully ;; failed) # We wasn't able to open the device ;; esac
Here can be for
example device_name/dev/ide/host0/bus0/target0/lun0/disc.
Synopsis:
cd device_directory
open_dialog CLOSE
close_dialog
After this command you may not issue commands regarding the device of
. This command
does not invoke the command COMMIT.
device_directory
Synopsis:
cddevice_directoryopen_dialog VIRTUALpartition_idread_line virtuality close_dialog case $virtuality in yes) # the partition does not exist on the disk # probably because it is newly created ;; no) # the partition exists on the disk ;; esac
Synopsis:
cd device_directory
open_dialog DISK_UNCHANGED
close_dialog
After this command parted_server will know that the
partition table in its onw internal data structures is the same as the
partition table actualy existing on the device. The main purpose of this
command is to be used for partition tables with type loop.
Synopsis:
cd device_directory
open_dialog IS_CHANGED
read_line changed
close_dialog
case $changed in
yes)
# the partition table is changed
;;
no)
# the partition table is not changed
;;
esac
Synopsis:
cd device_directory
open_dialog DUMP
close_dialog
This command prints in /var/log/partition_dump all the
data regarding the device. It is used for debugging.
Synopsis:
cd device_directory
open_dialog COMMIT
close_dialog
This command transfers the partitions in the device of
from the
internal structures of parted_server to the disk.
device_directory
Synopsis:
cd device_directory
open_dialog UNDO
close_dialog
This command destroys the internal data structures in parted_server for a device and then rereads them from the device.
Synopsis:
cd device_directory
open_dialog PARTITIONS
while { read_line num id size type fs path name; [ "$id" ]; }; do
# do something for this partition
done
close_dialog
The body of the loop is executed for every partition and free space. $num is
the number of the partition (for example /dev/hda6 has
number 6). $id is the id of the partition. $size is the size of the partition
(in bytes). If this is an active partition then $type is either `primary' or
`logical'. If this is a free space then $type shows what partition can be
created in it. In this case $type can be `primary', `logical', `pri/log' or
`unusable'. $fs is `free' if this is a free space. Otherwise $fs is the type
of the file system of this partition as known to
parted_server. $path is a device name for the partition,
for example /dev/ide/host0/bus0/target0/lun0/part6. $name
is the name of the partition or the empty string if the partition table doesn't
support partition names.
Notice that in the loop-body you may not initiate another dialog with parted_server. If you need this you can use the following construction instead:
cd device_directory
open_dialog PARTITIONS
partitions=$(read_paragraph)
close_dialog
echo "$partitions" |
while { read num id size type fs path name; [ "$id" ]; }; do
# do something for this partition
done
Synopsis:
cddevice_directoryopen_dialog PARTITION_INFOpartition_idread_line num id size type fs path name close_dialog
Here is the id of
the partition to get info. The meaning of the variables are the same as in the
command PARTITIONS.
partition_id
Synopsis:
cddevice_directoryopen_dialog GET_CHSpartition_idread_line start_cyl start_head start_sector end_cyl end_head end_sector close_dialog
Synopsis:
cd device_directory
open_dialog LABEL_TYPES
supported=$(read_list)
close_dialog
For the result of this command
is irrelevant.
Despite this device_directory
must be a valid device directory.
device_directory
This command is used to read which types partition tables are supported by parted_server (i.e. by libparted). $supported is a comma-separated list of the supported types. At the time of writting the following types are supported: bsd, gpt, mac, dvh, msdos, pc98, sun and loop.