]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
isfdisk: improve --backup documentation
authorKarel Zak <kzak@redhat.com>
Thu, 9 Dec 2021 09:56:07 +0000 (10:56 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 9 Dec 2021 09:56:07 +0000 (10:56 +0100)
* add reference to backup section
* add note that backup is done always after startup
* remove TODO item about --backup, it seems that back after open is
  only way how we can make it with current libfdisk, because
  fdisk_locate_disklabel() returns current in-memory rather than on-disk
  situation.

Addresses: https://github.com/util-linux/util-linux/issues/850
Signed-off-by: Karel Zak <kzak@redhat.com>
Documentation/TODO
disk-utils/sfdisk.8.adoc

index 855e032424f6effe3eb6549faf1d140650080910..eae71648b84bf33f7aeac996a757f439fa59e4fd 100644 (file)
@@ -168,12 +168,6 @@ libfdisk
    * support nested labels parsing from dump
    see https://github.com/util-linux/util-linux/issues/850
 
-sfdisk
-------
-
- - don't backup PT in interactive mode before write to the devices is requested,
-   see https://github.com/util-linux/util-linux/issues/852
-
 misc
 ----
 
index 726f44bbc923087ee1bc1cefbc54df67c366f245..f45db414aa995397f27866e557304a3536497b22 100644 (file)
@@ -141,7 +141,7 @@ Don't create a new partition table, but only append the specified partitions.
 Note that unused partition maybe be re-used in this case although it is not the last partition in the partition table. See also *-N* to specify entry in the partition table.
 
 *-b*, *--backup*::
-Back up the current partition table sectors before starting the partitioning. The default backup file name is _~/sfdisk-<device>-<offset>.bak_; to use another name see option *-O*, *--backup-file*.
+Back up the current partition table sectors before starting the partitioning. The default backup file name is _~/sfdisk-<device>-<offset>.bak_; to use another name see option *-O*, *--backup-file*. See section *BACKING UP THE PARTITION TABLE* for more details.
 
 *--color*[**=**__when__]::
 Colorize the output. The optional argument _when_ can be *auto*, *never* or *always*. If the _when_ argument is omitted, it defaults to *auto*. The colors can be disabled; for the current built-in default see the *--help* output. See also the *COLORS* section.
@@ -356,7 +356,8 @@ ____
 *sfdisk /dev/sda < sda.dump*
 ____
 
-If you want to do a full (binary) backup of all sectors where the partition table is stored, then use the *--backup* option. It writes the sectors to _~/sfdisk-<device>-<offset>.bak_ files. The default name of the backup file can be changed with the *--backup-file* option. The backup files contain only raw data from the _device_. Note that the same concept of backup files is used by *wipefs*(8). For example:
+If you want to do a full (binary) backup of all sectors where the partition table is stored, then use the *--backup* option. It writes the sectors to _~/sfdisk-<device>-<offset>.bak_ files. The default name of the backup file can be changed with the *--backup-file* option. The backup files contain only raw data from the _device_. *sfdisk* writes backup files immediately after startup, this operation is independent, and the backup is done although the device is not modified later.
+For example:
 
 ____
 *sfdisk --backup /dev/sda*
@@ -365,10 +366,11 @@ ____
 The GPT header can later be restored by:
 
 ____
-dd  if=~/sfdisk-sda-0x00000200.bak  of=/dev/sda  \
-  seek=$\((0x00000200))  bs=1  conv=notrunc
+dd if=~/sfdisk-sda-0x00000200.bak of=/dev/sda seek=$\((0x00000200)) bs=1 conv=notrunc
 ____
 
+The same concept of backup files is used by *wipefs*(8).
+
 Note that *sfdisk* since version 2.26 no longer provides the *-I* option to restore sectors. *dd*(1) provides all necessary functionality.
 
 == COLORS