Cannot create symlink/symbolic to `xxx': Operation not supported

article/2025/10/16 12:12:00

1、Cannot create symlink to `xxx': Operation not supported

在虚拟机的共享目录中,解压内核源码,试过了几种解压方法都报出如下错误:

tar: linux-4.15/tools/testing/selftests/powerpc/vphn/vphn.h: Cannot create symlink to `../../../../../arch/powerpc/mm/vphn.h': Operation not supported
tar: linux-4.15/tools/testing/selftests/powerpc/vphn/vphn.c: Cannot create symlink to `../../../../../arch/powerpc/mm/vphn.c': Operation not supported
tar: linux-4.15/tools/testing/selftests/powerpc/stringloops/memcmp_64.S: Cannot create symlink to `../../../../../arch/powerpc/lib/memcmp_64.S': Operation not supported
tar: linux-4.15/tools/testing/selftests/powerpc/primitives/word-at-a-time.h: Cannot create symlink to `../../../../../arch/powerpc/include/asm/word-at-a-time.h': Operation not supported
tar: linux-4.15/tools/testing/selftests/powerpc/primitives/asm/ppc_asm.h: Cannot create symlink to `../../../../../../arch/powerpc/include/asm/ppc_asm.h': Operation not supported
tar: linux-4.15/tools/testing/selftests/powerpc/primitives/asm/asm-compat.h: Cannot create symlink to `../.././../../../../arch/powerpc/include/asm/asm-compat.h': Operation not supported
tar: linux-4.15/tools/testing/selftests/powerpc/copyloops/memcpy_power7.S: Cannot create symlink to `../../../../../arch/powerpc/lib/memcpy_power7.S': Operation not supported
tar: linux-4.15/tools/testing/selftests/powerpc/copyloops/memcpy_64.S: Cannot create symlink to `../../../../../arch/powerpc/lib/memcpy_64.S': Operation not supported
tar: linux-4.15/tools/testing/selftests/powerpc/copyloops/copyuser_power7.S: Cannot create symlink to `../../../../../arch/powerpc/lib/copyuser_power7.S': Operation not supported
tar: linux-4.15/tools/testing/selftests/powerpc/copyloops/copyuser_64.S: Cannot create symlink to `../../../../../arch/powerpc/lib/copyuser_64.S': Operation not supported
tar: linux-4.15/scripts/dtc/include-prefixes/xtensa: Cannot create symlink to `../../../arch/xtensa/boot/dts': Operation not supported
tar: linux-4.15/scripts/dtc/include-prefixes/sh: Cannot create symlink to `../../../arch/sh/boot/dts': Operation not supported
tar: linux-4.15/scripts/dtc/include-prefixes/powerpc: Cannot create symlink to `../../../arch/powerpc/boot/dts': Operation not supported
tar: linux-4.15/scripts/dtc/include-prefixes/openrisc: Cannot create symlink to `../../../arch/openrisc/boot/dts': Operation not supported
tar: linux-4.15/scripts/dtc/include-prefixes/nios2: Cannot create symlink to `../../../arch/nios2/boot/dts': Operation not supported
tar: linux-4.15/scripts/dtc/include-prefixes/mips: Cannot create symlink to `../../../arch/mips/boot/dts': Operation not supported
tar: linux-4.15/scripts/dtc/include-prefixes/microblaze: Cannot create symlink to `../../../arch/microblaze/boot/dts': Operation not supported
tar: linux-4.15/scripts/dtc/include-prefixes/metag: Cannot create symlink to `../../../arch/metag/boot/dts': Operation not supported
tar: linux-4.15/scripts/dtc/include-prefixes/h8300: Cannot create symlink to `../../../arch/h8300/boot/dts': Operation not supported
tar: linux-4.15/scripts/dtc/include-prefixes/dt-bindings: Cannot create symlink to `../../../include/dt-bindings': Operation not supported
tar: linux-4.15/scripts/dtc/include-prefixes/cris: Cannot create symlink to `../../../arch/cris/boot/dts': Operation not supported
tar: linux-4.15/scripts/dtc/include-prefixes/c6x: Cannot create symlink to `../../../arch/c6x/boot/dts': Operation not supported
tar: linux-4.15/scripts/dtc/include-prefixes/arm64: Cannot create symlink to `../../../arch/arm64/boot/dts': Operation not supported
tar: linux-4.15/scripts/dtc/include-prefixes/arm: Cannot create symlink to `../../../arch/arm/boot/dts': Operation not supported
tar: linux-4.15/scripts/dtc/include-prefixes/arc: Cannot create symlink to `../../../arch/arc/boot/dts': Operation not supported
tar: linux-4.15/include/dt-bindings/input/linux-event-codes.h: Cannot create symlink to `../../uapi/linux/input-event-codes.h': Operation not supported
tar: linux-4.15/arch/arm64/boot/dts/arm/vexpress-v2m-rs1.dtsi: Cannot create symlink to `../../../../arm/boot/dts/vexpress-v2m-rs1.dtsi': Operation not supported
tar: Exiting with failure status due to previous errors

根据这些报错信息,总结出报错原因为:

Cannot create symlink to `xxx': Operation not supported

我是在root状态下执行的解压命令,权限应该是没有问题的。

猜测是否是由于共享目录引起的愿意,当前待解压文件位于共享文件目录:

/mnt/hgfs/share2

试着将文件移入到其他目录:

我将待解压文件移入到home目录下,然后再使用解压命令进行解压,最后解压成功了,结果如下:

结果证明了猜测,是共享目录造成了解压失败,可能是因为windows与linux共享目录,在两种环境下造成的原因。但是造成原因的具体情况还是不太清楚,所以进一步通过搜索该问题了解该问题产生原因。

找到如下解释:

1、https://blog.csdn.net/leeafu/article/details/7449578

Windows共享目录, fat分区等是不支持linux的符号链接,必须在ext3/4, btrfs等这些分区格式的目录下解压。

2、https://blog.csdn.net/yanhe156/article/details/79768290

linux处理的时候把fat/vfat/fat32的文件系统 统一用vfat来表示,windows下的FAT,FAT32,NTFS文件系统是不支持linux的symbok link的。

……

从这些博客中,了解到了问题产生的具体原因,即windows下的文件系统,不支持linux的symbok link的。所以造成了解压失败,将文件移出共享文件再解压即可

但是我解压文件是想在Windows下进行查看,所以我使用mv命令移动解压后的目录进入到共享目录中,这时又遇到了如下问题:

cannot create symbolic link `xxx': Operation not supported

2、cannot create symbolic link `xxx': Operation not supported

又是一堆报错信息:

mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/Documentation/Changes': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/include/dt-bindings/input/linux-event-codes.h': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/scripts/dtc/include-prefixes/metag': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/scripts/dtc/include-prefixes/arm64': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/scripts/dtc/include-prefixes/h8300': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/scripts/dtc/include-prefixes/c6x': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/scripts/dtc/include-prefixes/arm': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/scripts/dtc/include-prefixes/microblaze': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/scripts/dtc/include-prefixes/dt-bindings': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/scripts/dtc/include-prefixes/powerpc': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/scripts/dtc/include-prefixes/arc': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/scripts/dtc/include-prefixes/xtensa': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/scripts/dtc/include-prefixes/mips': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/scripts/dtc/include-prefixes/cris': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/scripts/dtc/include-prefixes/sh': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/scripts/dtc/include-prefixes/openrisc': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/scripts/dtc/include-prefixes/nios2': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/tools/testing/selftests/powerpc/vphn/vphn.c': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/tools/testing/selftests/powerpc/vphn/vphn.h': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/tools/testing/selftests/powerpc/copyloops/copyuser_64.S': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/tools/testing/selftests/powerpc/copyloops/memcpy_64.S': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/tools/testing/selftests/powerpc/copyloops/copyuser_power7.S': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/tools/testing/selftests/powerpc/copyloops/memcpy_power7.S': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/tools/testing/selftests/powerpc/primitives/asm/ppc_asm.h': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/tools/testing/selftests/powerpc/primitives/asm/asm-compat.h': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/tools/testing/selftests/powerpc/primitives/word-at-a-time.h': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/tools/testing/selftests/powerpc/stringloops/memcmp_64.S': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/arch/arm64/boot/dts/arm/vexpress-v2m-rs1.dtsi': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/arch/arm/boot/dts/sun8i-a33-et-q8-v1.6.dts': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v1.2.dts': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts': Operation not supported
mv: cannot create symbolic link `/mnt/hgfs/share2/linux-4.15/arch/arm/boot/dts/sun8i-a33-ippo-q8h-v1.2.dts': Operation not supported

总结起来就是:cannot create symbolic link `xxx': Operation not supported

通过报错信息,感觉还是和上面同样的问题,还是Windows文件系统不支持符号链接(symbolic link)。

试了 mv 不行,准备再用 cp 试试:

通过:

cp --help

 得到cp指令使用方式:

结合博客《cp命令详解》,使用了如下cp 命令进行copy

方式1:

cp -a linux-4.15 /mnt/hgfs/share2/linux-4.15

方式2:

cp -r linux-4.15 /mnt/hgfs/share2/linux-4.15

方式3:

cp -r -d linux-4.15 /mnt/hgfs/share2/linux-4.15

都存在这种问题,于是另外想解决方案,既然拷贝文件不行,将这个文件压缩为zip格式来进行拷贝,这样在共享文件中也好解压。

使用命令:

zip -r linux-4.15.zip linux-4.15

压缩为 zip 后,再使用 cp 命令进行拷贝,拷贝成功后,使用Windows工具解压,或者使用unzip解压都可以,这时候不会报出Operation not supported 的问题。

 

3、总结

Cannot create symlink to `xxx': Operation not supported
Cannot create symbolic to `xxx': Operation not supported

两个问题都是windows下的文件系统,不支持linux的symbok link 造成的,知道这个原因后有很多解决方案,但是感觉我这个方式有点绕,主要就是避开Windows与Linux的差异。


http://chatgpt.dhexx.cn/article/cYTpX8KP.shtml

相关文章

Flutter报错Building with plugins requires symlink support的解决方法

错误 Building with plugins requires symlink support. Please enable Developer Mode in your system settings. Runstart ms-settings:developers to open settings. 原因 这个错误表示你的系统尚未启用开发者模式,所以无法使用Flutter的插件功能。 Flutter插件会通过符号…

硬链接,软链接,link,rename,symlink,opendir和readdir

什么是硬链接 struct stat {nlink_t st_nlink; /* Number of hard links};stat结构体就有一个成员变量----硬链接数 使用ln命令就可以创建硬链接 创建硬链接,就是再为文件创建一个名字 每创建一个硬链接,文件就多一个文件名,硬件链…

符号链接symlink_什么是符号链接或符号链接? 如何为Windows和Linux创建Symlink?

符号链接symlink Symbolic Links are also known as Symlinks. Symlinks are used to create a shortcut for a given file or folder. Symlinks are very useful for different purposes which also prevents copy the same data over and over again. In this tutorial, we w…

Visual Studio2019使用nmake编译调用libcurl库

编译 1.下载地址: curl downloads 我下载的是7.61.0 2.编译: 使用的是:VS2019 x64 本机工具命令提示,当然如果想编译成X86的库,可以选择VS2013 x86 本机工具命令提示或者VS2019 x64 兼容工具命令提示。 打开VS201…

cl.exe nmake.exe

1. 如果已经有vc6的dsp工程,可直接导出nmake脚本文件(.mak) “Project - Export Makefile...” nmake -f nMakeTest.mak CFG"nMakeTest - Win32 Debug" nmake -f nMakeTest.mak CFG"nMakeTest - Win32 Debug" all nmake -f nMakeTest.mak CFG&q…

Windows环境下用nmake编译libevent

Windows环境下用nmake编译libevent 一、方法总结1) nmake 命令找不到2) 头文件找不到3) lib库找不到4) 不知道如何生成“print-winsock-errors.obj” 二、详细说明1、nmake 和 cl 命令2、各种头文件缺失3、lib 库无法打开4、“print-winsock-errors.obj” 三、结语 最近在将一个…

nmake、makefile、cmake学习笔记

1.nmake 1.1 nmake reference NMAKE.EXE是Visual Studio附带的一个命令行工具,它基于描述文件中包含的命令生成项目。 要使用NMAKE,必须在开发人员命令提示符窗口中运行它。开发人员命令提示符窗口为工具、库设置了环境变量,并包含在命令行…

cmake nmake qmake 的区别联系

👇推荐关注👇 经常记不住这几个概念,都看了几次了还是容易忘,为以后方面查阅,故而从知乎上复制粘贴过来。 1、gcc是GNU Compiler Collection(就是GNU编译器套件),也可以简单认为是编…

VC++NMAKE

目 录 第1章 NMAKE 1 1.1 运行NMAKE 1 1.1.1 NMAKE的实质 2 1.2 描述块 3 1.2.1 定义 3 1.2.2 多个描述块 3 1.2.3 依赖 4 1.2.4 长文件名 4 1.2.5 多目标 4 1.2.6 合并 5 1.3 宏 5 1.3.1 定义、使用 5 1.3.2 作…

WINDOWS CMAKE与NMAKE

什么是cmake 你或许听过好几种 Make 工具,例如 GNU Make ,QT 的 qmake ,微软的 MSnmake,BSD Make(pmake),Makepp,等等。这些 Make 工具遵循着不同的规范和标准,所执行的…

vs 编译nmake工程

以本人电脑为例: 1、将D:\program files\visual studio 2013\VC\bin这个路径添加到系统环境变量的path中 2、打开cmd的控制台命令行界面 输入nmake与cl来测试是否报错 3、编译make文件: cd到源文件所在目录,使用命令nmake /F *.nmake编译m…

nmake 环境变量配置

本农有3年多C/C开发经验,最近面试全部翻车,总结原因是基础知识不过关,于是最近在看C primer 5,配套的源代码编译没通过,原因是nmake需要配置环境变量,总结错误如下 1.找不到nmake命令 解决方法:找到nmake所在路径,我用的是vs2010,C:\Program Files (x86)\Microsoft Visual Stud…

nmake命令(windows下的makefile)

1. 如果已经有vc6的dsp工程,可直接导出nmake脚本文件(.mak) “Project - Export Makefile...” nmake -f nMakeTest.mak CFG"nMakeTest - Win32 Debug" nmake -f nMakeTest.mak CFG"nMakeTest - Win32 Debug" all nmake -f nMakeTest.mak CFG&q…

nmake简介

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 nmake学习初步 前言一、nmake在哪里?二、Makefile编写1.hello.c实例代码2. Makefile3 扩展 前言 一直使用vs的IDE,最近编译sqlcipher时,发…

第八章 查询和检索:Query DSL

版权声明 本文为Elastic开源社区版权所有,保证独立性和原创性,未获得授权和允许,任何组织和个人不得以任何方式传播或复制或分享。否则必将追究法律责任。 知识内容输出不易,请尊重他人劳动成果。严禁随意传播、复制和盗用他人成果或文章内容用以商业或盈利目的! 1、查询…

mysql-dql(Data QueryLanguage)summary

1.基础查询 DESC 库名//查看库SHOW DATABASES ;//查看当前所在数据库SHOW TABLES;//查看当前库的所有表USE database;//datebase为需要查询的库名SELECT attribute,attribute2 FROM form;//从form中查询attribute,attribute2SELECT * FROM beauty;//查询表中所有属性SELECT DI…

db.query的使用

首先假设有如下表格,表格名称为:"Employees" SQL基本格式如下: [sql] view plain copy print ? select 列名称 from 表名称 最基本SQL语句,就是从表中选取要返回的列数据,不加任何过滤条件。当然如果&qu…

Elasticsearch——Query DSL语法入门

Query DSL入门 官网介绍链接: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html search api就是对存储在elastic search(以下简称es)中的数据进行查询的相关API,可以类比mysql中的select语句。…

Data Query Language(DQL):数据查询语言

Data Query Language(DQL):数据查询语言 基础查询查询所有列查询指定列 条件查询条件查询介绍查询示例如下 模糊查询模糊查询介绍查询示例如下 字段控制查询排序聚合函数分组查询分页查询 建立三张表用于查询,表中数据如下。 stu表…

SpringDataJPA+QueryDSL玩转态动条件/投影查询

在本文之前,本应当专门有一篇博客讲解SpringDataJPA使用自带的SpecificationJpaSpecificationExecutor去说明如何玩条件查询,但是看到新奇、编码更简单易懂的技术总是会让人感到惊喜,而且QueryDSL对SpringDataJPA有着完美的支持。如果你没有使…