Re: linux-2.6.25: 'mkdir -p' does not work with rootdir as mount point inside a read only filesystem

From: Lothar Waßmann
Date: Mon May 05 2008 - 02:28:20 EST


Hi,

Willy Tarreau writes:
> > My guess is that you have an old/buggy version of mkdir.
> >
> > What does
> > mkdir --version
> >
> > say?
> > Mine says:
> > mkdir (GNU coreutils) 6.10
> > Copyright (C) 2008 Free Software Foundation, Inc.
> > etc...
>
> I would bet this is the problem for the reporter.
>
> I tried the same here, and cannot exhibit the problem. Just like the
> reporter, my / is ro and /dev is rw :
>
I'm using busybox 1.0 (on an embedded PXA320 system).

> stat64("/dev/a/b/c", 0xbf9175dc) = -1 ENOENT (No such file or directory)
> umask(0) = 022
> open(".", O_RDONLY|O_LARGEFILE|O_DIRECTORY) = 3
> chdir("/") = 0
> mkdir("dev", 0755) = -1 EEXIST (File exists)
> stat64("dev", {st_mode=S_IFDIR|0755, st_size=17080, ...}) = 0
> chdir("dev") = 0
> mkdir("a", 0755) = 0
> chdir("a") = 0
> mkdir("b", 0755) = 0
> chdir("b") = 0
> umask(022) = 0
> mkdir("c", 0777) = 0
> fchdir(3) = 0
> close(3) = 0
>
This is what strace shows in my case:
mkdir("/", 0777) = -1 EEXIST (File exists)
stat64("/", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
mkdir("/dev/", 0777) = -1 EROFS (Read-only file system)
umask(022) = 022
write(2, "mkdir: ", 7mkdir: ) = 7
write(2, "Cannot create directory `/dev/\'", 31Cannot create directory `/dev/') = 31
write(2, ": Read-only file system\n", 24: Read-only file system
) = 24
io_submit(0x1, 0x1, 0xfbad2088 <unfinished ... exit status 1>


Lothar Waßmann
--
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@xxxxxxxxxxxxxxxxxxx
___________________________________________________________
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/