Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wipefs doesn't completely wipe zfs filesystem #1228

Open
omkhar opened this issue Jan 3, 2021 · 5 comments
Open

wipefs doesn't completely wipe zfs filesystem #1228

omkhar opened this issue Jan 3, 2021 · 5 comments
Labels
TODO We going to think about it ;-)

Comments

@omkhar
Copy link

omkhar commented Jan 3, 2021

wipefs doesn't seem to wipe all the zfs filesystem bits from the disk.

  1. Install Ubuntu Linux 20.04 /w zfs
  2. Install Clear Linux 3004 /w defaults (destructive install) - Clear Linux install will fail
  3. Run wipefs -a /dev/hda
  4. Install Clear Linux 3004 /w defaults (destructive install) - Clear Linux install will fail
  5. Run dd if=/dev/zero of=/dev/sda bs=1G
  6. Install Clear Linux 3004 /w defaults (destructive install) - Clear Linux install will succeed

Further details and logs here: clearlinux/clr-installer#753

@karelzak
Copy link
Collaborator

karelzak commented Jan 5, 2021

What does it mean "does not completely wipe"?

man wipefs:

       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.

It does not zeroize the device. The goal is to remove all stuff that is relevant for libblkid (blkid) to detect the FS, but nothing more.

@karelzak karelzak added the NEEDINFO Need more information from reporter label Jan 5, 2021
@omkhar
Copy link
Author

omkhar commented Jan 5, 2021 via email

@karelzak
Copy link
Collaborator

karelzak commented Jan 6, 2021

It wipes all traces which is libblkid able and want to detect :-)

libblkid need to optimize how it scans the device to avoid overhead. Unfortunately, ZFS is extremely variable with root block(s) locations. Now libblkid detects the 4 uberblocks to get a positive match.

Maybe we can extend the current behavior if BLKID_SUBLKS_MAGIC flags specified (used by wipefs) to read more locations. I'll add this to our TODO.

Anyway, for installers, it's probably a good idea to use dd(1) to wipe the first few MiBs from the beginning and the end of the device. I would recommend wipefs(8) as the second step to be sure that there is not remaining anything detectable on the device for udev.

@karelzak karelzak added TODO We going to think about it ;-) and removed NEEDINFO Need more information from reporter labels Jan 6, 2021
karelzak added a commit that referenced this issue Jan 6, 2021
Addresses: #1228
Signed-off-by: Karel Zak <kzak@redhat.com>
@Nottt
Copy link

Nottt commented Jun 16, 2023

I'm still having this issue. and I don't know what to do? It's a big disk I don't want to rewrite everything. I tried wiping 1 MB of the end of the disk too and lsblk still detects it

@t-8ch
Copy link
Member

t-8ch commented Jun 16, 2023

@Nottt
Could you provide a concrete test protocol to reproduce the issue?

And/or provide blkid and wipefs logs with LIBBLKID_DEBUG=all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TODO We going to think about it ;-)
Projects
None yet
Development

No branches or pull requests

4 participants