1827652 Members
3682 Online
109966 Solutions
New Discussion

Re: Can't create file

 
SOLVED
Go to solution
peterchu
Super Advisor

Can't create file

I have created a directory to the / path (eg ./db ), but can't copy/create file at there , when copy file to there , it pop up "touch: creating `file1': Read-only file system" , could suggest what is wrong in my system ? thx
8 REPLIES 8
Alexander M. Ermes
Honored Contributor

Re: Can't create file

Hi there.
Did you check the accessrights to that directory ?
Should be at least drw-r--r-- ( 644 ).
If not, use 'chmod 644 directory_name' or
'chmod 755 directory_name'.
755 -> drwxrw-rw-
By the way, pls read the manpages for chmod,
that might give you an idea.
Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Shaikh Imran
Honored Contributor
Solution

Re: Can't create file

Hi,
Please confirm that the filesystem on which you are creating the directory is mounted with read-only or read-write access.
You can do this by
#cat /etc/fstab
If it's NFS filesystem check whether its exported as read-only from the NFS server.
You can do this by
#exportfs
command

Regards
I'll sleep when i am dead.
Jeroen Peereboom
Honored Contributor

Re: Can't create file

Peter,

you created the directory. That went right, so at that time the filesystem was not read-only. But now it apparantly is. What did you do after creating the directory? Reboot the system? Mount a filesystem on /db?
First cd to the directory and type 'df .' This will tell you which filesystem it belongs to. Next check (in /etc/fstab) if the filesystem is mounted read-write in /etc/fstab. And tell us the results...

JP.

peterchu
Super Advisor

Re: Can't create file

[root@edp/]# cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext2 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
LABEL=/tmp /tmp ext3 defaults 1 2
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
/dev/sda9 swap swap defaults 0 0


is it a read-only system ? thx
peterchu
Super Advisor

Re: Can't create file

thx reply , i tried to login as "root" to chmod the directory , it also pop "chmod: changing permissions of `/db': Read-only file system , and I also can't create file as "root" user , what is the problem in my setting ? thx.
Roberto Polli
Trusted Contributor

Re: Can't create file

send your

df -h

peace, R.
Mark Grant
Honored Contributor

Re: Can't create file

This is unlikely but it is possible that you have not quite booted in the way you think.

You could try the following

mount -o remount,rw /

Though you might have to replace the "/" with the device for the root filesystem

If that works and you can then create your file I would start to suspect your boot process and we can look at that.
Never preceed any demonstration with anything more predictive than "watch this"
Kiyoshi Miyake
Frequent Advisor

Re: Can't create file

Hi,

mount command shows the status of each mounted file system.

e.g.)

# mount | grep /boot
/dev/hda5 on /boot type ext2 (rw)
# mount -o remount,ro /boot
# mount | grep /boot
/dev/hda5 on /boot type ext2 (ro)
# mount -o remount,rw /boot
# mount | grep /boot
/dev/hda5 on /boot type ext2 (rw)
#

"(rw)" means read & write.
"(ro)" means read only.

What shows mount command on your box?


Perhaps, you have mounted /db with read only option.
Is /db mounted disk? or just directory on / disk?

thanks.