Having root (/) on lvm will cause problems on shutdown. Since / is mounted when vgchange -a n is called in /etc/init.d/halt, vgchange fails. Even when / is mounted ro it will fail. Dont know how to fix this, how to call vgchange from an nonmounted device ? Or saving it to a temporary loop ? Any idea ? Or simply avoid calling vgchange in that case ? Reproducible: Always Steps to Reproduce: 1. 2. 3.
you guys use LVM2 (iirc) ... could you review this ?
what version of baselayout? What version of LVM? Actually emerge info output would be helpful (it's generally nice to put emerge info output for any real bugs).
sys-apps/baselayout-1.9.4-r6 sys-fs/lvm2-2.00.15 Portage 2.0.51-r2 (gcc34-x86-2004.2, gcc-3.4.2, glibc-2.3.4.20040808-r1, 2.6.8-gentoo-r7-rei4-gcc34 i686) ================================================================= System uname: 2.6.8-gentoo-r7-rei4-gcc34 i686 AMD Athlon(TM) XP 2100+ Gentoo Base System version 1.4.16 ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.59-r5 Automake: sys-devel/automake-1.8.5-r1 Binutils: sys-devel/binutils-2.15.92.0.2-r1 Headers: sys-kernel/linux26-headers-2.6.8.1 Libtools: sys-devel/libtool-1.5.2-r5 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache confcache distlocks fixpackages prelink sandbox" GENTOO_MIRRORS="http://gentoo.inode.at/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage /usr/local/bmg-main /home/felix/development/kde-metaebuilds/trunk" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="3dfx 3dnow 3dnowex X X509 aac acpi acpi4linux alsa amd apache2 apm arts artswrappersuid avi berkdb bitmap-fonts bluetooth bzlib cddb cdr cdrom chroot codecs composite crypt cscope cups dga dio divx divx4linux dmx dri dv dvd dvdr dvdreadencode exif faac faad fam fbcon ffmpeg flac foomaticdb ftp gd gif gimp gimpprint gnokii gphoto2 gpm graphviz gs gtk gtk2hbci imap imlib imlib2 ipv6 irda irmc java jit jpeg jpeg2k kde libg++ libwww lirc lm_sensors lufsusermount lzo lzw lzw-tiff mad maildir mcal mikmod mime mmx mmx2 mng monkey motif moznocompose moznoirc mozsvg mozxmlterm mp3 mpeg mpeg4 mplayerncurses nls nntp no-old-linux nptl nvidia odbc oggvorbis ooo-kde openal opengl pam pcre pda pdf pdflib pear-db pic png ppds procmail python qt quicktime rdesktop readline samba scanner sdl session skey slang slp smartcard smime spamassassin spell sse sse2 ssl svg svga tcltk tcpd tetex tga theora threads tiff transcode truetype usb usepackagedmakefiles v4l v4l2vim-with-x wmf x86 xine xinerama xml xml2 xmms xosd xpm xv xvid xvmc yv12 zlib linguas_de"
Created attachment 44932 [details, diff] patch to halt.sh and checkfs to handle root on lvm situations
Created attachment 44933 [details, diff] patch to the baselayout ebuild to apply the previously supplied patch
Created attachment 44934 [details, diff] patch to halt.sh and checkfs to handle root on lvm situations used a better grep string in this patch "#" -> "# open"
Created attachment 44992 [details, diff] rc-scripts-1.6.6_root_on_lvm_shutdown.patch for baselayout-1.11.6 This patch fixes errors on lvm shutdown when root in on an lvm.
Created attachment 44993 [details] new baselayout-1.11.6 ebuild that has support for rc-scripts-1.6.6_root_on_lvm_shutdown.patch
is all that crap really needed ? isnt there one command we can run instead of having to loop through all of that ? also, will these fixes work for both lvm1 and lvm2 ?
vapier, I can confirm that this is still an issue on shutdown with the latest ~x86 baselayout and lvm2 stuff. I haven't had a chance to review the patches and test them. Will do that tomorrow.
fixes will need to be against lvm2-stop.sh in the FILESDIR of lvm2
Cardoe: any word on this?
Created attachment 71904 [details, diff] lvm2-stop.sh.patch There is a bug in the lvm-stop.sh which assumes that mount (from sys-apps/util-linux-2.12r) returns the symbolic link /dev/[volume group]/[logical partition] but it actually returns the actual device /dev/mapper/[volume group]-[logical partition]. This patch makes lvm-stop.sh uses the actual device for comparision
What Ed said sounds reasonable. Except I'm just not having the same issues as I was before. I will have to look into a problem when shutting down and test Ed's patch. Next reboot.
i think this patch already went in. # tail -n 15 /lib/rcscripts//addons/lvm-stop.sh ROOT_DEVICE=`mount|grep " / "|awk '{print $1}'` MOUNTED_DEVICE=${x} [ -L ${ROOT_DEVICE} ] && ROOT_DEVICE="`/bin/readlink ${ROOT_DEVICE}`" [ -L ${x} ] && MOUNTED_DEVICE="`/bin/readlink ${x}`" if [ ! ${ROOT_DEVICE} = ${MOUNTED_DEVICE} ] then ewarn " Unable to shutdown: ${x} " fi fi done einfo "Finished Shutting down the Logical Volume Manager" fi
Well I just rebooted. The problem is a non-issue anymore. And when I looked I came to the same conclusion as Ryan. He just looked before I did. Marking bug as fixed. If anyone has anymore issues feel free to reopen.