Bug 437235

Summary: fails to partition mounted drives ...
Product: [openSUSE] openSUSE 11.1 Reporter: Michael Meeks <mmeeks>
Component: YaST2Assignee: Jiri Srain <jsrain>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P5 - None CC: aschnell, dmacvicar, gnome-bugs, kamikazow
Version: Factory   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: yast logs
photo.
second attempt logs (starting with no mounts)
/var/log/messages to match ...
proposed patch for tuning of automounter

Description Michael Meeks 2008-10-21 09:56:14 UTC
Soo ... I get a rather ulgy complete termination of the live-installer.

I'm trying to install to a USB flash disk; unfortunately - HAL/GNOME/Whatever detects this as a removable USB key, and pops up some nice icons on the desktops, and (presumably) mounts these beasties.

Sadly when yast2-live-installer gets to the point of actually doing the partitioning of the disk; it falls in a heap with some "error -1025" type dialog, that doesn't let you recover, unmount, re-try or give any hint to the problem. [ I had to dig in the attached yast2 logs for that ].

Can we do either or both of:

a) try to unmount those devices - running a simple unmount command as root for each appears to succeed fairly trivially ;-)

b) throw a helpful warning up "some partitions on the drive were mounted, can you unmount them?" and let the user re-try here without bombing out.

Would be much appreciated :-)
Comment 1 Michael Meeks 2008-10-21 09:57:05 UTC
Created attachment 246789 [details]
yast logs
Comment 2 Michael Meeks 2008-10-21 10:09:59 UTC
Hmm, it's worse than this in fact: I just unmounted all the drivers before running the live-installer.

Right at the point that it started deleting & re-making the partitions I got a flurry of nautilus windows and new desktop mount-points showing the new mounts, in all their glory; and the live-installer bombed again - with it's lovable:

  "System error code was: -1014" ;-)

that is some magic ! Screenshot attached for the benefit of un-believers ;-) [ along with a new set of yast2 logs ... ]
Comment 3 Michael Meeks 2008-10-21 10:10:58 UTC
Created attachment 246793 [details]
photo.
Comment 4 Michael Meeks 2008-10-21 10:11:45 UTC
Created attachment 246794 [details]
second attempt logs (starting with no mounts)
Comment 5 Michael Meeks 2008-10-21 10:14:05 UTC
Created attachment 246795 [details]
/var/log/messages to match ...
Comment 6 Michael Meeks 2008-10-21 10:22:49 UTC
apparently several sets of "killall -9 nautilus" beforehand make life happier here; I finally got an install; do we need some "nautilus-dont-go-mount-crazy" thing we can run before hand to make life happier ?
Comment 7 JP Rosevear 2008-10-22 19:49:30 UTC
This type of thing has come up before, yast can umount -a the devices.  See bug 382158 as well.
Comment 8 Jiri Srain 2008-10-30 16:08:08 UTC
Arvin, can I get from partitioner a list of partitions which will be either removed or resized according to the proposal? (I mean in a computer-readable form, not the proposal as generated by libstorage)

Then they can be unmounted just before partitioner starts partitioning the disk.
Comment 9 Michael Meeks 2008-10-31 09:02:14 UTC
Jiri - I guess at some level we are fighting nautilus' impulse to mount new partitions as the system detects them [ presumably just after we make them ] - JP is it possible that nautilus is more aggressive than gnome-volume-manager here & thus causing the issue ?

Perhaps the problem is that yast2 suggested to re-partition the disks to -exactly- the same geometry as is already there [doh] since it partitioned them last time it failed ;-) and as-such they have a valid file-system inside them post partition (I guess).
Comment 10 Arvin Schnell 2008-10-31 09:14:23 UTC
yast2-storage (when run normal in the installed system) does stop hal
to automount devices (see SwitchUiAutomounter in disk_worker.ycp). Calling
the same code somewhere in the live-installation might be sufficient.
Comment 11 Jiri Srain 2008-10-31 12:54:17 UTC
@#9: Live instalaltion must work regardless whther the geometry is the same or changes

@#10: Thanks for the hint, I think it makes sense to utilize this code. Anyway, does it unmount drives mounted before YaST was started? I think YaST should
- call the code you refer above to avoid further mounting
- check which partitions will be erased/resized (*)
- unmount those of them which are mounted
To achive (*), I need a way to get such partitoins, which interface can I use?
Comment 12 Arvin Schnell 2008-11-12 14:49:14 UTC
Created attachment 251639 [details]
proposed patch for tuning of automounter
Comment 13 Arvin Schnell 2008-11-12 14:52:15 UTC
Jiri, does that patch look ok for you?
Comment 14 Arvin Schnell 2008-11-12 14:52:54 UTC
Unmounting already mounted devices is more work. AFAIS libstorage
would unmount devices if required but not if it thinks its running
in the inst-sys. So I think I will need more sophisticated flags
for that in libstorage. But no time for 11.1.
Comment 15 Jiri Srain 2008-11-12 15:08:30 UTC
This interface definitely will help.

I think I can unmount the partitions myself for 11.1, but need to know which ones. Can libstorage tell me which partitions are going to be either deleted or resized according to the proposal?
Comment 16 Arvin Schnell 2008-11-12 15:14:29 UTC
No, there isn't a function for that and the target-map does not
contain the deleted devices.
Comment 17 Jiri Srain 2008-11-12 15:38:10 UTC
Hmm, I don't really see how it helps then.

If I was doing an installation to a USB stick, I would probably first insert the USB stick and then start YaST (which means it's already mounted when YaST starts). Connecting it later may be a problem, if it is done after the disks detection.

The patch makes sense, but solves only a very low part of the cases IMO.

Maybe (as a hack for 11.1) I could disable automounter and grep /proc/mounts for /media/ (which is where automounter mounts the disks) and if something is found, tell user to unmount them. Do you think it makes sense? I cannot find any better solution ATM
Comment 18 Arvin Schnell 2008-11-12 19:20:04 UTC
That should be ok for a hack.
Comment 19 Jiri Srain 2008-11-13 11:29:13 UTC
OK, will do it this way for 11.1.
Comment 20 Jiri Srain 2008-11-13 14:42:12 UTC
Done.

Sorry that given current information live installer can gather there is no better solution possible for 11.1.
Comment 21 Stephan Kulow 2008-11-20 09:59:39 UTC
*** Bug 445058 has been marked as a duplicate of this bug. ***