LinuxQuestions.org
Review your favorite Linux distribution.
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 08-24-2013, 12:42 PM   #1
sniper8752
Member
 
Registered: Oct 2012
Posts: 318

Rep: Reputation: Disabled
creating folder on ntfs hd


I am trying to create a folder on a HD formatted as NTFS. I do a sudo mkdir folder. it tells me the operation is not permitted. I read that I had to install ntfs-3g to write to the hd, so I did, but it still does not work.
 
Old 08-24-2013, 01:52 PM   #2
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,822

Rep: Reputation: 748Reputation: 748Reputation: 748Reputation: 748Reputation: 748Reputation: 748Reputation: 748
ntfs-3g allows writing to windows permissions which includes creating directories/files. That is different from permissions. Also, is the windows partition mounted?
 
Old 08-24-2013, 01:58 PM   #3
sniper8752
Member
 
Registered: Oct 2012
Posts: 318

Original Poster
Rep: Reputation: Disabled
when you say mounted - does that mean am I able to access it (and the contents)? I am able to access anything on the drive.
 
Old 08-24-2013, 04:22 PM   #4
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,822

Rep: Reputation: 748Reputation: 748Reputation: 748Reputation: 748Reputation: 748Reputation: 748Reputation: 748
It can be mounted manually or on boot if you have an entry for the partition in the /etc/fstab file.
Is this the same hard drive on which you have your Linux (Ubuntu?) install?
Ubuntu and some of its derivatives auto-mount in the /media directory.
When you say you are able to 'access' anything, does that mean see/read or can your write to it?
You need to post more specific information and answer the above questions to start.
 
Old 08-24-2013, 06:21 PM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,539

Rep: Reputation: 462Reputation: 462Reputation: 462Reputation: 462Reputation: 462
Quote:
Originally Posted by sniper8752 View Post
when you say mounted - does that mean am I able to access it (and the contents)? I am able to access anything on the drive.
basically yes.

http://linux.die.net/man/8/mount

In the MS world when you plug in a USB drive and you get the little pop-up window, "Installing drivers for XYZ device", wait for it, "Your device is now ready for use" Windows is "mounting" the device and assigning it a drive letter. lets call it E:\ as an example.

In Linux you can think of it the same way. Until the OS has "mounted" the drive there is zero access to the device. that simple.

Now how things are mounted, accessed, etc... that is a bit different in the Linux world then the MS world.

In most modern distros, including Ubuntu, the GUI (thats the graphical user interface) has some means of accessing the computers file system. If when you open that and you can not see the NTFS partition/drive/device then it is not mounted and you might have to mount it manually via the command line (cli) think CMD in the MS world.

as you are using Ubuntu assume all of these commands are issued via sudo, or if you are smart you enabled the root account and are running as root, thus ill be using # to display that level of user access. THESE are NOT something the typical USER level account should ever have access to. these are ROOT level access commands. Please keep that in mind. This is NOT the MS world were everything you do should be done as an administrator because that is just NOT SAFE or secure.

Code:
# mkdir /mnt/NTFS
# fdisk -l        <you are looking for the NTFS drive and its partition number.  i am going to use /dev/sdb1 for my example>
# mount -t ntfs-3g /dev/sdb1 /mnt/NTFS
# cd /mnt/NTFS
# ls -laF
this will first create the mount point /mnt/NTFS
then you will be looking for the device information
mount using the ntfs-3g utility that works with mount
change directory into the /mnt/NTFS that contains your data for the NTFS partition
verify that you are able to read the data by running a ls (list) command. the -l is long, the -a is all and the -F is file type.

side note, i will typically alias ls -laF to d this makes for much less typing:

Code:
alias d='/bin/ls -laF'
alias dird='/bin/ls -laFp | grep /'
those two allow me to list the full list of files and directories including hidden directories (your . directories like .ssh) or just the directories only.

very nice to have in any Linux system.
 
Old 08-24-2013, 06:45 PM   #6
sniper8752
Member
 
Registered: Oct 2012
Posts: 318

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by lleb View Post
basically yes.

http://linux.die.net/man/8/mount

In the MS world when you plug in a USB drive and you get the little pop-up window, "Installing drivers for XYZ device", wait for it, "Your device is now ready for use" Windows is "mounting" the device and assigning it a drive letter. lets call it E:\ as an example.

In Linux you can think of it the same way. Until the OS has "mounted" the drive there is zero access to the device. that simple.

Now how things are mounted, accessed, etc... that is a bit different in the Linux world then the MS world.

In most modern distros, including Ubuntu, the GUI (thats the graphical user interface) has some means of accessing the computers file system. If when you open that and you can not see the NTFS partition/drive/device then it is not mounted and you might have to mount it manually via the command line (cli) think CMD in the MS world.

as you are using Ubuntu assume all of these commands are issued via sudo, or if you are smart you enabled the root account and are running as root, thus ill be using # to display that level of user access. THESE are NOT something the typical USER level account should ever have access to. these are ROOT level access commands. Please keep that in mind. This is NOT the MS world were everything you do should be done as an administrator because that is just NOT SAFE or secure.

Code:
# mkdir /mnt/NTFS
# fdisk -l        <you are looking for the NTFS drive and its partition number.  i am going to use /dev/sdb1 for my example>
# mount -t ntfs-3g /dev/sdb1 /mnt/NTFS
# cd /mnt/NTFS
# ls -laF
this will first create the mount point /mnt/NTFS
then you will be looking for the device information
mount using the ntfs-3g utility that works with mount
change directory into the /mnt/NTFS that contains your data for the NTFS partition
verify that you are able to read the data by running a ls (list) command. the -l is long, the -a is all and the -F is file type.

side note, i will typically alias ls -laF to d this makes for much less typing:

Code:
alias d='/bin/ls -laF'
alias dird='/bin/ls -laFp | grep /'
those two allow me to list the full list of files and directories including hidden directories (your . directories like .ssh) or just the directories only.

very nice to have in any Linux system.
Thanks for this! I really appreciate it.

it does show in /mnt and /media, and I can run a ls command on it, and it shows the contents.
 
Old 08-25-2013, 12:33 AM   #7
John VV
Guru
 
Registered: Aug 2005
Posts: 12,906

Rep: Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715
/media is the "automount" from udev
/mnt is for partitions YOU manually set to be mounted

if you pop in a movie dvd it is automounted in a auto-generated folder in /media

a usb thumb drive will get automounted in /media unless there is a manually created udev rule and an entry in /etc/fstab for where and HOW to mount it
 
Old 08-25-2013, 10:06 AM   #8
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,539

Rep: Reputation: 462Reputation: 462Reputation: 462Reputation: 462Reputation: 462
it should not show in BOTH /mnt and /media as per john vv explanation. that is like living in two houses at the exact same time, the mail man will never know were to deliver your mail. just does not work.

if it is automounting then let it automount, but if when it does so you do not have the correct permissions, then you MANUALLY unmount it and follow my directions above.
 
Old 08-25-2013, 01:19 PM   #9
sniper8752
Member
 
Registered: Oct 2012
Posts: 318

Original Poster
Rep: Reputation: Disabled
that is good to know the difference. I understand now. thanks.

and thank you - it worked!

I noticed that some of the text has a background color of green when i run the ls command. i noticed that these are only directories. does green indicate that they are directories?
 
Old 08-25-2013, 09:38 PM   #10
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,539

Rep: Reputation: 462Reputation: 462Reputation: 462Reputation: 462Reputation: 462
if you are running an enhanced terminal then each color will mean something for your terminal. green could be directories (typically it is) as red is typically an executable type file (+x file permissions as user), blue is something else, etc...

i typically do not like color enhanced terminals as the dark blue on a black background is very hard for me to read.
 
Old 08-25-2013, 11:04 PM   #11
ixion2600
LQ Newbie
 
Registered: Aug 2013
Posts: 11

Rep: Reputation: Disabled
It depends on your terminal, as llebsaid. But the siplaest way is to take a look at the first collumn from left to right (I executed "ls -l"):

total 16
drwxr-xr-x. 4 root root 4096 May 13 06:41 .
drwx------. 23 root root 4096 Aug 26 05:56 ..
drwxr-xr-x. 3 root root 4096 May 13 06:41 extensions
drwx------. 3 root root 4096 May 13 06:41 firefox

The first letter on the first collumn is "D", it means that this is a directory.

-rwxr-xr-x. 1 root root 52656 Apr 17 2012 touch
-rwxr-xr-x. 1 root root 11392 Mar 22 2011 tracepath
-rwxr-xr-x. 1 root root 12288 Mar 22 2011 tracepath6
-rwxr-xr-x. 1 root root 57480 May 25 2010 traceroute


The first symbol on the first collumn is now a "-", it means that it is a file -> binary|movie|picture|what ever ..

There a re even more file types, you can google then. This is usefull for you, just to take a look at the left side, after you did a ls -l and you will automatically know if it's a directory or not.
 
  


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
[SOLVED] Mounting a folder in NTFS Partition with ntfs-3g imayneed Linux - Newbie 5 07-13-2012 09:42 PM
ntfs for home folder? konzo Linux - Newbie 3 02-21-2010 08:22 AM
Help on creating an NTFS partion kenixkil Linux - Newbie 14 09-03-2008 10:01 AM
creating folder shortcuts trumpetdork Linux - Newbie 2 04-05-2005 08:47 PM
NOOB--creating new folder dave37 Linux - General 5 09-25-2003 04:29 PM


All times are GMT -5. The time now is 05:39 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration