public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] lvm-support
@ 2001-12-13 17:43 Sebastian Werner
  2001-12-13 19:30 ` Martin Schlemmer
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Werner @ 2001-12-13 17:43 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 195 bytes --]

OK,

i have add lvm support to the localmount and halt.sh scripts. You must
have the /etc/lvmtab to get it to work.

I want send diffs but i have overwritten the originals...

Sebastian Werner



[-- Attachment #2: localmount --]
[-- Type: text/plain, Size: 790 bytes --]

#!/sbin/runscript

depend() {
	need checkfs
}

start() {
	if [ -r /etc/lvmtab ]; then
		ebegin "Initialisising logical volume manager (lvm)"
		vgchange -a y > /dev/null 2>&1
		eend $?
	fi

	# Mount local filesystems in /etc/fstab.
	ebegin "Mounting local filesystems"
	mount -at nonfs,noproc,noncpfs,nosmbfs,noshm  
	eend $? 
	if [ -z "`grep usbdevfs /proc/filesystems`" ]
	then
		modprobe usbcore
	fi
	if [ -n "`grep usbdevfs /proc/filesystems`" ] && [ -e /proc/bus/usb ] && [ ! -e /proc/bus/usb/devices ] 
	then
		ebegin "Mounting USB device filesystem"
		mount -t usbdevfs usbdevfs /proc/bus/usb
		eend $?
	fi
	#swap on loopback devices, and other weirdnesses
	ebegin "Activating (possibly) more swap"
	/sbin/swapon -a >/dev/null 2>&1
	eend	
	return
}


[-- Attachment #3: halt.sh --]
[-- Type: text/x-sh, Size: 872 bytes --]

#we try to deactivate swap first because it seems to need devfsd running
#to work.  The TERM and KILL stuff will zap devfsd, so...

ebegin "Deactivating swap"
swapoff -a 1>&2
eend $?
ebegin "Sending all processes the TERM signal"
killall5 -15
eend $?
sleep 5
ebegin "Sending all processes the KILL signal"
killall5 -9
eend $?

# Write a reboot record to /var/log/wtmp before unmounting

halt -w 1>&2

#unmounting should use /proc/mounts and work with/without devfsd running

ebegin "Unmounting filesystems"
umount -v -a -r -t noproc,notmpfs > /dev/null 2>&1
if [ "$?" = "1" ]
then
	eend 1 "hmmmm..."
	ebegin "Trying to unmount again"
	umount -a -r -f 
	eend $?
else
	eend 0
fi

if [ -d /proc/lvm ]; then
	ebegin "Shutdown logical volume manager (lvm)"
	vgchange -a n > /dev/null 2>&1
	eend $?
fi

#this is "just in case"
sync; sync

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-12-13 22:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-13 17:43 [gentoo-dev] lvm-support Sebastian Werner
2001-12-13 19:30 ` Martin Schlemmer
2001-12-13 21:47   ` Sebastian Werner
2001-12-13 22:13     ` Martin Schlemmer
2001-12-13 22:13       ` Sebastian Werner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox