GNU/LiPE
is a program used to create/manipulate
partition tables.
While there existed many partition table editors for GNU/Linux, viz.
fdisk(8),
cfdisk(8),
sfdisk(8),
parted(8)
the author(s) found them to be too restrictive. This proved to be a real bottle-neck in case of disk disasters such as corruption of partition tables. And thus the idea to create GNU/LiPE was born.
GNU/LiPE is a functional equivalent of PowerQuest's (r) ptedit program for Windows (r). However, the overall effectiveness of GNU/LiPE is much more than the original program. GNU/LiPE runs in three modes:
Command-line mode:
It supports partition table reading (dump) and partition table writing (pump) through
standard input
and
standard output
respectively. You can
redirect
to (and/or from) input (output) to a disk file. Now you can edit the file using any text editor and write the edited file to the partition table using input redirection.
Menu-driven text mode:
This is the default mode of GNU/LiPE when gtk based mode is not enabled at compile time. In this mode you are provided with a screen showing your partition table. You are shown one partition table at a time. You can move back-and-forth between these partition tables.
Remember:
Partition tables are implemented in a linked-list sort of structure. So the partition entries shown by fdisk program may actually be in separate partition tables. You can open a partition table at a particular sector by pressing appropriate key. The online-help in this mode can be accessed by pressing F1 or `?'. There you can see all the key bindings.
Keys Corresponding Action
<Esc> or <ctrl>-x or q Exit from program
<Left> or h Move (scroll) Left
<Down> or j Move Down
<Up> or k Move Up
<Right> or l Move (scroll) Right
<F4> or <Return> or a Edit the highlighted value
<F3> or ! Reset whole of the partition-table
<F2> or <ctrl>-s or w Save partition-table data to device
<ctrl>-f or n Move to Next partition-table
<ctrl>-b or p Move to Previous partition-table
<tab> or e Open a new device-file
r Read partition-table from
<F1> or ? Show Help screen
t List some well known partition types
Menu-driven graphics mode:
Supports gtk based graphical mode. Graphics mode currently takes no options.
Warning:
GNU/LiPE performs a
bare minimum
set of tests on the data entered by the user. This is not a bug. It was designed to do so. So based on the ``saneness'' of the user it can be either useful or harmful. You were warned :)
OPTIONS
--assume-extended
When used in conjunction with --dump and --starting-sector command line options (ignored otherwise), specifies that the partition table read from
starting-sector
( see help for command-line option
--starting-sector
) is from an EPBR and not from MBR. Even after using this option it is not guaranteed that there will be no false output. (This is due to the way data is stored.)
-b sector-size
--bytes-in-sectore sector-size
Specifies the sector size of the disk. Valid values are 512, 1024 and 2048. Useful only in case of very old kernels.
-d device-file
--device device-file
Opens
device-file
for either input or output. Some examples of device-file are /dev/hda, /dev/hdd, /dev/sdc, /dev/sdb.
Note
that both the menu-driven modes do not require device-file to be specified on the command-line. However, the command-line mode requires you to specify a device-file.
--dump raw|readable
Dumps (displays) all partition table information of a particular
device-file
( see help for
--device
) to standard output. This information can itself be of two types
raw
or
readable.
Raw corresponds to case when all the data is dumped as hexadecimal characters. While in readable mode most of the values are shown as decimal numbers.
Note:
If --no-follow command-line option is not specified, all the partition-tables are read recursively and dumped to screen. You can also specify an exact starting-sector by using --starting-sector command-line option.
-g
--graphics
Specifies that menu-driven graphics mode (requires svgalib) be started. This mode is not yet supported.
-h
--help
Displays GNU/LiPE help information. Useful for quick reference.
--no-follow
Specifies that you do not want to dump all the partition-tables recursively, during the dumping (ignored otherwise) of the partition-tables. Instead you want dumping to stop after dumping of the first partition-table.
--pump raw|readable
Pumps (writes) all partition table information given through standard input to a
device-file
( see help for
--device
). The partition table information is generally modified output of --dump command-line option described above. Now, this information can itself be of two types
raw
or
readable.
Raw corresponds to case when all the data is read as hexadecimal characters. While in readable mode most of the values are read as decimal numbers. See the corresponding output from --dump command-line option to see how partition information is to be given through the
standard input
in both cases.
Note:
While pumping the values are written to the sector given on the line starting with a `;'. All other values are niether checked nor used. The
starting-sector
( see help for
--starting-sector
) has no effect in case of --pump. Similarly --no-follow command-line option is ignored and all the partition-tables present in the standard-input are written to the
device-file
( see help for
--device
). The device-file can be any file and thus before performing an actual write testing can be done.
--starting-sector starting-sector
Specifies the sector from which first partition-table is to be read. Subsequent behavior depends upon the use of other command-line options.
-t
--text
Specifies that menu-driven text mode (requires ncurses library) be started. This option is actually not required because as of writing this is the default mode of the program. More information about this mode can be found from the online-help itself.
-v
-V
--version
Displays GNU/LiPE version information.
EXAMPLES
To start menu-driven text mode give the command
lipe
You will be asked for a device-file at a later stage.
To start menu-driven graphics mode give the command
lipe -g
To dump all the partition information of a device-file into a file named dumped.pt in raw format give the command
lipe --dump raw --device=/dev/hdb > dumped.pt
To pump all the partition information from a file named dumped.pt to a device-file in readable format give the command
Basic program engine and ncurses part was coded by Neeraj Jakhar.
And just to complete the story:
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.