Bug 115578 - partitioner passes incorrect values to parted when using whole disk
Summary: partitioner passes incorrect values to parted when using whole disk
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: YaST2 (show other bugs)
Version: Beta 4 Plus
Hardware: PowerPC Linux
: P5 - None : Major
Target Milestone: RC 3
Assignee: Thomas Fehr
QA Contact: Klaus Kämpf
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-07 11:48 UTC by Olaf Hering
Modified: 2008-07-16 15:46 UTC (History)
1 user (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
bug115578.tar.bz2 (95.07 KB, application/x-bzip2)
2005-09-07 11:53 UTC, Olaf Hering
Details
bug115578-honeydew.tar.gz (78.67 KB, application/x-gzip)
2005-09-09 19:18 UTC, Olaf Hering
Details
bug115578-arvin.tar.bz2 (58.74 KB, application/x-bzip2)
2005-09-11 18:44 UTC, Olaf Hering
Details
bug115578-1G-swap.tar.bz2 (43.76 KB, application/x-bzip2)
2005-09-11 19:30 UTC, Olaf Hering
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olaf Hering 2005-09-07 11:48:35 UTC
I get error -1007 when using whole disk on a 2.2G drive, sda3 could not be created.
Comment 1 Olaf Hering 2005-09-07 11:53:29 UTC
Created attachment 49041 [details]
bug115578.tar.bz2

hmm, scsi errors, will reboot and try again.
Comment 2 Olaf Hering 2005-09-07 12:05:58 UTC
inst-sys:~ # fdisk -l

Disk /dev/sda: 2164 MB, 2164083200 bytes
255 heads, 63 sectors/track, 263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1           3       24066   41  PPC PReP Boot
/dev/sda2               4         188     1486012+  82  Linux swap / Solaris

        There is a valid AIX label on this disk.
        Unfortunately Linux cannot handle these
        disks at the moment.  Nevertheless some
        advice:
        1. fdisk will destroy its contents on write.
        2. Be sure that this disk is NOT a still vital
           part of a volume group. (Otherwise you may
           erase the other disks as well, if unmirrored.)
        3. Before deleting this physical volume be sure
           to remove the disk logically from your AIX
           machine.  (Otherwise you become an AIXpert).

Disk /dev/sdb: 2164 MB, 2164083200 bytes
256 heads, 63 sectors/track, 262 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

   Device Boot      Start         End      Blocks   Id  System
inst-sys:~ # parted /dev/sda print
Disk geometry for /dev/sda: 0kB - 2164MB
Disk label type: msdos
Number  Start   End     Size    Type      File system  Flags
1       32kB    25MB    25MB    primary                type=41, prep
2       25MB    1546MB  1522MB  primary                type=82
Information: Don't forget to update /etc/fstab, if necessary.             

Comment 3 Danny Al-Gaaf 2005-09-07 12:31:53 UTC
this is not only a PPC specific problem. I also had the same error while try to 
change/add/format partitions e.g. with FAT on usbsticks and exteral USB 
Harddisks.
Comment 4 Thomas Fehr 2005-09-08 08:29:22 UTC
Yeah, the current parted version is awfully buggy.

It tells the disk having 1017 cylinders but refuses 1016 as last cylinder of
a partition, strange. 
Could you get me access to the disk, so that I can try fixing parted.
Comment 5 Olaf Hering 2005-09-08 10:24:10 UTC
the system is ananas.suse.de

it worked ok in the second attempt, the logs are still on the machine.
Comment 6 Olaf Hering 2005-09-08 13:49:51 UTC
I can reproduce it now.

root@ananas , pwd foobar

dd if=/dev/zero of=/dev/sd{a,b} bs=1024 count=1
install sles9 ga, leave partition proposal as is.
install 10.0 rc1 and choose sda 'use whole disk'

system is still in this state. /root/sda.bin has old partition map.
Comment 7 Thomas Fehr 2005-09-08 17:24:24 UTC
Now I see what causes this problem. 
Parted reports the disk geometry as 1017,67,62 as long as there are still
partitions left from the SLES9 install. 
Accordingly YaST2 uses 1017 as the number of cylinders of the disk.
Afterwards all partitions are removed from the disk. 
As soon as there are no partitions left on the disk. The disk geometry
recognized by parted changes to 263,255,63. But YaST2 still uses the geometry
from the initial disk scan according to the new geometry a partition number of
1016 is of course outside of the disk.

Unfortunately there is no easy way out of this problem, since libstorage has
so far no concept of a disk geometry changing between parted calls.
- either we do not use "unit cyl" any more with parted but use one of the
  other units
- or we add a command to parted that tells it which disk geometry to use

Arvin, I am not in office tomorrow and we are approaching goldmaster pretty
fast. So if you have any ideas that could help out of this dilemma feel
free to implement them ;-) 
Comment 8 Olaf Hering 2005-09-09 18:50:47 UTC
something is really wrong with the msdos partition table concept. 2 identical
disks, there was a sles9 whole disk install before. no way to repartition.

inst-sys:~ # fdisk -l

Disk /dev/sda: 36.4 GB, 36401479680 bytes
255 heads, 63 sectors/track, 4425 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1           9       72261   41  PPC PReP Boot

Disk /dev/sdb: 36.4 GB, 36401479680 bytes
128 heads, 32 sectors/track, 17357 cylinders
Units = cylinders of 4096 * 512 = 2097152 bytes

Disk /dev/sdb doesn't contain a valid partition table
Comment 9 Olaf Hering 2005-09-09 19:18:54 UTC
Created attachment 49460 [details]
bug115578-honeydew.tar.gz
Comment 10 Olaf Hering 2005-09-09 20:31:58 UTC
it turns into this:

inst-sys:~ # fdisk -l

Disk /dev/sda: 36.4 GB, 36401479680 bytes
255 heads, 63 sectors/track, 4425 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1           3       24066   41  PPC PReP Boot
/dev/sda2               4        4425    35519715   fd  Linux raid autodetect

Disk /dev/sdb: 36.4 GB, 36401479680 bytes
255 heads, 63 sectors/track, 4425 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1           3       24066   41  PPC PReP Boot
/dev/sdb2               4        4425    35519715   fd  Linux raid autodetect

Disk /dev/md0: 72.7 GB, 72744173568 bytes
2 heads, 4 sectors/track, 17759808 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md0 doesn't contain a valid partition table
Comment 11 Olaf Hering 2005-09-11 18:44:43 UTC
Created attachment 49547 [details]
bug115578-arvin.tar.bz2

Arvin provided an updated yast2-storage-lib, it doesnt fail with this new
version.
Comment 12 Olaf Hering 2005-09-11 19:30:33 UTC
Created attachment 49548 [details]
bug115578-1G-swap.tar.bz2

a failure with Arvins changes, fresh disks,

70mb prep boot (was truncated to 8mb for some reasons)
1G swap, failed to create this swap.
Comment 13 Thomas Fehr 2005-09-12 13:36:32 UTC
Ok, this should finally be fixed in yast2-storage-2.12.29 in RC3