If you’re reading this right now because you just ran wipefs -a on the wrong disk or partition, you’re probably enduring that familiar data loss sinking feeling. In the case of a disk, you might be able to restore your partition table using something like testdisk, or, if you still have the output of wipefs, you can directly “undelete” what wipefs just deleted. Wipefs can erase filesystem, raid or partition-table signatures (magic strings) from the specified device to make the signatures invisible for libblkid. Wipefs does not erase the filesystem itself nor any other data from the device. When used without options -a or -o, it lists all visible filesystems and the offsets of their basic signatures. In this example we will use wipefs to delete LVM metadata from /dev/sdb device. Since the device in question /dev/sdb is in use by Volume Group, we have to use -f to forcefully wipe the LVM metadata root@centos-8 # wipefs -all -backup -f /dev/sdb /dev/sdb: 8 bytes were erased at offset 0x00000218 (LVM2member): 4c 56 4d 32 20 30 30 31. Download WipeFS for macOS 10.12 or later and enjoy it on your Mac. Erases the free space on hard disks (including Solid State/SSD), USB flash drives etc. The time it takes to wipe a volume depends on the size of the volume, the speed of your Mac (and amount of RAM), and how many passes you specify.
This short tutorial will show you how to wipe or delete device signature on a USB flash disk using wipefs command on Ubuntu. Previously, I got many errors when trying to delete partitions on my USB Flash disk which contains Fedora filesystem inside. The Fedora filesystem brings error (device signature) on Ubuntu when using GParted to repartition the device. So, first I must delete the signature information on the USB disk before I can use it with GParted. To wipe this device signature, I use wipefs command.
What is wipefs ?
wipefs is a special command that will wipe the signature from a device. When combined with -a option, wipefs command will erase the whole filesystem, raid or partition-table signature on a specific device to make the signatures invisible for libblkid. (read the original source)
How to use wipefs?
I will show you how to use wipefs command using my own example. Here is my fdisk -l command output, showing the detailed information about my disks.
Disk /dev/sda: 465,8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc0e05ef6
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 195311615 195309568 93,1G 83 Linux
/dev/sda4 195313662 976771071 781457410 372,6G f W95 Ext’d (LBA)
/dev/sda5 567175168 976771071 409595904 195,3G 7 HPFS/NTFS/exFAT
/dev/sda6 195313664 488280063 292966400 139,7G 83 Linux
/dev/sda7 488282112 567175167 78893056 37,6G 82 Linux swap / Solaris
Partition table entries are not in disk order.
Disk /dev/sdb: 3,8 GiB, 4063232000 bytes, 7936000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x165c7323
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 7935999 7933952 3,8G 7 HPFS/NTFS/exFAT
Look at the /dev/sdb section. I will wipe the /dev/sdb (my usb disk) using wipefs command
First, make sure there is no mounted partition on the USB disk. Use the umount command to unmount.
sudo umount /dev/sdb1
Wipefs Mdadm
Now wipe the disk using wipefs
sudo wipefs -a /dev/sdb
If it success, it should show something like this
gamblisfx@gamblisfx-comp:~$ sudo wipefs -a /dev/sdb
/dev/sdb: 2 bytes were erased at offset 0x000001fe (dos): 55 aa
/dev/sdb: calling ioclt to re-read partition table: Success
Now check the device using fdisk command
sudo fdisk -l
gamblisfx@gamblisfx-comp:~$ sudo fdisk -l
Disk /dev/sda: 465,8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc0e05ef6
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 195311615 195309568 93,1G 83 Linux
/dev/sda4 195313662 976771071 781457410 372,6G f W95 Ext’d (LBA)
/dev/sda5 567175168 976771071 409595904 195,3G 7 HPFS/NTFS/exFAT
/dev/sda6 195313664 488280063 292966400 139,7G 83 Linux
/dev/sda7 488282112 567175167 78893056 37,6G 82 Linux swap / Solaris
Partition table entries are not in disk order.
Disk /dev/sdb: 3,8 GiB, 4063232000 bytes, 7936000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Now look at the /dev/sdb device. There is no more partitions found on the device which means all the partitions and signature information have been erased. Now we can start create new partition and filesystem to the USB disk. Please be careful when doing this. Any error or mistakes can damage your data on the disk forever.
WipeFS
2.0
WipeFS erases unused space on hard disks, USB flash drives etc, to prevent the recovery of deleted files. Any data which still resides in that unused space, albeit marked 'free', can be properly and securely deleted by overwriting it. As you may know, simply deleting a file does not actually delete the content of the file. Instead, the space that file occupied on the disk is simply marked as being 'free', and may exist for a long time until another file is allocated that space (or part of it).
Simply check the drive(s) you want to work on, the number of passes you want to perform (see Preferences) and click the 'Start' button.
When wiping begins, you are shown the following information:
• The name of the volume whose free space is currently being wiped.
• The value being used to overwrite the data (see Preferences).
• The segment number and total number of segments (segments are files the application writes to your volume, they are temporary and deleted after wiping has completed successfully).
• The current pass of the segment (see Preferences), if applicable.
Erase Hard Drive Windows 10
• The overall progress.
The time it takes to wipe a volume depends on the size and type of the volume, the speed of your Mac (and amount of RAM), and how many passes you specify. Obviously, 8 passes will take eight times longer than 1 pass. Solid State Drives are quicker than conventional hard drives.
Wipefs
When wiping the free space on a volume you will be asked to select a folder in which this app can store temporary files. You must have read/write permissions for the chosen folder. We suggest you use the folder you are presented with.
The files created by this app will be cleaned-up after the free space has been successfully wiped or the process is aborted using the 'Stop' button.
In the event the temporary files created by the application are not deleted, select the drives above and then click the 'Clean up' button. You will then regain any lost disk space. If no temporary files are found, nothing will happen, if there are temporary files deleted you will be told how many were deleted.