On 11/07/2009 12:38 AM, David Cantrell wrote: > On s390, if you had a single DASD that needed dasdfmt run, you would get > a ZeroDivisionError traceback because the self._totalCylinders value was > zero. The problem was caused by the DASD.totalCylinders property and > how it initialized. It would initialize itself on the first call, but > since we'd already fired off a dasdfmt process for the device, the one > running to capture the cylinder count couldn't get access to the device. > > Users with more than one DASD needing a dasdfmt would not see the > traceback, but would have an incorrect total cylinder count, so 100% > would be reached when n-1 devices had been formatted. Determining the total cylinder count before starting the actual low-level formatting is exactly the right way to do it. Somehow I already misinterpreted this into the previous code. > Lastly, in certain instances, the status for the DASD could be "basic" > rather than "unformatted", so treat those the same and perform a > dasdfmt. Only DASDs with status "unformatted" are eligible for low-level formatting. Otherwise we risk formatting disks that are already formatted and thus risk data loss. The reason is that the status attribute shows the current state of a transition through different states during device bringup. An already formatted DASD shows the following state transition: 'unkown new detected basic ready online (*)' An unformatted DASD shows roughly the following state transition: 'unknown new detected basic unformatted (*)' On running dasdfmt, the transition continues as follows: 'basic ready online' (*) is the spot your code should find the DASDs in. I suppose you only saw the 'basic' state because the already running dasdfmt on that particular DASD had set its state from 'unformatted' back to 'basic' which is a preparation it does before formatting. If still DASDs appear in state 'basic', we have to look at it again from a different perspective. When dasd.py accesses DASD sysfs attributes, the DASDs should have long gone into either state 'online' or 'unformatted' since the onlining and detection has happened long enough before in linuxrc.s390. Steffen Linux on System z Development IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Erich Baier Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list