LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-21-2006, 11:20 AM   #1
tebucky
Member
 
Registered: Mar 2004
Posts: 89

Rep: Reputation: 15
Can't create directories


So this just started and I'm completely puzzled. I'm trying to make a directory or save files to one of my drives and I'm getting this error.

drwxr-xr-x 3 me me 4096 Sep 6 15:33 test
drwxr-xr-x 7 me me 4096 Sep 11 07:45 test1
drwxr-xr-x 6 me me 4096 Jun 22 19:39 test3
[me@test html]$ mkdir test4
mkdir: cannot create directory `test4': Read-only file system
[me@test html]$

I had full control on this drive up until today and I have no idea what happened. Can someone give me a hand?
 
Old 10-21-2006, 12:19 PM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
Looks like the filesystem on which you are trying to create the directory is mounted read-only. If it wasn't before, it could be that an error has been detected and the filesystem has been re-mounted read-only to prevent data loss.

If you do "df -k .", you'll see the device which the directory you are in is on (e.g. /dev/hda1). If you then do "cat /etc/fstab" and look for the line corresponding to that device you may see the option: "errors=remount-ro", which is what instructs Linux to do this remounting in readonly if errors are encountered.

Check your system logs for error messages (grep for the device id, e.g. "grep hda1 /var/log/messages").
 
Old 10-21-2006, 12:30 PM   #3
tebucky
Member
 
Registered: Mar 2004
Posts: 89

Original Poster
Rep: Reputation: 15
Here is the output /var/log/messages:

[root@chach /]# grep hdb1 /var/log/messages | more
Oct 6 20:13:07 localhost kernel: EXT3 FS on hdb1, internal journal
Oct 6 20:13:07 localhost kernel: SELinux: initialized (dev hdb1, type ext3), uses xattr
Oct 7 10:57:06 localhost kernel: EXT3-fs error (device hdb1): ext3_get_inode_loc: unable to read inode block - inode=10895361, block=21790722
Oct 7 10:57:06 localhost kernel: Aborting journal on device hdb1.
Oct 7 10:57:06 localhost kernel: inode_doinit_with_dentry: getxattr returned 5 for dev=hdb1 ino=10895361
Oct 7 10:57:09 localhost kernel: EXT3-fs error (device hdb1): ext3_get_inode_loc: unable to read inode block - inode=10895362, block=21790722
Oct 7 10:57:09 localhost kernel: inode_doinit_with_dentry: getxattr returned 5 for dev=hdb1 ino=10895362
Oct 7 10:57:15 localhost kernel: EXT3-fs error (device hdb1): ext3_get_inode_loc: unable to read inode block - inode=10895363, block=21790722
Oct 7 10:57:15 localhost kernel: inode_doinit_with_dentry: getxattr returned 5 for dev=hdb1 ino=10895363
Oct 7 10:57:15 localhost kernel: EXT3-fs error (device hdb1): ext3_get_inode_loc: unable to read inode block - inode=10895364, block=21790722
Oct 7 10:57:15 localhost kernel: inode_doinit_with_dentry: getxattr returned 5 for dev=hdb1 ino=10895364
Oct 7 10:57:15 localhost kernel: EXT3-fs error (device hdb1): ext3_journal_start_sb: Detected aborted journal

What should be my next steps?
 
Old 10-21-2006, 01:00 PM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
Yup, you've got some errors there. That explains why the filesystem has been remounted read-only. Question is what to do about it now...

Firstly, pat yourself on the back for making regular backups

Where is the device mounted (e.g. /home /usr ...)?
 
Old 10-21-2006, 02:01 PM   #5
tebucky
Member
 
Registered: Mar 2004
Posts: 89

Original Poster
Rep: Reputation: 15
The device is mounted in root /
 
Old 10-21-2006, 04:39 PM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
I'm not sure if you can check the filesystem from single user mode, or if you need to boot from a CD or floppy and check the filesystem from there...

In any case, you need to run ext3.fsck on the device. It would also make sense to run badblocks.

If the problems are fixable then it's possible that your filesystem got messed up somehow in software, but it's also possible (likely) that you have a hard disk which is starting to mess up.

If the drive is going bad, I recommend getting a new one. The failures tend to spread out over time, so you can mark the bad blocks not to be used, but you might end up getting more later...
 
  


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
Samba: "homes" share, cannot create directories, can create files Herg Linux - Software 1 09-14-2006 09:48 AM
Unable to create directories satimis Linux From Scratch 8 07-02-2005 05:48 AM
Do we need to create the log and db directories by ourselves Niceman2005 Linux - Software 0 11-17-2004 10:08 PM
Can't create directories in /proc keripukki Linux - Software 3 09-03-2004 02:26 PM
Create several directories? AutOPSY Linux - Newbie 3 03-30-2004 08:51 PM


All times are GMT -5. The time now is 07:13 AM.

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