LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-02-2003, 03:09 PM   #1
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1-15 RH 6.2/7, RHEL 6.5 SuSE 8.2/11.1, Debian 10.5
Posts: 516

Rep: Reputation: 32
Question umount on shutdown


I have a couple of entries in my fstab file, which automatically mounts other filesystems on start-up, but what I need to know is how to have them automatically umount on shutdown/reboot.

I have always had problems with having to run fsck every now and again, but as I have not had to reboot very often, this has generally not been too much of an issue, but as I am playing around with another distro' and compiling kernels etc, I am now rebooting quite often, and noticing that one or more of my filesystems are not being unmounted, well at least I don't think they are.

All help appreciated...
 
Old 10-02-2003, 04:14 PM   #2
Truti
LQ Newbie
 
Registered: Aug 2003
Location: Denmark - Soenderbronx
Distribution: Debian / FreeBSD
Posts: 11

Rep: Reputation: 0
Some dists have problems, with umounting the swap partition!
I have solved the problem by placing a shell-script in /etc/init.d/umount.sh

----------------------------------------------------------

#! /bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin

case "`uname -r`" in
1.*|2.[01].*) FORCE="" ;;
*) FORCE="-f" ;;
esac

umount -ttmpfs $FORCE -a -r

echo -n "Deactivating swap... "
swapoff -a
echo "done."

# We leave /proc mounted.
echo -n "Unmounting local filesystems... "
umount -tnoproc $FORCE -a -r
echo "done."

mount -n -o remount,ro /

: exit 0

----------------------------------------------------------

Hope this solved you problem!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help on how to save services shutdown or shutdown from the terminal. wambuzz Linux - General 2 03-11-2005 07:38 AM
Linux full shutdown vs. manual shutdown? LQtoto Linux - General 9 01-26-2005 06:21 PM
umount /var device is busy (unclean shutdown) feetyouwell Linux - Software 3 09-13-2004 06:18 PM
konsole shutdown possible? or key combo = shutdown possible? Laptop2250 Linux - Newbie 3 11-16-2003 10:44 AM
ext3 part fails umount during shutdown paulmccs Linux - General 0 02-18-2002 01:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration