LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mkdir: cannot creat directory. How to enable mkdir for user in usb dir? (https://www.linuxquestions.org/questions/linux-newbie-8/mkdir-cannot-creat-directory-how-to-enable-mkdir-for-user-in-usb-dir-929725/)

Foxbat1155 02-16-2012 11:41 AM

mkdir: cannot creat directory. How to enable mkdir for user in usb dir?
 
Hello all.

I have mounted as root an external drive as ntfs.

I cannot create a dir as a user inside the /mnt/usb where it was mounted on.

I have done chmod a+rwx -R for the dir but still cannot do this.

Thanks in advance =)

Foxbat1155 02-16-2012 11:43 AM

output
 
output of ls -al:

Code:


miguel@madruga:/mnt/usb$ ls -al
total 4892
drwxrwxrwx 1 root root  12288 Feb 15 18:32 .
drwxr-xr-x 4 root root    4096 Feb 16 15:39 ..
drwxr--r-- 1 root root      0 Sep  9  2010 $AVG
drwxr--r-- 1 root root  12288 Feb  1 17:28 backup-ubuntu-january2012
drwxr--r-- 1 root root  16384 Feb 15 00:28 downloads
drwxr--r-- 1 root root      0 Feb 14 17:08 expunged
drwxr--r-- 1 root root    8192 Apr 12  2010 MarioLino
drwxr--r-- 1 root root      0 Jan 30 14:25 option-files
drwxr--r-- 1 root root    4096 Feb 10  2011 PDFS
drwxr--r-- 1 root root  12288 Feb 11 18:06 privado
drwxr--r-- 1 root root    8192 Jan 30 19:45 Programs
drwxr--r-- 1 root root    8192 Nov 25 10:43 Project_Pentagon
drwxr--r-- 1 root root    4096 Jan  8  2011 $RECYCLE.BIN
drwxr--r-- 1 root root      0 Mar 23  2011 RECYCLER
drwxr--r-- 1 root root      0 Nov 28 04:08 System Volume Information
drwxr--r-- 1 root root    4096 Aug 22  2010 System_Volume_Information
drwxr--r-- 1 root root      0 Feb 14 17:08 .Trash-1000


catkin 02-16-2012 11:46 AM

How was it mounted and which mount options were used?

Foxbat1155 02-16-2012 11:48 AM

mount
 
mount -t ntfs /dev/sdc1 /mnt/usb

Foxbat1155 02-16-2012 11:49 AM

ls -al of mount dir
 
Code:

miguel@madruga:/mnt$ ls -al
total 16
drwxr-xr-x  4 root root 4096 Feb 16 15:39 .
drwxr-xr-x 21 root root 4096 Feb 15 19:41 ..
drwxr-xr-x  2 root root 4096 Feb 15 21:10 usb
drwxr-xr-x  4 root root 4096 Jan  1  1970 usb2


Foxbat1155 02-16-2012 11:55 AM

default -w -rw
 
In the "man mount" :


Code:

-w, --rw
              Mount  the filesystem read/write. This is the default. A synonym
              is -o rw.

If this is the default, why do I have this after doing "mount -t ntfs /dev/sdc1 /mnt/usb"?


Code:

miguel@madruga:/mnt$ ll
total 24K
drwx------  1 root root  12K Feb 15 18:32 usb/
drwxr-xr-x  4 root root 4.0K Jan  1  1970 usb2/
drwxr-xr-x  4 root root 4.0K Feb 16 15:39 ./
drwxr-xr-x 21 root root 4.0K Feb 15 19:41 ../


Foxbat1155 02-16-2012 12:01 PM

sudo
 
By the way I do not use sudo. I dont know if that is a reason.

catkin 02-16-2012 12:02 PM

If you don't give any uid or gid mount options then all files on the NTFS file system are owned by root as you have seen.

You can either add a uid option for you user name or use a gid option with one of the groups that may be set up set up for that purpose -- perhaps plugdev or storage depending on the distro. Your user would need to be a member of the group.

Which distro are you using?

There's helpful information here.

Foxbat1155 02-16-2012 12:03 PM

debian squeeze
 
debian squeeze

edgardl 02-16-2012 12:07 PM

Hi, Linux cannot write on ntfs in that way, you could install ntfs-3g for example and then mount it

Something like
Code:

# mount -t ntfs-3g -o rw,umask=000 /dev/sdc1 /mnt/usb

Foxbat1155 02-16-2012 12:11 PM

reply
 
Ok, I did just now install ntfs-config and ntfs-3g with aptitude.

And executed the last command proposed.

I can now mkdir on external drive.

Thankyou. =)

I would like to ask for caveats because although thread is solved I have not fully understood the procedures I just made.

Foxbat1155 02-16-2012 12:16 PM

conclusion
 
If I understood this, I should execute that last command whenever I want to mount this external drive.

It will not be automatically mounting all ntfs drives I plug in my usb's?

Thankyou.

Foxbat1155 02-16-2012 12:18 PM

umask
 
It is the umask that provides full rwx access to everyone?

Foxbat1155 02-16-2012 12:20 PM

I suppose it is time to mark the thread as solved.


All times are GMT -5. The time now is 11:31 PM.