LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 12: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, 12:40 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
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, 01: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, 08:47 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,871
Blog Entries: 1

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

Rep: Reputation: 275Reputation: 275Reputation: 275
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, 02:48 PM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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, 02:53 PM   #7
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

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

Code:
sudo su -
to become root. Then make your directory.
 
Old 06-24-2013, 07: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, 03: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, 08:57 AM   #10
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,871
Blog Entries: 1

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

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

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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, 01:36 PM   #12
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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 01:44 PM. Reason: typo
 
Old 06-25-2013, 01:37 PM   #13
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:16 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
Open Source Consulting | Domain Registration