CP: cannot Create Symbolic Link XXX operation not permitted

Source: Internet
Author: User
Tags nfsd
[Understand] CP: cannot Create Symbolic Link XXX operation not permitted + you can use mount or DF-t to find out the file system of a folder.
[Understand] CP: cannot Create Symbolic Link XXX operation not permitted + you can use mount or DF-t to find out the file system of a folder.

Background]

In Linux, copy a directory and all its files to another directory. An error occurred while copying the result:

CP: cannot Create Symbolic Link '/mnt/linuxdev/focus/carifan/kernel/2007r1/bfin_425/linux-2.6.x/focus/include/ASM': operation not permitted

[Solution process]

I searched the internet and learned that there are two possible reasons for creating a symbolic link,

1. No permission

The source and destination are guaranteed to be operated by permissions.

2. the target file system does not support symbolic links.

Check the target folder and the file system. The result is smbfs:





[E516537 @ RD-Linux-2420 ~] $Ls/mnt/linuxdev/focus/carifan/kernel/2007r1/bfin_425-l
Total 4
Drwxrwxrwx 1 root randd 4096 Aug 26 0linux-2.6.x
[E516537 @ RD-Linux-2420 ~] $Ls/usr/src/Blackfin/adi_release/kernel/2007r1/carifan_bfin_425-l
Total 224
Drwxr-XR-x 11 e516537 root 4096 Aug 23 bfin_patch
-Rwxr-XR-x 1 e516537 root 4023 Aug 23 bfin-serial-handle-status.patch
...

Drwxr-XR-x 29 e516537 root 4096 Aug 23 linux-2.6.x
-RW-r-1 e516537 root 13648 Aug 23 makefile
...

Drwxr-XR-x 66 e516537 root 4096 Aug 23 vendors
[E516537 @ RD-Linux-2420 ~] $Mount 
/Dev/sda5 on/TypeExt3(RW)
None on/proc type proc (RW)
None on/sys type sysfs (RW)
None on/dev/PTS type devpts (RW, gid = 5, mode = 620)
Usbfs on/proc/bus/USB Type usbfs (RW)
/Dev/sda3 on/boot type ext3 (RW)
None on/dev/SHM type tmpfs (RW)
/Dev/sdb1 on/newdisk type ext3 (RW)
None on/proc/sys/fs/binfmt_misc type binfmt_misc (RW)
SunRPC on/var/lib/nfs/rpc_pipefs type rpc_pipefs (RW)
// Nj55w2572/linuxdevOn/Mnt/beta/linuxdevType
Smbfs(0)
NFSD on/proc/fs/nfsd type nfsd (RW)
/Dev/sdc1 on/mnt/usbext type ext2 (RW)
[E516537 @ RD-Linux-2420 ~] $DF-T
Filesystem type 1k-blocks used available use % mounted on
/Dev/sda5 ext3233918968 123418360 98618136 56%/
/Dev/sda3 ext3 194449 23555 160854 13%/boot
None tmpfs 516604 0 516604 0%/dev/SHM
/Dev/sdb1 ext3 307663800 177760488 114274880 61%/newdisk
// Nj55w2572/linuxdev
Smbfs1120894976 1046872064 74022912 94%/Mnt/beta/linuxdev
/Dev/sdc1 ext2 961432072 961432072 0 100%/mnt/usbext

[E516537 @ RD-Linux-2420 ~] $Ls/mnt/-l
Total 64
Drwxr-XR-x 5 root Root 4096 Feb 7 2007 Beta
Drwxr-XR-x 2 rddev randd 4096 Apr 19 2006 betalinuxdev
Drwxr-XR-x 3 Root 4096 May 14 2007 bwfile02
Lrwxrwxrwx 1 Root 13 Feb 8 2007Linuxdev-> beta/linuxdev
Lrwxrwxrwx 1 Root 12 Jan 2 2007 _ linuxdev. Backup-> betalinuxdev
Drwxr-XR-x 2 root Root 4096 Nov 7 2005 RP
Drwxr-XR-x 2 root Root 4096 Jul 27 2009 test1
Drwxr-XR-x 3 Root 16384 Aug 20 00:00 usbext

That is, the source folder is/usr/src/Blackfin/adi_release/kernel/2007r1/carifan_bfin_425, which belongs to the/directory and corresponds to ext3. Therefore, it supports symbolic links, the target folder is/mnt/linuxdev/focus/carifan/kernel/2007r1/bfin_425 which belongs to linuxdev under/mnt, that is,/mnt/beta/linuxdev, which belongs to smbfs, it is a directory shared by smb. The corresponding original folder // nj55w2572/linuxdev should be shared from a Windows Server. The file system is fat or NTFS, therefore, symbolic links are not supported.

That is, the source folder to be copied here supports symbolic links. The destination folder to be copied does not support symbolic links. Therefore, an error is returned. But knowing the cause cannot be solved, because smbfs cannot be replaced here ....

 

You can use mount or DF-t to find out the file system of a folder.

We can see from the above that the mount or DF-t can be used to find the file system of a folder:



[E516537 @ RD-Linux-2420 ~] $Mount

/Dev/sda5On/
TypeExt3(RW)
None on/proc type proc (RW)
None on/sys type sysfs (RW)
None on/dev/PTS type devpts (RW, gid = 5, mode = 620)
Usbfs on/proc/bus/USB Type usbfs (RW)
/Dev/sda3 on/boot type ext3 (RW)
None on/dev/SHM type tmpfs (RW)
/Dev/sdb1 on/newdisk type ext3 (RW)
None on/proc/sys/fs/binfmt_misc type binfmt_misc (RW)
SunRPC on/var/lib/nfs/rpc_pipefs type rpc_pipefs (RW)
// Nj55w2572/linuxdev on/mnt/beta/linuxdev type smbfs (0)
NFSD on/proc/fs/nfsd type nfsd (RW)
/Dev/sdc1 on/mnt/usbext type ext2 (RW)
[E516537 @ RD-Linux-2420 ~] $DF-T
Filesystem type 1k-blocks used available use % mounted on
/Dev/sda5 ext3
233918968 123418360 98618136 56%/
/Dev/sda3 ext3 194449 23555 160854 13%/boot
None tmpfs 516604 0 516604 0%/dev/SHM
/Dev/sdb1 ext3 307663800 177760488 114274880 61%/newdisk
// Nj55w2572/linuxdev
Smbfs 1120894976 1046872064 74022912 94%/mnt/beta/linuxdev
/Dev/sdc1 ext2 961432072 961432072 0 100%/mnt/usbext
That is, you know the folder you want to query, such

/Usr/src/Blackfin/adi_release/kernel/2007r1/carifan_bfin_425

Obviously, it belongs to a folder under the root directory,

The root directory/corresponding file system is ext3, so we know that this folder is ext3 file system.

 

In one sentence, two file systems are different. One file system supports symbolic links and the other does not support symbolic links.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.