diff options
author | Karel Zak | 2017-06-29 11:57:22 +0200 |
---|---|---|
committer | Karel Zak | 2017-06-29 11:59:38 +0200 |
commit | d9921b2a128f17aa9a9a110444d5faa43e1b371c (patch) | |
tree | 1bd69c60ad1ec6020b44197a04e8a1cb010ff979 /misc-utils/wipefs.8 | |
parent | uuidparse: se JSON table name on -J (diff) | |
download | kernel-qcow2-util-linux-d9921b2a128f17aa9a9a110444d5faa43e1b371c.tar.gz kernel-qcow2-util-linux-d9921b2a128f17aa9a9a110444d5faa43e1b371c.tar.xz kernel-qcow2-util-linux-d9921b2a128f17aa9a9a110444d5faa43e1b371c.zip |
wipefs: use libsmartcols
The old output is horrible and useless when more devices specified.
The old format is also too tricky if more signatures detected. The new
output uses one line for each signature, prefixed by device name.
For example my workstation:
# wipefs /dev/sda* /dev/sdb*
DEVICE OFFSET TYPE UUID LABEL
sda 0x1fe PMBR
sda 0x37e4895e00 gpt
sda 0x200 gpt
sda1 0x1fe vfat F2BC-BFEC EFI
sda1 0x0 vfat F2BC-BFEC EFI
sda1 0x36 vfat F2BC-BFEC EFI
sda2 0x438 ext4 c5490147-2a6c-4c8a-aa1b-33492034f927 BOOT
sda3 0x438 ext4 196972ad-3b13-4bba-ac54-4cb3f7b409a4 HOME
sda4 0x438 ext4 d834bc84-0089-4be1-9013-cd8bf35d5ffa ROOT
sda5 0x438 ext4 e8ce5375-29d4-4e2f-a688-d3bae4b8d162 WINE
sda6 0xff6 swap 210337c6-f8b5-4d65-aab5-a0f343fa9ad4 SWAP
sdb 0x200 gpt
sdb 0x1fe dos
sdb1 0x438 ext4 6467a684-0d10-4f61-a301-67bb26934d90
This patch add --noheadings, --json and --output.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/wipefs.8')
-rw-r--r-- | misc-utils/wipefs.8 | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/misc-utils/wipefs.8 b/misc-utils/wipefs.8 index 283c0b0e5..5d768f2f9 100644 --- a/misc-utils/wipefs.8 +++ b/misc-utils/wipefs.8 @@ -6,9 +6,18 @@ wipefs \- wipe a signature from a device .SH SYNOPSIS .B wipefs -.RB [ \-ahnpqtV ] -.RB [ \-o -.IR offset ] +.RB [ options ] +.IR device ... +.sp +.B wipefs +.RB [ \-\-backup ] +.RB \-o +.IR offset +.IR device ... +.sp +.B wipefs +.RB [ \-\-backup ] +.RB \-a .IR device ... .SH DESCRIPTION .B wipefs @@ -19,8 +28,13 @@ to make the signatures invisible for libblkid. .B wipefs does not erase the filesystem itself nor any other data from the device. -When used without any options, \fBwipefs\fR lists all visible filesystems -and the offsets of their basic signatures. +When used without any options, wipefs lists all visible filesystems and the +offsets of their basic signatures. The default output is subject to change. +So whenever possible, you should avoid using default outputs in your scripts. +Always explicitly define expected columns by using +.B \-\-output +.I columns-list +in environments where a stable output is required. .B wipefs calls the BLKRRPART ioctl when it has erased a partition-table signature @@ -59,6 +73,16 @@ order to erase a partition-table signature on a block device. .BR \-h , " \-\-help" Display help text and exit. .TP +.BR \-J , " \-\-json" +Use JSON output format. +.TP +.BR \-n , " \-\-noheadings" +Do not print a header line. +.TP +.BR \-O , " \-\-output " \fIlist\fP +Specify which output columns to print. Use \-\-help to +get a list of all supported columns. +.TP .BR -n , " \-\-no\-act" Causes everything to be done except for the write() call. .TP @@ -89,6 +113,9 @@ taken. For more details see mount(8). Display version information and exit. .SH EXAMPLES .TP +.BR "wipefs /dev/sda*" +Prints infomation about sda and all partitions on sda. +.TP .BR "wipefs --all --backup /dev/sdb" Erases all signatures from the device /dev/sdb and creates a signature backup file ~/wipefs-sdb-<offset>.bak for each signature. |