summaryrefslogtreecommitdiffstats
path: root/misc-utils/wipefs.8
Commit message (Collapse)AuthorAgeFilesLines
* wipefs: postpone BLKRRPART until all is doneKarel Zak2018-06-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's possible we erase from the whole device before we erase from the partition on the same disk: # wipefs -a /dev/sdc /dev/sdc1 the current code calls re-read PT ioctl immediately after erase (so, before sdc1 is processed). The result is that sdc1 node is no more accessible: # wipefs -a /dev/sdc /dev/sdc1 /dev/sdc: 2 bytes were erased at offset 0x000001fe (dos): 55 aa /dev/sdc: calling ioctl to re-read partition table: Success wipefs: error: /dev/sdc1: probing initialization failed: No such file or directory It seems the most simple solution is to postpone the re-read ioctl and do it as the last thing. # wipefs -a /dev/sdc /dev/sdc1 /dev/sdc: 2 bytes were erased at offset 0x000001fe (dos): 55 aa /dev/sdc1: 2 bytes were erased at offset 0x00000438 (ext4): 53 ef /dev/sdc: calling ioctl to re-read partition table: Success The patch also adds a small delay before the re-read ioctl call. It's not elegant, but without the usleep(25000) the first attempt returns EBUSY. Addresses: https://github.com/karelzak/util-linux/issues/598 Signed-off-by: Karel Zak <kzak@redhat.com>
* man: Use the correct macro for a font change of one argumentBjarni Ingi Gislason2018-05-231-6/+6
| | | | | | | | Use the correct macro (I, B) for the font change of one argument, not those that are used for alternating two fonts, like "BR", "IR", "RB", or "RI". Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
* misc: fix typosSami Kerola2017-11-281-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* wipefs: use libsmartcolsKarel Zak2017-06-291-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* wipefs: print all signature permutationsKarel Zak2017-06-281-8/+4Star
| | | | | | | | | | | | | The same FS/RAID/PT signature may be detected by more ways and on more places on the device. The libblkid returns only the first detected signature by default. This patch use blkid_probe_hide_range() to re-scan device for all possible permutations of the same signature. For example the default wipefs(8) output as well as --no-act output will contains primary as well as backup GPT signature now. Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: add note about no-act to the man pageKarel Zak2017-05-111-2/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: replace FTP by HTTPS in kernel.org URLsSébastien Helleu2016-12-191-1/+1
| | | | | | | The links to ftp://ftp.kernel.org/ are replaced by https://www.kernel.org/. Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: remove obsolete and unneeded comments from man-page filesBenno Schulenberg2015-01-121-1/+0Star
| | | | | | | Transform some of them into copyright lines. Also fix three header lines and snip some trailing whitespace. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* docs: improve some wordings on the man page of wipefsBenno Schulenberg2015-01-061-16/+17
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* docs: update info about env debug variablesKarel Zak2014-11-031-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: don't erase nested partition tables by defaultKarel Zak2014-04-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | It's possible the partition contains a partition table (BSD, or hybrid boot images). It could be unexpected for users that the lost all (or another) partitions when work with non-whole disk device. Let's require --force. For example: # wipefs --all /dev/sdb erases all including partition table, but on hybrid disk where the first partition starts at first sector (so partition table is within the first partition): # wipefs --all /dev/sdb1 /dev/sdb1: ignore nested "dos" partition table on non-whole disk device wipefs: Use the --force option to force erase. asks for --force. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1077310 Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: call BLKRRPART when erase partition tableKarel Zak2014-01-201-0/+3
| | | | | | | | It's better to be smart than make things inconsistent (without BLKRRPART kernel still uses the erased PT and udev-db still contains obsolete information). Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: standardize the phrases for --help and --version in all man pagesBenno Schulenberg2013-10-151-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* standard SEE ALSO section of man pagesMike Frysinger2013-05-131-2/+1Star
| | | | | | | | The standard format is to seperate each entry with a comma, and for each one to be on a line by itself. Most util-linux pages follow this, but a few do not. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* wipefs: add --backupOndrej Oprala2013-04-261-0/+12
| | | | | | | | [kzak@redhat.com: - don't wipe if failed to create a backup file - use ts_scsi_debug_init in the regression tests] Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: make the section AVAILABILITY always come last in man pagesBenno Schulenberg2013-03-201-3/+3
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* docs: normalize formatting of wipefs man pageBenno Schulenberg2013-03-201-30/+38
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* docs: add TB to list of supported suffixesKarel Zak2013-03-181-1/+1
| | | | | Reported-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: Add --force option to force it to erase.Richard W.M. Jones2012-11-201-0/+3
| | | | | | | | | | | | | | Commit c550f728f724360f99aae0fdb45b0589d9a347e0 added O_EXCL when opening the thing to erase. This broke the wipefs utility when used on anything which isn't an unmounted filesystem. eg. If you use it on a block device containing partitions, then it won't work because the kernel recognizes the partitions and so thinks the device is in use. This change adds the --force option which, when used, undoes the above flag change. However you still have to use --force most of the time when erasing something that isn't a plain unmounted filesystem. Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
* blkid: document LIBBLKID_DEBUG usersDavidlohr Bueso2012-09-041-0/+3
| | | | | | | Update the manpages of programs that use this environment variable for extra debugging information. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* docs: clarify KiB vs. KB in man pagesBernhard Voelker2012-03-301-3/+4
| | | | | | | | | Update the man pages of blkid, wipefs, fallocate, fstrim, losetup and hexdump to clarify the suffixes for the numerical values of the offset and size/length arguments regarding KiB=1024 vs KB=1000. Also mention the ZiB/YiB and ZB/YB suffixes supported by strtosize(). Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* wipefs: support more device arguments for wipefsMilan Broz2012-03-011-1/+1
| | | | | | | [kzak@redhat.com: - print devname only if more devices specified] Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: add quiet flag (-q)Milan Broz2012-03-011-0/+2
| | | | | Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: add -t <list> optionKarel Zak2011-11-151-6/+26
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: uniformize the header and footer lines in man pagesBenno Schulenberg2011-08-221-1/+1
| | | | | | | | | | Use dates without the day, use the full month name, put "util-linux" in the lower left corner, and "User Commands" or "System Administration" at the top center. Also improve here and there the one-line program description. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* wipefs: change option -v to -V for --version; add it to man pageBenno Schulenberg2011-08-081-2/+4
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: tweak several manpages, mainly the blkid oneBenno Schulenberg2011-03-081-7/+7
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* rename util-linux-ng back to util-linuxKarel Zak2010-11-301-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: support suffixes for --offsetKarel Zak2010-03-301-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: cleanup usage() and man pageKarel Zak2010-03-151-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: new commandKarel Zak2009-10-061-0/+45
# ./wipefs /dev/sda4 offset type ---------------------------------------------------------------- 0xff6 swap [other] UUID: da6c54ea-77d9-470a-82f1-e793fd5d9131 0x36 vfat [filesystem] UUID: 497F-3013 # ./wipefs --offset 0x36 /dev/sda4 8 bytes [46 41 54 31 32 20 20 20] erased at offset 0x36 (vfat) Signed-off-by: Karel Zak <kzak@redhat.com>