LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-21-2009, 05:15 AM   #1
mghorbani
LQ Newbie
 
Registered: Jan 2009
Posts: 14

Rep: Reputation: 0
cp: cannot create directory


hello all.
i use fedora8.
there is a NTFS drive (program1) that mount when i startup. i copied some of my data in to it by cp command. but lastly this error appear:

[root@localhost ~]# cp -r /root/Desktop/n/ /media/program1/
cp: cannot create directory `/media/program1/n': Operation not supported

i don't know what happened!any idea?
 
Old 07-21-2009, 05:29 AM   #2
andycol
Member
 
Registered: Jul 2009
Location: South Africa
Posts: 38

Rep: Reputation: 16
root@localhost ~]# cp -r /root/Desktop/n/ /media/program1/
cp: cannot create directory `/media/program1/n': Operation not supported

try this type

mkdir /media/program1
then type cp -R /root/Desktop/n/ /media/program1/


notice the capital R

that should work
 
Old 07-21-2009, 05:30 AM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,077

Rep: Reputation: 400Reputation: 400Reputation: 400Reputation: 400Reputation: 400
Can you post the output of this command?

Code:
mount
As-is, without any argument.



My guess is that you might be using the "ntfs" driver, which have *very* limited support for writing to ntfs volumes. It can't create directories, and it has very limited support for anything else. You can read this on the kernel help text for the ntfs driver:

Quote:
CONFIG_NTFS_RW:

This enables the partial, but safe, write support in the NTFS driver.

The only supported operation is overwriting existing files, without
changing the file length. No file or directory creation, deletion or
renaming is possible. Note only non-resident files can be written to
so you may find that some very small files (<500 bytes or so) cannot
be written to.

While we cannot guarantee that it will not damage any data, we have
so far not received a single report where the driver would have
damaged someones data so we assume it is perfectly safe to use.

Note: While write support is safe in this version (a rewrite from
scratch of the NTFS support), it should be noted that the old NTFS
write support, included in Linux 2.5.10 and before (since 1997),
is not safe.

This is currently useful with TopologiLinux. TopologiLinux is run
on top of any DOS/Microsoft Windows system without partitioning your
hard disk. Unlike other Linux distributions TopologiLinux does not
need its own partition. For more information see
<http://topologi-linux.sourceforge.net/>

It is perfectly safe to say N here.
On the contrary, "ntfs3g" has a much better support for writing on ntfs file systems. So if my suspects are right, you just need to use ntfs3g in place of ntfs when mounting these volumes.

andycol, you would have a point in other versions of cp, but for the GNU cp command, -r, -R and --recursive are synonyms.

Last edited by i92guboj; 07-21-2009 at 05:32 AM.
 
Old 07-21-2009, 06:23 AM   #4
mghorbani
LQ Newbie
 
Registered: Jan 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by andycol View Post
root@localhost ~]#

try this type

mkdir /media/program1
then type cp -R /root/Desktop/n/ /media/program1/
the program1 was mounted when i startup in media.

[root@localhost ~]# mkdir /media/program1
mkdir: cannot create directory `/media/program1': File exists

[root@localhost ~]# cp -R /root/Desktop/n/ /media/program1/
cp: cannot create directory `/media/program1/n': Operation not supported
 
Old 07-21-2009, 06:27 AM   #5
mghorbani
LQ Newbie
 
Registered: Jan 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by i92guboj View Post
Can you post the output of this command?

Code:
mount
As-is, without any argument.
[root@localhost ~]# mount
/dev/sda8 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda6 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sda9 on /media/_1_ type ext3 (rw,nosuid,nodev,uhelper=hal)
/dev/sda1 on /media/SYSTEM_XP_ type vfat (rw,nosuid,nodev,uhelper=hal,shortname=lower,uid=0)
/dev/sda10 on /media/_boot1_ type ext2 (rw,nosuid,nodev,uhelper=hal)
/dev/sda5 on /media/program1 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
 
Old 07-21-2009, 06:42 AM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,077

Rep: Reputation: 400Reputation: 400Reputation: 400Reputation: 400Reputation: 400
Strange, it appears as a fuse related device, which means you are using ntfs-3g, so it's the correct driver.

Just as a test, can you try to do the same as root and see if it works?
 
Old 07-21-2009, 07:02 AM   #7
mghorbani
LQ Newbie
 
Registered: Jan 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by i92guboj View Post
Just as a test, can you try to do the same as root and see if it works?
I always work in root user!
before today this drive worked correctly. but now it has cp problem!
 
Old 07-21-2009, 07:15 AM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,077

Rep: Reputation: 400Reputation: 400Reputation: 400Reputation: 400Reputation: 400
Quote:
Originally Posted by mghorbani View Post
I always work in root user!
Very bad thing (tm). But I'll spare you the explanation of why you shouldn't be doing so unless you are really interested and haven't heard of it before.

Quote:
before today this drive worked correctly. but now it has cp problem!
Did you update something? Do you always remove the devices safely (in case it's a portable device)?

I'd start checking the file system at this point with fsck, check very carefully if there's any error. Just in case.
 
Old 07-21-2009, 07:31 AM   #9
mghorbani
LQ Newbie
 
Registered: Jan 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by i92guboj View Post

Did you update something? Do you always remove the devices safely (in case it's a portable device)?
yes .i update yelp package and gdm .if this related to yelp update?i think this problem occurred when i update yelp.
i always safe remove portable device. but today when i use an external hard it didn't mount automatic and i cant mount it manually(error!).before this i used this hard.


[root@localhost ~]# fsck
fsck 1.40.2 (12-Jul-2007)
e2fsck 1.40.2 (12-Jul-2007)
/dev/sda8 is mounted.

WARNING!!! Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.

Do you really want to continue (y/n)?

what do fsck exactly?
 
Old 07-21-2009, 07:44 AM   #10
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,077

Rep: Reputation: 400Reputation: 400Reputation: 400Reputation: 400Reputation: 400
fsck must NEVER be run on a mounted fs. Umount it first. I'll complete the post now in a second, but I publish this quickly because fsck'ing a drive that's mounted rw will result in data loss most likely.

EdITED:

Quote:
yes .i update yelp package and gdm .if this related to yelp update?i think this problem occurred when i update yelp.
Neither yelp nor gpm should have nothing to do with this at all.

Quote:
i always safe remove portable device. but today when i use an external hard it didn't mount automatic and i cant mount it manually(error!).before this i used this hard.
If a drive can't be mounted and you are sure that the fs is supported it's time to check it with fsck, for example, to check sda1 (where sda1 is an ntfs drive) you would usually do "fsck.ntfs /dev/sda1". Always with the drive unmounted, always!

You should check the drive that's giving you the problem about "operation not permitted", and also the drive that's failing to mount. Again, check that both are umounted before doing so. Anyway, fsck should warn you when the drive is mounted.

Last edited by i92guboj; 07-21-2009 at 07:48 AM.
 
Old 07-21-2009, 09:18 AM   #11
mghorbani
LQ Newbie
 
Registered: Jan 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by i92guboj View Post
for example, to check sda1 (where sda1 is an ntfs drive) you would usually do "fsck.ntfs /dev/sda1".
i didn't have fsck.ntfs

[root@localhost ~]# fsck.
fsck.cramfs fsck.ext3 fsck.msdos fsck.vfat
fsck.ext2 fsck.jfs fsck.reiserfs fsck.xfs

[root@localhost ~]# fdisk -l

Disk /dev/sda: 160.0 GB, 160040803840 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc204c204

Device Boot Start End Blocks Id System
/dev/sda1 * 1 5100 40965718+ c W95 FAT32 (LBA)
/dev/sda2 5101 19457 115322602+ f W95 Ext'd (LBA)
/dev/sda5 5101 10200 40965718+ 7 HPFS/NTFS
/dev/sda6 15300 15312 104391 83 Linux
/dev/sda7 15313 15443 1052226 82 Linux swap / Solaris
/dev/sda8 15444 19457 32242423+ 83 Linux
/dev/sda9 10349 15299 39768876 83 Linux
/dev/sda10 10201 10220 160618+ 83 Linux
/dev/sda11 10221 10348 1028128+ 82 Linux swap / Solaris

Partition table entries are not in disk order
 
Old 07-21-2009, 09:26 AM   #12
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,077

Rep: Reputation: 400Reputation: 400Reputation: 400Reputation: 400Reputation: 400
Quote:
Originally Posted by mghorbani View Post
i didn't have fsck.ntfs
You might need to install ntfsprogs, ntfsutils or whatever it's called in fedora. Search in your package manager for ntfs related stuff, it should be evident enough to figure out.


Quote:
[root@localhost ~]# fdisk -l

Disk /dev/sda: 160.0 GB, 160040803840 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc204c204

Device Boot Start End Blocks Id System
/dev/sda1 * 1 5100 40965718+ c W95 FAT32 (LBA)
/dev/sda2 5101 19457 115322602+ f W95 Ext'd (LBA)
/dev/sda5 5101 10200 40965718+ 7 HPFS/NTFS
/dev/sda6 15300 15312 104391 83 Linux
/dev/sda7 15313 15443 1052226 82 Linux swap / Solaris
/dev/sda8 15444 19457 32242423+ 83 Linux
/dev/sda9 10349 15299 39768876 83 Linux
/dev/sda10 10201 10220 160618+ 83 Linux
/dev/sda11 10221 10348 1028128+ 82 Linux swap / Solaris

Partition table entries are not in disk order
Nothing wrong with that, if you mean that they are not in consecutive order.

Numbers from 1 to 4 are reserved for primary partitions (or extended ones, that are just a special type of primary partitions).

Logical partitions that live inside the extended one start always in 5, regardless if there are 1, 2, 3 or 4 primary/extended partitions.
 
Old 07-21-2009, 09:57 AM   #13
mghorbani
LQ Newbie
 
Registered: Jan 2009
Posts: 14

Original Poster
Rep: Reputation: 0
[root@localhost ~]# yum list all ntfs*
Installed Packages
ntfs-3g.i386 2:1.5012-4.fc8 installed
ntfs-3g-devel.i386 2:1.5012-4.fc8 installed
ntfs-config.noarch 1.0-0.5.rc5.fc8 installed
ntfsprogs.i386 1.13.1-8.fc8 installed
ntfsprogs-devel.i386 1.13.1-8.fc8 installed
ntfsprogs-gnomevfs.i386 1.13.1-8.fc8 installed
[root@localhost ~]# fsck.
fsck.cramfs fsck.ext3 fsck.msdos fsck.vfat
fsck.ext2 fsck.jfs fsck.reiserfs fsck.xfs

[root@localhost ~]# fsck /dev/sda5
fsck 1.40.2 (12-Jul-2007)
fsck: fsck.ntfs: not found
fsck: Error 2 while executing fsck.ntfs for /dev/sda5
 
Old 07-21-2009, 10:13 AM   #14
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,077

Rep: Reputation: 400Reputation: 400Reputation: 400Reputation: 400Reputation: 400
There must be some problem specific to the fedora packaging, I can't help with that since I know nothing about fedora. But, evidently, there's some problems somewhere. fsck itself is telling you that fsck.ntfs is missing.

That binary should surely be part of ntfsprogs.i386, maybe you should ask on the fedora specific subforum about how to get fsck.ntfs.
 
Old 07-21-2009, 10:25 AM   #15
mghorbani
LQ Newbie
 
Registered: Jan 2009
Posts: 14

Original Poster
Rep: Reputation: 0
thanks for replay.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mkdir : cannot create directory : no such file or directory patcheezy Linux - Newbie 6 05-13-2009 12:26 PM
How to create a directory? thinice15 Programming 3 07-19-2008 01:45 AM
How do i create a directory ? vskgopu Programming 1 07-26-2006 04:25 AM
can't create new directory dummoi Linux - Newbie 4 06-24-2004 03:50 PM
Create a directory SnowSurfAir Linux - Software 15 07-21-2003 07:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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