public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [Libguestfs] Should we always do wipefs before mkfs?  Discuss ...
@ 2013-02-04 18:23 Richard W.M. Jones
  2013-02-05  9:20 ` Karel Zak
  0 siblings, 1 reply; 3+ messages in thread
From: Richard W.M. Jones @ 2013-02-04 18:23 UTC (permalink / raw)
  To: libguestfs; +Cc: berrange, kzak, util-linux


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Libguestfs] Should we always do wipefs before mkfs?  Discuss ...
  2013-02-04 18:23 [Libguestfs] Should we always do wipefs before mkfs? Discuss Richard W.M. Jones
@ 2013-02-05  9:20 ` Karel Zak
  2013-02-05  9:37   ` Richard W.M. Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Karel Zak @ 2013-02-05  9:20 UTC (permalink / raw)
  To: Richard W.M. Jones; +Cc: libguestfs, berrange, util-linux

On Mon, Feb 04, 2013 at 06:23:38PM +0000, Richard W.M. Jones wrote:
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=907554

 All 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@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Libguestfs] Should we always do wipefs before mkfs?  Discuss ...
  2013-02-05  9:20 ` Karel Zak
@ 2013-02-05  9:37   ` Richard W.M. Jones
  0 siblings, 0 replies; 3+ messages in thread
From: Richard W.M. Jones @ 2013-02-05  9:37 UTC (permalink / raw)
  To: Karel Zak; +Cc: libguestfs, berrange, util-linux

On Tue, Feb 05, 2013 at 10:20:03AM +0100, Karel Zak wrote:
> On Mon, Feb 04, 2013 at 06:23:38PM +0000, Richard W.M. Jones wrote:
> > 
> > https://bugzilla.redhat.com/show_bug.cgi?id=907554
> 
>  All 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 :-)

Thanks .  That was my conclusion when I looked at the wipefs code in
blkid last night: it's worth trying it, but we won't fail the whole
operation if for some reason the wipefs fails.

Here is my patch:

https://github.com/libguestfs/libguestfs/commit/72dd398679cd0bb803daf306d12558369615ba70

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-05  9:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-04 18:23 [Libguestfs] Should we always do wipefs before mkfs? Discuss Richard W.M. Jones
2013-02-05  9:20 ` Karel Zak
2013-02-05  9:37   ` Richard W.M. Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox