public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Sebastian Werner <sebastian@werner-productions.de>
To: gentoo-dev@gentoo.org
Subject: [gentoo-dev] checkfs-update
Date: 13 Dec 2001 18:46:46 +0100	[thread overview]
Message-ID: <1008265607.28849.2.camel@wp.smile> (raw)

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

Hey,

i don't know why i must fsck my reiserfs root... mhh. I have a new
checkroot file for the people who use reiserfs. I don't know about xfs
and ext3... must they checked after a crash? the checkroot script checks
all types but not reiserfs.

The new checkfs file look if you use a ext2-filesystem and then checks
it. 

Sebastian Werner



[-- Attachment #2: checkfs --]
[-- Type: text/plain, Size: 455 bytes --]

#!/sbin/runscript

depend() {
	need checkroot
}

start() {
	grep "/dev" /etc/fstab | grep -v "#" | grep ext2 > /dev/null 2> /dev/null
	if [ $? = 0 ]; then
		ebegin "Checking all filesystems"
		fsck -R -A -a
		if [ $? -eq 0 ]
		then
			eend 0
		elif [ $? -eq 1 ]
		then
			eend 1 "Filesystem errors corrected."
		else 
			eend 2 "Fsck could not correct all errors, manual repair needed"
			/sbin/sulogin $CONSOLE
		fi
	fi
	return
}

[-- Attachment #3: checkroot --]
[-- Type: text/plain, Size: 565 bytes --]

#!/sbin/runscript

start() {
	if [ "`cat /proc/mounts | grep " / " | cut -d" " -f3`" != "reiserfs" ]; then
		ebegin "Remounting root filesystem read-only (if necessary)"
		mount / -o remount,ro	
		eend $?
		ebegin "Checking root filesystem"
		fsck -a
		if [ $? -eq 0 ]
		then
			eend 0
		elif [ $? -eq 1 ]
		then
			eend 1 "Filesystem repaired"
		else
			eend 2 "Filesystem couldn't be fixed :("
			/sbin/sulogin $CONSOLE
			reboot -f
		fi
	fi
	
	ebegin "Remounting root filesystem read/write"
	mount / -o remount,rw
	eend $?
	return
}


             reply	other threads:[~2001-12-13 17:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-13 17:46 Sebastian Werner [this message]
2001-12-13 18:02 ` [gentoo-dev] checkfs-update jano
2001-12-13 17:58   ` Sebastian Werner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1008265607.28849.2.camel@wp.smile \
    --to=sebastian@werner-productions.de \
    --cc=gentoo-dev@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox