filesystem error after changing date

I changed the time on my Red Hat 6.0 system recently. I know it warns you that doing so may wreak havoc with the filesystem. But I had to do so because it was way off. So I used linuxconf and rebooted immediately after doing so. Now I can't boot normally. The following happens:

I get a message saying,
                           Welcome to Red Hat Linux
                           Press 'I' to enter interactive startup
Afew lines later, it checks the root filesystem and then spits out an error message about fsck failing giving its usage message.
I then get the message:
*** An error occured during the filesystem check.
*** Dropping you to a shell; the system will reboot
*** when you leave the shell.
Give root passwd for maintenance.

At the point I enter the root passwd and run fsck. I'm not sure whether I'm passing the correct parameters or whether this timestamp problem can be fixed. I run fsck, then reboot but get the same results. Please help quickly.
PakmanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

j2Commented:
e2fsck -f /dev/hdXY

Note that to make a complete filecheck of your / drive, you really need to boot from a floppy containing the needed tools.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PakmanAuthor Commented:
No change. I booted from boot.img, typed 'rescue' and inserted the floppy with rescue.img. From that shell prompt I then ran the /sbin/e2fsck command with the parameter you mentioned. It gave me the impression that it was doing a more detailed check. But when I rebooted, it came to the same point. I should mention that I created the rescue disk fresh from the CD, ie it is not specific to my system. What can I do at this point? Thanks.
0
orlolroCommented:
try going into your system bios and bringing back your clock to the right time. Of course this is just to get your system working again. from there you can go on to configure your system's time (or try).
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

PakmanAuthor Commented:
The system BIOS was alerady displaying the same time as Linux's (although Linux was not set to match the CMOS clock). The file system remains in read-only state.
0
orlolroCommented:
hmmm....  try booting into linux cd (basing this approach on my linux mandrak cd)
start by doing an upgrade. This may override/reconfigure your clock.

be sure to pick to upgrade your kernal.  

Bad side of this EXTREME measure is that all modifications of Kernal will be (most likely) over riden. If you have done many things to it (ex. set your modem and pnp devices) then this may be a really big cost.
0
PakmanAuthor Commented:
I already had kernel 2.2.13 running on it. But I am considering upgrading Red Hat. Before I do so, what other things might get over-ridden or lost so that I can make backups before?
0
rrussellCommented:
You haven't said if you brought your clock back to the correct time, or if you took it forward to the correct time.  Big difference.  I'll assume you took it back, as taking it forward shouldn't cause this kind of problem.

Get a boot disk.  If you have a rescue disk, perfect, if not, get a floppy-linux distro, or even boot from a Redhat6.x CD and change virtual consoles.

Mount the drive.  You may have to take your clock back in to the future to do this, and then crank it back to correct after the disk is mounted.  Then fix the dates with something like:
touch `find /`
(which could take a while :)

Then try fscking the disk.
0
PakmanAuthor Commented:
I booted into rescue mode. And I was able to successfully mount the hard drive. Using the 'touch `find /`' command didn't work because it complains about having too many arguments. So I did it manually to each directory. There are way too many directories but every directory except /usr was touched. After rebooting, I got to the same point.

I am very confused now. When I installed Red Hat on it, I remember not having Linux's time set to the CMOS clock. Linux time display is rather flaky. In this read-only mode, the time is correct most of the time. However, I notice that if I leave it alone for a few hours and come back, the monitor is powered off (maybe the hard drive is actually) and when I hit a key and see what time it displays, it displays the time a few hours ago. But when I reboot, it gets the updated time again.

Perhaps this has something to do with updating the kernel. Ever since I went to 2.2.13, although it gave no error messages, the monitor would power off after a few minutes. I couldn't find any place in configuration files or xconfig that allowed me to disable power saving mode. Any ideas? Is there a co-relation between a setting in the new kernel and the time? Like maybe the hard drive being turned off after inactivity?
0
rrussellCommented:
Linux sets its clock on boot from the CMOS clock, but uses its own clock to keep time after that.  When your computer is in "suspend" mode, Linux's clock doesn't run.  You can only disable suspend mode in your computer's BIOS, but there are ways to get apmd (Power Management Daemon) to reset your clock after you exit suspend mode.

When you booted from the floppy, you touched everything in the ramdisk, not on your hard drive, because / was maped to a ramdisk.  You'll have to replace / with the path to the root filesystem on the hard drive.  It'll probably end up being something like:

mkdir /hard
mount /dev/hda1 /hard
touch `find /hard`

If that gives too many arguments, you'll have to find a way to use xargs to pass the filesystem listing to touch, or write a script to do it.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.