Re: [PATCH] Handle system crappyness.

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

 



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.

Jeremy

_______________________________________________
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