LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-30-2010, 04:39 PM   #1
axisofevil
LQ Newbie
 
Registered: Feb 2010
Posts: 14

Rep: Reputation: 0
mkdir fails (even with -p ): No such file or directory


The setup ( although dont trust anything I say ):

I'm working on an embedded system device using a NFS mounted rootfs ( as shared by my host ) , but I store large video content directly on the device's hdd in /data.

Device's hdd partition /dev/sda3 is ext3 fs mounted at /tmp/mnt/diska3 (rw) , then I have a script create dirs like /tmp/mnt/diska3/data
and /tmp/mnt/diska3/data/incoming, then symlink : ln -s /tmp/mnt/diska3/data /data so that the /data appears like any other directory.

I can see /tmp/mnt/diska3/data/incoming. I did chmod -R a+w tmp to rule out permissions.

Running a subsequent script calls mkdir: mkdir -p /data/incoming/gui

BUT fails:
mkdir: cannot create directory '/data/': No such file or directory

What's the deal?

Thanks for use of your brain.. dB
 
Old 05-30-2010, 09:19 PM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
You don't state that you've verified that /data exists and that the process that is running the makdir has permission to write to /. (Typically, permission to modify the root is restricted to processes with uid=0.)

Did you try an ls -l / and look at the permissions on the link as well as the link target?
 
Old 05-31-2010, 01:19 PM   #3
mastahyeti
LQ Newbie
 
Registered: May 2010
Posts: 15

Rep: Reputation: 0
If he didn't have permissions it would tell him that rather than that the directory doesn't exist. Can you post your code? If you are doing everything that you described it sounds like it should be working. I can maybe see it giving you problems if sda3 was no longer mounted. Verify that /data exists and is linked to the right place and that sda3 is still mounted when you are trying to run mkdir. Good luck.
 
Old 06-01-2010, 12:00 PM   #4
axisofevil
LQ Newbie
 
Registered: Feb 2010
Posts: 14

Original Poster
Rep: Reputation: 0
I have an older working system and noted some differences. Before I start hacking maybe someone can spot the problem while I read up on this. There could be extraneous / wrong stuff on the old system but it does function. I believe the script that fails mkdir is run as root.

OLD (WORKING):
as seen from host:
lrwxrwxrwx 1 nfsnobody nfsnobody 20 2010-01-13 09:57 data -> /tmp/mnt/diska3/data
drwxrwxrwx 2 root root 4096 2009-11-10 11:33 tmp

as seen from target device:
lrwxrwxrwx 1 65534 nogroup 20 Jan 13 2010 data -> /tmp/mnt/diska3/data
drwxrwxrwt 4 root root 140 Jan 3 01:07 tmp
[ in /tmp ]
drwxr-xr-x 5 root root 100 Jan 1 00:00 mnt
[ in mnt ]
drwxrwxrwx 7 root root 4096 Sep 4 2000 diska3


NEW (FAILS:
as seen from host:
lrwxrwxrwx 1 root root 20 2010-05-30 09:45 data -> /tmp/mnt/diska3/data
drwxr-xr-x 2 root root 4096 2010-05-25 11:58 tmp

as seen from target device:
lrwxrwxrwx 1 root root 20 May 30 2010 data -> /tmp/mnt/diska3/data
drwxrwxrwt 4 root root 120 Nov 28 05:33 tmp
[ in /tmp ]
drwxr-xr-x 4 root root 80 Nov 28 05:33 mnt
[ in mnt ]
drwxrwxrwx 4 root root 4096 Nov 26 06:38 diska3
 
Old 06-01-2010, 12:55 PM   #5
axisofevil
LQ Newbie
 
Registered: Feb 2010
Posts: 14

Original Poster
Rep: Reputation: 0
Potentially solved:
I chmod 777 /tmp on host side ( was 755 ) . I'm a tad fuzzy on this but I believe root isn't really root on the target side, bbut rather nsfnobody with uid = 65534 not 0, so although root could do whatever, the effective uid couldn't write in /tmp/.

But stay tuned - I did change some other stuff so maybe that wasn't it....
 
Old 06-01-2010, 01:51 PM   #6
axisofevil
LQ Newbie
 
Registered: Feb 2010
Posts: 14

Original Poster
Rep: Reputation: 0
Well, slightly more complicated - a reboot reset permissions in /tmp/mnt so I had to chmod -r 777 AT BOOT just before running real scripts.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mkdir fails ( even with -p ): No such file or directory axisofevil Linux - Software 2 06-01-2010 12:11 PM
mkdir : cannot create directory : no such file or directory patcheezy Linux - Newbie 6 05-13-2009 12:26 PM
mkdir: cannot create directory `test': Read-only file system punt Linux - General 2 04-16-2005 10:58 PM
compiling fails: kdelibs_export.h: No such file or directory drowstar Linux - Software 1 01-12-2005 12:35 PM
"mkdir: cannot create directory `foo': Read-only file system" on FAT32 maddes Linux - Hardware 1 11-26-2003 07:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:18 PM.

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
Open Source Consulting | Domain Registration