General discussion

Locked

Input/output error on file in /var/mail

By Henry Eh... ·
ls: root: Input/output error
Why can I not read the root file. It seems to be there but I can't access it - even as root. Is there a premission violatioin (at some directory level?).

I was able to create a test file in the /var/spool/mail directory while logged in as root.

The mail program needs the /var/spool/mail/root file but can't read it.

Here are the commands I've issued for more info.

# date; pwd
Tue Dec 7 10:51:04 EST 2004
/var

# l
total 64
...
lrwxrwxrwx 1 root root 10 Jan 17 2004 mail -> spool/mail
...
drwxr-xr-x 14 root root 4096 Jan 17 2004 spool
...


# l spool
total 52
...
drwxrwxr-x 2 root mail 4096 Dec 7 10:37 mail
...

# cd spool

# l
total 52

...
drwxrwxr-x 2 root mail 4096 Dec 7 10:37 mail
...

# cd mail

# l
ls: root: Input/output error
total 0
#

Many thanks
Henry

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by house In reply to Input/output error on fil ...

Try going into console mode with minimal services. It is possible that the file is considered "in use" while in the full blown operations mode.

Also, have you tried it with the complete "rwx" accross the board. Especially regarding the "w" for the "other access permission" (third section of permissions).

Collapse -

by house In reply to

If the permissions are wide open, have you tried using a bootable Linux OS like Knoppix to mount the drive and delete the files.

Collapse -

by Henry Eh... In reply to Input/output error on fil ...

Modifying permissions or going to single user mode didn't change anything.

Here are some more observations:

the "mail" command gives the message:
/var/spool/mail/root: Input/output error

the "locate -U /" command gives a similar message:
fatal error: locate: create_db: fopen: '"': Input/output error

Also, using the "du" command on the /var directory also give the same error for these 2 files only.

When I view the files in Gnome-explorer "/var/spool/mail/root" and "/var/spool/mail/root" exist but the size is shown as "..." and the modification date has "unknown".

I tried to delete them but get back message "can not lstat:" these files.

How would I go about deleting these 2 files so that I can use "locate" and "mail" as root.

Thanks
Henry

Collapse -

by todd In reply to Input/output error on fil ...

Can you post the output from the "mount" command.

also try simply moving the current sub-dir and creating a new one.

for example try this:

mv /var/spool/mail /var/spool/mail.old

mkdir -p /var/spool/mail
chown root:mail /var/spool/mail
chmod 775 /var/spool/mail
mv /var/mail /var/mail.old
ln -sf /var/mail /var/spool/mail


see if you can now access the dir, and see that sendmail can properly create the root mail spool.

-cheers

Collapse -

by K12Linux In reply to Input/output error on fil ...

You might want boot into single-user mode and run fsck against /var. If you don't have a seperate filesystem for /var (ie: everything is on one partition) you'll have to run fsck against /

Running fsck against / can be it's own challange if you have never done it.

Back to Linux Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums