Package: lvm10
Version: 1:1.0.8-8.cj
Severity: normal

Hello.

If one symlinks /proc/mounts to /etc/mtab, lvmcreate_initrd doesn't
work:

# lvmcreate_initrd
...
lvmcreate_initrd -- creating new /etc/fstab
lvmcreate_initrd -- ummounting ram disk
umount: /tmp/initrd.3115: not mounted
lvmcreate_initrd -- ERROR umounting /tmp/initrd.3115
rmdir: »/tmp/mnt.3115«: Das Gerät oder die Ressource ist belegt

This is because umount references the *source* of the mount, but since
this is a loop mount, the kernel only keeps "/dev/loop0" or similar as
source of the mount in /proc/mounts, thus umount fails.

Replacing the source with the target solves the problem. See below
patch. This should also work with /etc/mtab being a file as "usual"
(not a symlink) (untested).

Thanks for applying.

Cheers,
Christian.


--- 1.0.8/tools/lvmcreate_initrd.1_buggy_original       Sat Mar 19 23:31:34 2005
+++ 1.0.8/tools/lvmcreate_initrd        Sun Mar 20 00:00:45 2005
@@ -76,7 +76,7 @@
 }

 cleanup () {
-  [ "`mount | grep $DEVRAM`" ] && verbose "unmounting $DEVRAM" && umount 
$DEVRAM
+  [ "`mount | grep $DEVRAM`" ] && verbose "unmounting $DEVRAM" && umount 
$TMPMNT
   [ -f $DEVRAM ] && verbose "removing $DEVRAM" && rm $DEVRAM
   [ -d $TMPMNT ] && verbose "removing $TMPMNT" && rmdir $TMPMNT
   [ -d $TMPLIB ] && verbose "removing $TMPLIB" && rm -r $TMPLIB
@@ -412,9 +412,9 @@
 fi

 echo "$cmd -- ummounting ram disk"
-umount $DEVRAM
+umount $TMPMNT
 if [ $? -ne 0 ]; then
-   echo "$cmd -- ERROR umounting $DEVRAM"
+   echo "$cmd -- ERROR umounting $TMPMNT"
    cleanup 1
 fi



-- System Information
Debian Release: 3.0
Kernel Version: Linux ethlife-a 2.4.29-vs1.2.10 #2 SMP Sam Mär 19 22:14:53 MET 
2005 i686 unknown

Versions of the packages lvm10 depends on:
ii  debconf             1.0.22              Debian configuration management 
system
ii  file                3.37-3.1.woody.1    Determines file type using "magic" 
numbers
ii  libc6               2.2.5-11.5          GNU C Library: Shared libraries and 
Timezone data
ii  lvm-common          1.5.17.cj           The Logical Volume Manager for 
Linux (common files)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to