Bug 790481

Summary: error during partitioning, error code "-1007"
Product: [openSUSE] openSUSE 12.2 Reporter: Ludwig Nussel <lnussel>
Component: YaST2Assignee: Petr Uzel <puzel>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P2 - High CC: aschnell
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: y2logs

Description Ludwig Nussel 2012-11-20 13:25:34 UTC
Created attachment 513802 [details]
y2logs

- Fresh install of a computer that only had Windows 7 on it
- asked yast to shrink Windows partition (sda2)
- created extended partition in free space (sda3)
- created logical partition for /boot (sda5)
- created logical partition from rest to hold encrypted lvm

yast fails creating sda5 with that error code -1007. According to logs parted complains about busy device.

After that I rebooted and retried the partitioning, this time without shrinking the windows partition as it was already shrinked. Same error.
Comment 1 Arvin Schnell 2012-11-20 14:43:25 UTC
For some reasons parted cannot inform the kernel about the new partition.
libstorage has a check to ignore this parted error and use addpart instead.
But the error message from parted has changed so the check did not work. I
have updated the check.

Whether addpart would have worked I cannot say.

Petr, can you have a look why parted fails? It also gives a warning about
unproper alignment.

Note: The parted errors about overlapping partitions consecutive fault
(libstorage tries to move the new partition a bit).
Comment 2 Petr Uzel 2012-11-20 14:56:22 UTC
Sigh, another one :/ I'll have a look.

Ludwig, if you still have the machine available (in the state where installation failed), could you please boot some rescue CD and dump the partition table after the last mkpart?

'parted -s /dev/sda unit s print' would do. (partition table dump with CHS addressing as present in the y2log is not very useful for debugging these kind of problems).

@Arvin, feature request for 12.3: if installation fails because of parted failure, could you please always call 'parted -s /dev/XXX unit s print' so that we have needed information in the log?
Comment 3 Arvin Schnell 2012-11-20 15:03:37 UTC
@Petr: That information is logged after creating the extended partition.
IIRC libstorage needs the output to compare the partition region as seen
by parted and the kernel.
Comment 4 Ludwig Nussel 2012-11-21 08:31:43 UTC
I don't have the machine in state anymore as I actually wanted to use it :) The logs I attached are all I have.
Comment 5 Petr Uzel 2012-11-21 11:14:47 UTC
(In reply to comment #3)
> @Petr: That information is logged after creating the extended partition.
> IIRC libstorage needs the output to compare the partition region as seen
> by parted and the kernel.

Yes, it's logged after creating the extended partition, but it is _not_ logged after creating the logical partition. Parted actually created the partition (on disk), it's just not clear on which sector it starts/ends. The thing is that if you `mkpart` with start/end specified with cylinders, parted does some rather convoluted math to compute the range of sectors within which the partition could start. Without knowing where exactly it placed the partition start, it's hard to guess why informing the kernel failed and why it complains about the improper alignment.
Comment 6 Petr Uzel 2012-11-21 11:17:01 UTC
I suspect this is the same bug as #449183.
Comment 7 Arvin Schnell 2012-11-21 11:37:32 UTC
(In reply to comment #5)

I see. Added parted call in failure case.
Comment 8 Petr Uzel 2012-11-21 11:54:17 UTC
(In reply to comment #6)
> I suspect this is the same bug as #449183.

I just submitted patch to fix this to Factory. That's all I can do here, though. Closing, sorry.

(In reply to comment #7)
> I see. Added parted call in failure case.

Thanks, that will make debugging easier when it happens again.