Solved

"cannot create directory" error

Posted on 2011-09-19
5
542 Views
Last Modified: 2013-12-16
Hi there,

I got an old linux box running Redhat 9 I believe.  Now I cannot
create a new directory on a drive (under both root and regular
account) which is under /mnt/space.

Please see below for more info.  What can I have to fix the problem?

Any oopinion is appreciated.



 [user_name@linux1 user_name]$ pwd
/mnt/space/user_name

[user_name@linux1 user_name]$ su
Password:
[root@linux1 user_name]# mkdir ttt
mkdir: cannot create directory `ttt': Input/output error
[root@linux1 reggie]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda2             34265764  30536492   1988632   94% /
/dev/hda1                31079     17295     12180             59% /boot
none                   2063332         0   2063332                  0% /dev/shm
/dev/hdb1             38480404  33180376   3345324  91% /mnt/space
[root@linux1 user_name]#
[root@linux1 user_name]# uname -a
Linux linux1.zonatech.com 2.4.20-8bigmem #1 SMP Thu Mar 13 17:32:29 EST 2003 i68
6 i686 i386 GNU/Linux
[root@linux1 reggie]# date
Mon Sep 19 16:52:55 MDT 2011
[root@linux1 user_name]# exit
exit
[user_name@linux1 user_name]$ mkdir yyy
mkdir: cannot create directory `yyy': Input/output error
0
Comment
Question by:asugri
5 Comments
 
LVL 23

Accepted Solution

by:
Kamaraj Subramanian earned 150 total points
Comment Utility
0
 
LVL 2

Assisted Solution

by:alien8tive
alien8tive earned 150 total points
Comment Utility
Hi

What is the output of the below:

$ cd /mnt/
$ lsattr
0
 
LVL 3

Assisted Solution

by:dbauermann
dbauermann earned 50 total points
Comment Utility
What is the output the command

# mount

???

Maybe your partion is mount only as read-only (ro)...
0
 
LVL 19

Assisted Solution

by:xterm
xterm earned 150 total points
Comment Utility
grep hdb /var/log/messages

What almost certainly happened is that you got some kind of ext2 (or perhaps journal if RH9 was new enough for ext3) error, and the kernel marked the file system read-only.  It may be as simple as rebooting (which will run an e2fsck on the drive) but in my experience, I'd say you should plan to replace the drive.  A reboot will likely make it writable for a short while, but the same thing will happen again eventually.

At this point the drive is still readable, so if you have another one the same size and a spare machine that can hold both drives, you can clone it using a rescue CD.  Download systemrescuecd, put both drives in the system, boot up off the disk, login root and do "dd if=/dev/hda of=/dev/hdb BS=512" (this can take a while for a big drive.)  Remember, the "if" field is the SOURCE (your old dying drive) and the "of" field is the DESTINATION (your new empty drive).

Good luck.

PS.  I noticed / is at 94% utilization which means at some point soon, only root will be able to write to the filesystem, so you want to resolve that too.
0
 

Author Closing Comment

by:asugri
Comment Utility
After I freed up some space in / directory, I was able to create new directories under /mnt/space.

Thanks a lot for the help.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now