summaryrefslogtreecommitdiffstats
path: root/misc-utils/wipefs.c
Commit message (Collapse)AuthorAgeFilesLines
...
* wipefs: use strtosize_or_err()Karel Zak2012-03-301-11/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: Fix mismatch if more -o options used.Milan Broz2012-03-081-41/+59
| | | | | | | | | | | | | | | | | If there are more offset options specified, some could be lost. Try pvcreate /dev/sd[bcde] mdadm -C -l 5 -n4 /dev/md0 /dev/sd[bcde] mdadm --stop /dev/md0 wipefs -n -o 0x1000 -o 0x218 /dev/sdb - LVM2 signature remains there wipefs -n -o 0x218 -o 0x1010 /dev/sdb - no report about ignored signature Signed-off-by: Milan Broz <mbroz@redhat.com>
* wipefs: always print devnameKarel Zak2012-03-011-9/+2Star
| | | | | | It seems too smart to print devname according to number of devices. Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: support more device arguments for wipefsMilan Broz2012-03-011-19/+40
| | | | | | | [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-6/+11
| | | | | Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: corrections to FSF license files, and postal addressSami Kerola2012-02-241-3/+3
| | | | | | | | | | | | | | The COPYING and Documentation/licenses/COPYING* files are being replaced by files from GNU web site. http://www.gnu.org/licenses/gpl-2.0.txt http://www.gnu.org/licenses/lgpl-2.1.txt Postal addresses to FSF in other files are updated to match with the address in license files. Reference: http://lists.gnu.org/archive/html/freefont-announce/2005-04/msg00001.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* wipefs: use xalloc libDavidlohr Bueso2011-12-161-4/+1Star
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* wipefs: add -t <list> optionKarel Zak2011-11-151-1/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: export info about PT magic stringsKarel Zak2011-11-131-34/+39
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: improve -a, use blkid_do_wipe()Karel Zak2011-11-111-66/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some filesystems (e.g. FAT) is possible to detect in many ways -- for example if a magic string is stored on more places on the device. The current implementation always removes from the device only the firstly detected possibility. # wipefs /dev/sdb1 offset type ---------------------------------------------------------------- 0x36 vfat [filesystem] UUID: D203-A7F4 # wipefs -a /dev/sdb1 8 bytes [46 41 54 31 36 20 20 20] erased at offset 0x36 (vfat) # wipefs /dev/sdb1 offset type ---------------------------------------------------------------- 0x0 vfat [filesystem] UUID: D203-A7F4 This patch fixes this issue: # wipefs -a /dev/sdb1 8 bytes were erased at offset 0x00000036 (vfat): 46 41 54 31 36 20 20 20 1 bytes were erased at offset 0x00000000 (vfat): eb 2 bytes were erased at offset 0x000001fe (vfat): 55 aa Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: cleanup usage()Karel Zak2011-08-161-10/+11
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: change option -v to -V for --version; add it to man pageBenno Schulenberg2011-08-081-4/+4
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* wipefs: gettextize one sentence as a wholeBenno Schulenberg2011-08-021-2/+3
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* wipefs: add version printing & compiler warningSami Kerola2011-06-251-4/+9
| | | | | | | The --version option is added, and a storage type is fixed to correct a compiler warnings. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* move struct option to .rodataKarel Zak2011-03-031-1/+1
| | | | | | | It does not make sense to have writable large arrays of "struct option" on the stack. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: provide alternatives for err, errx, warn and warnxFabian Groffen2011-02-141-1/+1
| | | | | | | | Solaris lacks err, errx, warn and warnx. This also means the err.h header doesn't exist. Removed err.h include from all files, and included err.h from c.h instead if it exists, otherwise alternatives are provided. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* wipefs: use write_all from include/writeall.hPetr Uzel2011-02-081-18/+1Star
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* wipefs: fail if more device arguments specifiedMilan Broz2010-12-301-0/+3
| | | | | | | | Currently wipefs process only first device argument and silently ignores remaining. Print error instead because it can be quite confusing. Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [xalloc] add xstrdup()Karel Zak2010-11-241-9/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [strutils] general purpose string handling functionsDavidlohr Bueso2010-11-231-1/+1
| | | | | | | | | | | | | This patch replaces a few functions used throughout the source: * Renames getnum (from schedutils) to strtol_or_err * Moves strtosize (from lib/strtosize.c) * Moves xstrncpy (from include/xstrncpy.h) * Adds strnlen, strnchr and strndup if not available (remove it from libmount utils) A few Makefile.am files were modified to compile accordingly along with trivial renaming in schedutils source code. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* misc-utils: use new xmalloc() wrapperDavidlohr Bueso2010-10-211-9/+1Star
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* wipefs: fix memory leaksKarel Zak2010-06-161-0/+19
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: fix mem usageKarel Zak2010-06-161-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: fix typos, and rephrase some things for clarityBenno Schulenberg2010-06-141-5/+5
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* wipefs: print warning is PT detectedKarel Zak2010-04-221-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: support suffixes for --offsetKarel Zak2010-03-301-12/+5Star
| | | | 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: fix license (GPL -> GPLv2+)Karel Zak2010-02-231-3/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: ignore devices with partition tableKarel Zak2010-02-041-1/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* po: fix msgid bugsKarel Zak2009-12-101-1/+1
| | | | | Reported-by: Petr Pisar <petr.pisar@atlas.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: remove obsolete commentKarel Zak2009-10-301-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: fix coding styleKarel Zak2009-10-071-2/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: new commandKarel Zak2009-10-061-0/+386
# ./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>