LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-24-2013, 01:30 AM   #1
Scotjura
LQ Newbie
 
Registered: Sep 2012
Posts: 1

Rep: Reputation: Disabled
Can't make a directory


I am the administrator on my laptop running Ubuntu 12.04. But I am denied permissionto cretae a directory. Why?
 
Old 06-24-2013, 01:40 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

you'll need to provide much more information. Eg How did you try to make the directory, and where did you try to make it? For example you could give the shell output of something like:

Code:
id
pwd
stat .
mkdir foo
Evo2.
 
Old 06-24-2013, 02:09 AM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Are you connected as root user or any normal user? Also check that under which location you're creating the directory and what permissions parant directory has.
 
Old 06-24-2013, 09:47 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 2,955

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
You might be trying on a read-only partition. Give more information.
 
Old 06-24-2013, 10:37 AM   #5
kooru
Senior Member
 
Registered: Sep 2012
Posts: 1,385

Rep: Reputation: 273Reputation: 273Reputation: 273
Hi and welcome to LQ!
As said, we need more info.

-command that you use
-if you are trying with root or normal user
-where you are trying to create the dir
 
Old 06-24-2013, 03:48 PM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,817

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
the normal everyday way
Code:
su -
--- your root password when asked --
mkdir /The/Location/Of/The/Folder/NameOfTheFolder
--- ie --
mkdir /mnt/USB.folder
 
Old 06-24-2013, 03:53 PM   #7
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,774
Blog Entries: 1

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
In ubuntu you will have to:

Code:
sudo su -
to become root. Then make your directory.
 
Old 06-24-2013, 08:35 PM   #8
Nbiser
Member
 
Registered: Oct 2012
Location: Maryland
Distribution: Fedora, Slackware, Debian, Ubuntu, Knoppix, Helix,
Posts: 302
Blog Entries: 7

Rep: Reputation: 44
Quote:
Originally Posted by John VV View Post
the normal everyday way
Code:
su -
--- your root password when asked --
mkdir /The/Location/Of/The/Folder/NameOfTheFolder
--- ie --
mkdir /mnt/USB.folder
No, the user should type this command:

Code:
sudo mkdir exampledirectory
He will then need to enter his admin password, and it should make the directory assuming that the partition that he is trying to create the directory on isn't read only, in which case the user will have to change the partition permission.

(This is Ubuntu, thus sudo)

Cheers,
Nbiser
 
Old 06-25-2013, 04:29 AM   #9
syamimi.mokhtar
LQ Newbie
 
Registered: Jun 2013
Posts: 2

Rep: Reputation: Disabled
Please provide the command you used and result.
 
Old 06-25-2013, 09:57 AM   #10
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 2,955

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
Actually, it is sudo bash:

Code:
$ sudo bash
# mkdir /want/you/want
 
Old 06-25-2013, 12:44 PM   #11
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Actually, the correct command to get a shell (the one specified in /etc/passwd, not everyone is using Bash) from sudo is
Code:
sudo -i
.

Can we now wait until the OP comes back with more information before go further with the discussion?
 
Old 06-25-2013, 02:36 PM   #12
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Hey, look, the OP is using Ubuntu, so he should only be using sudo, not starting a root session.

That being said, any directory on a Linux system must be created as a sub-directory of some other directory. The only exception is the root pseudo-directory, /, which is created when the initial RAM file system is started.

In order to create a sub-directory of some directory, you must have write permission to that directory. (You also need read permission to access any file in the directory, and execute permission in order to be able to list the contents of a directory) Generally speaking, if you are trying to create a sub-directory if some directory A, and you are in that directory and denied permission to do so, look at ls -l ../ where you should see something like this:
Code:
[peter ~]$ ls -l ../
total 8
drwx--x---+ 65 peter peter 4096 Jun 25 09:18 Peter
which tells you that ../ is a directory (the d at the start of the line), to which the user (peter) has read, write, and list access (the rwx following the d).

If you don't have access, you should see something like this:
Code:
$ ls -dl /
dr-xr-xr-x. 26 root root 4096 Jun 25 09:16 /
Notice that nobody has write access to the root directory itself, but that anyone can list and read files in it. That's actually somewhat misleading because the root account can actually create a new sub-directory of /. For example:
Code:
[peter ~]$ sudo mkdir /Example
[peter ~]$ ls -dl /Example
drwxr-xr-x. 2 root root 4096 Jun 25 11:05 /Example
but a normal user can't create a new sub-directory of that Example directory:
Code:
[peter ~]$ mkdir /Example/Example1
mkdir: cannot create directory /Example/Example1: Permission denied
unless the permissions on the directory are changed:
Code:
[peter ~]$ sudo chmod o+rwx /Example
[Peter ~]$ mkdir /Example/Example1
[peter ~]$ ls -l /Example/
total 4
drwxrwxr-x. 2 peter peter 4096 Jun 25 11:12 Example1
Note that the new sub-directory is owned by "peter," not "root," because the was created by "peter." Note also that the chmod used gives everybody permission to do anything they want to do with the Example directory and any sub-directory under it. A better, but more complicated, choice would have been:
Code:
[peter ~]$ sudo mkdir /Example
[peter ~]$ ls -dl /Example
drwxr-xr-x. 2 root root 4096 Jun 25 11:23 /Example
[peter ~]$ sudo chown root:peter /Example
[peter ~]$ sudo chmod g+rwx /Example
[peter ~]$ ls -dl /Example
drwxrwxr-x. 2 root peter 4096 Jun 25 11:23 /Example
[peter ~]$ mkdir /Example/Example1
[peter ~]$ ls -l /Example/
total 4
drwxrwxr-x. 2 peter peter 4096 Jun 25 11:25 Example1

Last edited by PTrenholme; 06-25-2013 at 02:44 PM. Reason: typo
 
Old 06-25-2013, 02:37 PM   #13
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,087
Blog Entries: 10

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Quote:
Originally Posted by Scotjura View Post
I am the administrator on my laptop running Ubuntu 12.04. But I am denied permissionto cretae a directory. Why?
Using the File Browser or via command line?
 
1 members found this post helpful.
  


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
Screen cannot make directory h3llkill3r Linux - Server 2 01-26-2012 11:36 AM
[SOLVED] make directory Pedroski Linux - General 4 09-19-2011 07:59 AM
How to make a sub directory to one directory..? mlibot Linux - Newbie 7 08-26-2009 09:44 AM
Can I Make make Believe Root Is a Different Directory? binarybob0001 Linux - General 5 11-20-2006 04:33 AM
Cannot 'make' in madwifi directory Katlyn Linux - Software 11 03-11-2006 04:44 AM


All times are GMT -5. The time now is 08:47 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration