run fsck

Asked by Enigma

This afternoon while I was online everything froze. I couldn't get anything to work, and so I was forced to pull a windows trick.....I rebooted.

Or, I tried to.

Sum it up to say that I now have a error message that says to manually run fsck.

I tried that, and this is the message I get:
Command 'sudo' is available in '/usr/bin/sudo'
The command could not be located because '/usr/bin/' in not included in the PATH environment variable.
bash: sudo: command not found

Can anyone help me?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
canucked
Solved:
Last query:
Last reply:
Revision history for this message
Bhavani Shankar (bhavi) said :
#1

Hello Enigma....

Ok... Boot up into recovery mode in ubuntu (usually the 2nd option in grub)

you will be in a console as root.
Here, give the following command:

aptitude reinstall sudo

You may want to test it works before rebooting by running sudo without any arguments.After making sure everything works, you can reboot and you should be fine.

Note: To manually run fsck in ubuntu,

From a console/terminal type

fsck /dev/<your partition>*

*= your ubuntu partition

Hope it helps

Bhavani Shankar.

Revision history for this message
Enigma (enigmaaphrodite) said :
#2

so I typed in:

aptitude reinstall sudo

and I got this message:

Command 'aptitude' is available in '/usr/bin/sudo'
The command could not be located because '/usr/bin/' in not included in the PATH environment variable.
bash: aptitude: command not found

Revision history for this message
Pramod Dematagoda (pmdematagoda) said :
#3

If you have the Ubuntu Live CD, then you can use it and perform an fsck through it. But before performing the fsck through the Live CD, ensure that the target partition/drive is unmounted.

Revision history for this message
Enigma (enigmaaphrodite) said :
#4

I have a disc, and I figured that since I have not really put anything on the computer, that perhaps I could put the disc in and just reinstall the program. Well, I don't know what I expected, but I guess that I thought perhaps the disc would run if I put it in and started it up. I don't know how to get it to run.

As for the target partition/drive...I don't understand about it being unmounted.

When I installed Ubuntu, I just had it format the whole hard drive as I wasn't going to be putting any other OS' on the drive.

Also, can I assume that the name of the hard drive is the "hda1" that seems to have the problems in it?

Revision history for this message
canucked (canucked) said :
#5

Here's something you can try:

-When the GRUB boot menu shows up, choose the Recovery option.
-When you reach the command prompt (with root privileges), enter the following:

touch /forcefsck

shutdown -r now

The first command will cause the fsck program to be run next time the computer is booted. The second command restarts the computer.

You can also issue the commands in Terminal as a typical (limited privilege) user by adding "sudo" before each command ("sudo touch /forcefsck").

Good luck!

Revision history for this message
Enigma (enigmaaphrodite) said :
#6

When I type touch/forcefsck

I get this message:

touch: cannot touch '/forcefsck': Read-only file system

Despite that, I still typed the

shutdown -r now

And I got this message:

shutdown -r nowbash: hthutdown: command not found

Revision history for this message
canucked (canucked) said :
#7

Enigma,

Here is a link to instructions for running fsck from an Ubuntu live CD (the last post on the 2nd page is probably most helpful):

http://ubuntuforums.org/showthread.php?t=422307

This page discusses mount:

https://help.ubuntu.com/community/Mount

You can use fstab to figure out which device refers to your Ubuntu partition:

https://help.ubuntu.com/community/Fstab

In your case it probably is: /dev/hda1

Hope this helps!

Revision history for this message
canucked (canucked) said :
#8

"I have not really put anything on the computer"

If you are still unable to repair your file system, and are planning on reformatting it, you will probably want to install Ubuntu's latest version which will be released next week: Ubuntu 8.04 Hardy Heron LTS.

https://wiki.ubuntu.com/HardyReleaseSchedule

Revision history for this message
Enigma (enigmaaphrodite) said :
#9

You know, I was thinking that myself.
There is the Beta version that is out down of HH, will there be lots of differences between putting it on this week and putting it on next week?

Revision history for this message
Best canucked (canucked) said :
#10

>will there be lots of differences between putting it on this week and putting it on next week?

There probably won't be much of a difference. You just may have a few updates to install in the next few days before Hardy's final release. I've been using the beta since it came out and it's been great. If you decide to try out Hardy, good luck with it!

Revision history for this message
Enigma (enigmaaphrodite) said :
#11

Thanks canucked, that solved my question.