LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-30-2012, 01:21 PM   #1
natosaichek
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Rep: Reputation: Disabled
issues with fsck at boot - remove user response requirements


Howdy! So I've got a server (ubuntu 11.10) that's operating on a single board computer in a somewhat hostile environment and occasionally just gets the power removed, rather than having a nice shutdown run. It doesn't normally have a monitor / keyboard hooked up. When it's rebooted, the system sometimes detects that there are some problems with the drive and fsck should be run. Unfortunately it just sits there waiting for a user to come by and hit 'f' to 'fix' the errors on the drive. This requires someone to go to the physical location of the server with a power supply, monitor, keyboard, and plug in and hit 'f' a few times and then the server is back up and running and I can ssh in and check on stuff.
Is there a way to force fsck to just always automagically hit 'yes' / 'fix' when this unusual situation appears? I looked in tune2fs and fstab, but couldn't find anything about the OS behavior when errors are detected in the file system. I'd rather have some drive/data corruption on rare occasions (and potentially risk the server) than to have to physically be present at the server on those rare occasions.
I am attacking the other side of the problem (preventing the power outages) as well, but if there's a software fix, that's always nice.

Thanks!
 
Old 03-31-2012, 10:44 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,260

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
That's in the options that are passed to e2fsck

Try e2fsck -f -C -y
 
Old 03-31-2012, 11:20 AM   #3
rajkumar.m
LQ Newbie
 
Registered: May 2010
Posts: 18

Rep: Reputation: 12
HI,

Open /etc/fstab and "1" at the end of the partition line. It will force the partition to do file check on every time the system boots

/dev/sda7 /partition_name ext3 defaults 0 1
 
Old 04-03-2012, 06:47 PM   #4
natosaichek
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Here's an illustration of the problem:

http://i.imgur.com/wVjBH.jpg

When the system boots, it runs fsck and finds errors. The problem is that it insists that a human come over and hit 'f' to fix the problems.
Many have said that there's a script that runs fsck on boot, and that I just need to edit that script, but I have not found it. It doesn't seem to reside in /etc/. Here's the results of "grep fsck /etc -r"


./init/mountall.conf: [ -f /forcefsck ] && force_fsck="--force-fsck"
./init/mountall.conf: [ "$FSCKFIX" = "yes" ] && fsck_fix="--fsck-fix"
./init/mountall.conf: exec mountall --daemon $force_fsck $fsck_fix
./init/mountall.conf: rm -f /forcefsck 2>dev/null || true
./bash_completion.d/lvm: --size --nofsck --resizefs --test --verbose --version' -- "$cur" ) )
./bash_completion.d/lvm: --extents --size --nofsck --resizefs \
./bash_completion.d/lvm: --extents --size --nofsck --resizefs \
./bash_completion.d/git: fsck-objects) : plumbing;;
./bash_completion.d/git:_git_fsck ()
./bash_completion.d/git: receive.fsckObjects
./update-motd.d/98-fsck-at-reboot:if [ -x /usr/lib/update-notifier/update-motd-fsck-at-reboot ]; then
./update-motd.d/98-fsck-at-reboot: exec /usr/lib/update-notifier/update-motd-fsck-at-reboot

Any ideas? What part of the OS actually calls fsck under these conditions?
 
Old 04-04-2012, 02:57 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,260

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
Something like this (from slackware) in the rc scripts will be in charge

Quote:
RETVAL=0
if [ ! -r /etc/fastboot ]; then
echo "Checking root filesystem:"
/sbin/fsck $FORCEFSCK -C -a /
RETVAL=$?
fi
# An error code of 2 or higher will require a reboot.
--
echo "*** system in single-user mode to fix the problem. ***"
echo "*** ***"
echo "*** If you are using the ext2 filesystem, running ***"
echo "*** 'e2fsck -v -y <partition>' might help. ***"
echo "***********************************************************"
echo
echo "Once you exit the single-user shell, the system will reboot."
grep -C3 -r fsck /etc/rc.d/* usually finds it
 
Old 04-04-2012, 05:11 AM   #6
rajkumar.m
LQ Newbie
 
Registered: May 2010
Posts: 18

Rep: Reputation: 12
Use the below command to find out what partition it belongs to
df -T /etc/fstab
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Response Issues With Kubuntu 9.10 (clicks) edooze Linux - Newbie 1 02-03-2010 08:57 PM
Issues with KDE 3.5 (kded and keyboard response) Tuxinator Linux - Desktop 3 02-17-2008 02:52 PM
FTP Issues, very slow response time! dermotti Linux - Networking 4 04-01-2005 09:39 PM
automatic fsck on boot. fsck errors. nixel Slackware 1 05-17-2004 07:51 AM
HCL response and other issues aus9 Linux - Hardware 1 11-11-2003 07:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:19 PM.

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