LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 09-04-2003, 09:57 PM   #1
r00tnuke
Member
 
Registered: Aug 2003
Location: /earth/usa/texas/houston
Distribution: Fedora C2
Posts: 64

Rep: Reputation: 15
autofsck or force fsck after uncontrolled shutdown


uncontrolled = power out without warning

I have been looking (Googling) around for a little solution to force or have auto fsck after a sudden loss of power. Or for that matter a controlled shutdown.

...In other words I would like the box to fsck upon reboot whether it shuts down normally or drops like a rock!

This has to occur at boot up and being that it is an uncontrolled shutdown a "shutdown" command with switches to force a fsck will not work.

I have looked in /etc/rc.d/rc.sysinit & rc.local but I am not quit sure where I need to place the command. I would like to do this 'by the book' if possible.

I have also read a little about /.autofsck & /.forcefsck to understand that deleting the .autofsck is the same as having a /.forcefsck in place and thus force a fsck at boot.

Anyway, I have all these bit's of info and I have only acheived a higher level of confusion for myself. :-)

OS: I run Krud RedHat9.

Thanks

Last edited by r00tnuke; 09-04-2003 at 10:08 PM.
 
Old 09-04-2003, 10:20 PM   #2
Eqwatz
Member
 
Registered: May 2003
Distribution: Slack Puppy Debian DSL--at the moment.
Posts: 341

Rep: Reputation: 30
To safely run fschk, the partition can't be mounted.

If you have RH on only one partition, it kind of defeats the whole thing--the swap partition doesn't count.

Partition information is a must.
 
Old 09-04-2003, 10:21 PM   #3
Eqwatz
Member
 
Registered: May 2003
Distribution: Slack Puppy Debian DSL--at the moment.
Posts: 341

Rep: Reputation: 30
Sorry about the misspelling, I am toast.

Bye.
 
Old 09-04-2003, 10:39 PM   #4
r00tnuke
Member
 
Registered: Aug 2003
Location: /earth/usa/texas/houston
Distribution: Fedora C2
Posts: 64

Original Poster
Rep: Reputation: 15
As an example, here is my workstation fstab file. My servers vary but generally speaking are scsi and ide with multiple drives partitioned solely for /home & /var etc.

LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/sdb1 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/cdrom1 /mnt/cdrom1 udf,iso9660 noauto,owner,kudzu,rw 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0

I guess I'm looking at this wrong but according to RH site documentation, if you delete /.autofsck the unit will fsck upon reboot.

If I am not there when power is rusumed the unit may stick or require input to fsck. I just want to make sure it does a file system check whether the reboot is by design or not.

If this file system check is conceptually screwy then let me know.

I remember seeing it asked and answered a while back in Linux Format UK magazine in the q&a section so I presumed it was a normal type thing to do.
 
Old 09-04-2003, 10:52 PM   #5
r00tnuke
Member
 
Registered: Aug 2003
Location: /earth/usa/texas/houston
Distribution: Fedora C2
Posts: 64

Original Poster
Rep: Reputation: 15
ok what about this...

tune2fs -c count /dev/partition

According to what I am reading in a doc I have on hand RH used to support periodic fs2k and no longer does. HOWEVER, the above command changes the fsck to be triggered based the mount count. The presumption being, the lower the count the more it will fsck.
 
Old 09-05-2003, 10:20 AM   #6
Eqwatz
Member
 
Registered: May 2003
Distribution: Slack Puppy Debian DSL--at the moment.
Posts: 341

Rep: Reputation: 30
Every time you boot up, every physical file system is checked--with the exception of "/" which is obviously needed as that is where the executable resides. If you read your logs, or watch the screeen carefully, you see the messages about something being unmounted cleanly. That is the file system being checked.

Should your /boot or / partition be corrupted it won't even start up. At that point, using the rescue CD (the first disk in the distro, will give you that option. It is easier, in my opinion, to keep up-to-date images of /boot and / on Self booting images created by Acronis. Restoration at that point is faster than anything you can do from the command line.

That is why you set up separate partitions for /var, /home, /usr, /opt, and /tmp. If you take the time, the root partition has: /bin, /sbin, /lib, and /etc. If you follow the directions in your documentation for RH, the / partition shouldn't be too big to restore as an image.

If you follow the advanced directions in the "Performance Howto" and "Partitions Howto" (and of course the RH docs), further refinements are available to shrink the root partition to manageable size. There are directions for specific placement of everything to really tweak things for optimum performance and ease of recovery.

My linux box is set up to the specs in the documentation. It has five hard drives (every hard drive left over from all of the windows upgrades), and a bunch of partitions.

Although I will do things the hard way for practice, when I get corrupted file systems and partition tables, I can rebuild with images in about ten minutes per hard drive.

Avoid bogus/bootleg programs. Most are worth the money. If you pick and choose, you don't need that many. I had a bogus copy of PM 6--which I replaced with a bought-and-paid-for PM7. The "cracked" PM generated partition table errors.

If you like to play with beta software, make images before you install it--the beta version of the windows program which allows you to read ex2fs caused a melt-down of biblical proportion on my box.

If you lose lilo by running NAV on a windows partition without paying attention (like I did two nights ago), boot the rescue CD, mount the / partition for the primary linux install and carefully write a full pathname to lilo ($>: cd /; /mnt/sysimage/sbin/lilo).
Or, if you were intelligent enough to make and label a linux boot disk, boot from the floppy and from a console $>: /sbin/lilo.
( I am less familiar with GRUB, but I think the process is similar--look it up.)
Linux system lockups are generally caused by: a bad sound configuration; either exceeding the limitations of the video adapter or a bad video configuration(or a crappy driver for video.) I have read in the forums that wine and dvd movie playing will cause a lock up. My linux box is an old P-II 350 which lacks the horsepower to do those things--so I don't know about that.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Force filesystem check after improper shutdown? Phaethar Linux - General 6 04-23-2011 09:12 PM
Autofsck amitpasari Linux - Software 1 07-05-2005 06:26 PM
Howto force fsck after dirty shutdown? anti_trend Linux - General 1 10-15-2004 07:34 PM
Force program shutdown iNFERiON Linux - Newbie 4 12-17-2003 01:07 PM
System shutdown uncleanly; fsck? mac_phil Linux - General 2 11-02-2003 02:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 04:07 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration