Re: [PATCH] Handle system crappyness.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 16, 2009 at 04:57:07PM -0400, Jeremy Katz wrote:
> On Monday, March 16 2009, Joel Granados Moreno said:
> > +def zeroLvmMetadata(device):
> > +    """ This dds from byte 513 to 200Mb+513 of the disk.
> > +
> > +    We assume that lvm has nothing to do with the first 512 bytes.
> > +    We assume that 200Mb is enough.  My tests failed with 100Mb for
> > +    some unknown reason.
> > +    """
> > +    try:
> > +        fd = os.open(device, os.O_WRONLY)
> > +        os.lseek(fd, 513, os.SEEK_SET)
> > +        for i in range(200):
> > +            os.write(fd, "\0"*1024)
> > +        os.close(fd)
> > +    except:
> > +        raise LVMError("Falied to zero LVM data on %s." % device)
> 
> While maybe not a common case, this will traceback if the disk/partition
> is < 200 megs in size.

Yep, you are right.  I will handle the specific errno == 28 for this
case.
> 
> Jeremy
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

-- 
Joel Andres Granados
Brno, Czech Republic, Red Hat.

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux