Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use wipefs to erase the signature of a file system

Shulou Source: shulou.com Published: 2022-06-01 14:03:28 10月04日 Update

This article mainly shows you "how to use wipefs to erase the signature of the file system", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use wipefs to erase the signature of the file system" this article.

Wipefs is a program that comes with linux and is used to erase the signature of the file system without emptying any other data in the file system or device. By default, wipefs does not erase unless the nested partition table is on the entire disk device. To do this, you need the * *-force** option.

Show disk current signature [root@localhost ~] # wipefs / dev/sdaDEVICE OFFSET TYPE UUID LABELsda 0x1fe dos [root@localhost ~] # wipefs / dev/sda1DEVICE OFFSET TYPE UUID LABELsda1 0x0 xfs f15a938f-f96d-4b56-8259-76f31c209694

How to use wipefs to delete a disk signature [root@localhost ~] # wipefs-a-f / dev/sda/dev/sda: 2 bytes were erased at offset 0x000001fe (dos): 55 aa

You can also back up a signature to the $HOME directory and clear the signature of the disk:

[root@localhost] # wipefs-a-f-b / dev/sda/dev/sda: 2 bytes were erased at offset 0x000001fe (dos): 55 aa

How to recover signature information:

[root@localhost] # dd if=~/wipefs-sda-0x000001fe.bak of=/dev/sda seek=$ ((0x000001fe)) bs=1 conv=notrunc2+0 records in2+0 records out2 bytes copied, 0.0007176 s, 2.8kB/s

Use the dd command to clear partition tables and signatures

In some cases, the signature of the disk cannot be queried using wipefs, and you can use the dd command to clear the partition table and signature:

At this point, you can use dd Ming to clear the signature:

[root@localhost ~] # dd if=/dev/zero of=/dev/sda1 bs=1M count=11+0 records in1+0 records out1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00103757 s, 1.0 GB/s

Use the following command to clear the MBR boot record:

[root@localhost ~] # dd if=/dev/zero of=/dev/sda bs=446 count=11+0 records in1+0 records out446 bytes copied, 0.000605243 s, 737 kB/s and above are all the contents of the article "how to use wipefs to erase the signature of a file system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Files systems disks contents commands articles partition tables situations devices learning help for this purpose information backup data understandability more organization directories knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS vpn NVidia Microsoft Shulou Technology