Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 57229 - lvm shutdown in /etc/init.d/halt is to early. Breaks root on lvm2
Summary: lvm shutdown in /etc/init.d/halt is to early. Breaks root on lvm2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Eric Edgar (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-15 14:35 UTC by Felix Kurth
Modified: 2005-12-30 08:31 UTC (History)
9 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to halt.sh and checkfs to handle root on lvm situations (rc-scripts-1.4.16-root_on_lvm.patch,2.83 KB, patch)
2004-11-29 09:19 UTC, Eric Edgar (RETIRED)
Details | Diff
patch to the baselayout ebuild to apply the previously supplied patch (baselayout-1.9.4-r6.ebuild.patch,350 bytes, patch)
2004-11-29 09:20 UTC, Eric Edgar (RETIRED)
Details | Diff
patch to halt.sh and checkfs to handle root on lvm situations (rc-scripts-1.4.16-root_on_lvm.patch,2.84 KB, patch)
2004-11-29 09:25 UTC, Eric Edgar (RETIRED)
Details | Diff
rc-scripts-1.6.6_root_on_lvm_shutdown.patch for baselayout-1.11.6 (rc-scripts-1.6.6_root_on_lvm_shutdown.patch,2.10 KB, patch)
2004-11-30 08:46 UTC, Eric Edgar (RETIRED)
Details | Diff
new baselayout-1.11.6 ebuild that has support for rc-scripts-1.6.6_root_on_lvm_shutdown.patch (baselayout-1.11.6-r2.ebuild,16.20 KB, text/plain)
2004-11-30 08:47 UTC, Eric Edgar (RETIRED)
Details
lvm2-stop.sh.patch (raidlvm.diff,532 bytes, patch)
2005-11-01 18:43 UTC, Edward Middleton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Kurth 2004-07-15 14:35:50 UTC
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.
Comment 1 SpanKY gentoo-dev 2004-10-31 01:40:57 UTC
you guys use LVM2 (iirc) ... could you review this ?
Comment 2 Brian Jackson (RETIRED) gentoo-dev 2004-10-31 09:57:25 UTC
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).
Comment 3 Felix Kurth 2004-10-31 13:25:18 UTC
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"
Comment 4 Eric Edgar (RETIRED) gentoo-dev 2004-11-29 09:19:21 UTC
Created attachment 44932 [details, diff]
patch to halt.sh and checkfs to handle root on lvm situations
Comment 5 Eric Edgar (RETIRED) gentoo-dev 2004-11-29 09:20:24 UTC
Created attachment 44933 [details, diff]
patch to the baselayout ebuild to apply the previously supplied patch
Comment 6 Eric Edgar (RETIRED) gentoo-dev 2004-11-29 09:25:42 UTC
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"
Comment 7 Eric Edgar (RETIRED) gentoo-dev 2004-11-30 08:46:02 UTC
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.
Comment 8 Eric Edgar (RETIRED) gentoo-dev 2004-11-30 08:47:59 UTC
Created attachment 44993 [details]
new baselayout-1.11.6 ebuild that has support for rc-scripts-1.6.6_root_on_lvm_shutdown.patch
Comment 9 SpanKY gentoo-dev 2005-02-11 21:58:36 UTC
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 ?
Comment 10 Doug Goldstein (RETIRED) gentoo-dev 2005-05-24 00:05:26 UTC
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.
Comment 11 SpanKY gentoo-dev 2005-05-24 06:18:48 UTC
fixes will need to be against lvm2-stop.sh in the FILESDIR of lvm2
Comment 12 Chris Gianelloni (RETIRED) gentoo-dev 2005-07-11 12:02:31 UTC
Cardoe: any word on this?
Comment 13 Edward Middleton 2005-11-01 18:43:27 UTC
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
Comment 14 Doug Goldstein (RETIRED) gentoo-dev 2005-12-29 22:28:25 UTC
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.
Comment 15 Ryan Hill (RETIRED) gentoo-dev 2005-12-30 01:20:19 UTC
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
Comment 16 Doug Goldstein (RETIRED) gentoo-dev 2005-12-30 08:31:40 UTC
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.