Richard W.M. Jones
2013-Feb-04 18:23 UTC
[Libguestfs] Should we always do wipefs before mkfs? Discuss ...
https://bugzilla.redhat.com/show_bug.cgi?id=907554 In particular comments 2 & 3. We could change libguestfs's guestfs_mkfs (internally) so it always does an implicit wipefs on the filesystem. wipefs is not too onerous -- in particular I believe it only writes to a few chosen areas of the disk. Especially considering that we're about to run mkfs anyway which for some filesystems writes a lot of blocks. Thoughts? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Karel Zak
2013-Feb-05 09:20 UTC
[Libguestfs] Should we always do wipefs before mkfs? Discuss ...
On Mon, Feb 04, 2013 at 06:23:38PM +0000, Richard W.M. Jones wrote:> > https://bugzilla.redhat.com/show_bug.cgi?id=907554All mkfs.<type> should be robust enough to wipe the device. I'm currently working with guys around filesystems to improve mkfs.ext4 and mkfs.xfs https://bugzilla.redhat.com/show_bug.cgi?id=902512 .. but nothing is perfect so explicitly call wipefs(8) from installers or things like libguestfs is definitely good idea.> We could change libguestfs's guestfs_mkfs (internally) so it always > does an implicit wipefs on the filesystem. wipefs is not too onerous -- > in particular I believe it only writes to a few chosen areas of the > disk. Especially considering that we're about to run mkfs anyway > which for some filesystems writes a lot of blocks.wipefs(8) (or blkid_do_wipe() from the library) wipes only magic strings to make the filesystem (raids or partition tables) invisible for libblkid. It means very few bytes.> Thoughts?Go ahead :-) Karel -- Karel Zak <kzak at redhat.com> http://karelzak.blogspot.com