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

Bug#683849: [d-i Wheezy Beta1] [amd64] Installer hangs while loading partitioner (mdadm/mount deadlock)



On Sun, Aug 05, 2012 at 09:02:54AM +0200, Christian PERRIER wrote:

> > The hanging in the partitioner stage seems to be caused by a deadlock
> > between mdadm and a mount process in "D" state (cf. the attached syslog):
> > 
> >  5219 root      4424 D    mount /dev/sda2 -tauto /media
> > 
> >  6358 root      4556 S    {25md-devices} /bin/sh /lib/partman/init.d/25md-devices
> >  6362 root         0 SW<  [md]
> >  6364 root      6156 S    log-output -t md-devices --pass-stdout mdadm /--examine --scan --config=partitions
> >  6365 root      4596 D    mdadm --examine --scan --config=partitions
> > 
> > /dev/sda2 is an extended partition which does not contain any filesystem; it
> > is just the container for the logical partitions /dev/sda5 to /dev/sda8.
> > Trying to mount it should not cause a hanging mount command, but on the
> > other hand, as extended partitions are not supposed to contain a filesystem,
> > the installer probably should not try to mount it at all. 
> 
> It's kinda weird that nobody went on this but your analysis seems
> correct.

I have in the meantime been able to reproduce the effect on another
machine - trying to mount an extended partition with -tauto caused
a hanging mount process there as well.

The following patch might help with the issue:

diff --git a/mountmedia b/mountmedia
index 6013579..485f4a7 100755
--- a/mountmedia
+++ b/mountmedia
@@ -31,10 +31,19 @@ try_mount() {
 	# TO REMOVE, there is a bug somewhere in the kernel, the first
 	# mount command fail when changing floppy disk
 	# so we have to launch mount twice
-	mount $1 -tauto $MNT || true
-	umount $MNT || true
-	mount $1 -tauto $MNT
-	media_mounted && checkcontents $MNT
+
+	# Determine the partition type of the partition we try to mount.
+	# Trying to mount an extended partition (type 0x5 or 0xf) with -tauto
+	# may cause the mount process to hang, therefore we check this explicitly.
+
+	PARTITION_TYPE="$(blkid -p -s PART_ENTRY_TYPE $1 | cut -d ' ' -f 2 | cut -d \" -f 2)"
+
+	if [ "$PARTITION_TYPE" != "0x5" ] && [ "$PARTITION_TYPE" != "0xf" ]; then
+		mount $1 -tauto $MNT || true
+		umount $MNT || true
+		mount $1 -tauto $MNT
+		media_mounted && checkcontents $MNT
+	fi
 }
 
 checkcontents() {


The patch has received only rather limited testing yet, but at
least in my test cases it seems to avoid the hang while loading
the partitioner.

Regards,
Karsten
-- 
Gem. Par. 28 Abs. 4 Bundesdatenschutzgesetz widerspreche ich der Nutzung
sowie der Weitergabe meiner personenbezogenen Daten für Zwecke der
Werbung sowie der Markt- oder Meinungsforschung.


Reply to: