linux系统某些软连接偶尔会莫名消失,但其他的一些却一直正常,这是什么情况?

linux系统某些软连接偶尔会莫名消失,但其他的一些却一直正常,这是什么情况?,第1张

编辑启动grub配置文件

# vi /boot/grub/grub.conf 或 /etc/grub.conf 软连接文件,2个文件内容是一样的。

增加kernel行最后的“rhgb” 保存退出。

rhgb表示RedHat graphics boot,就是会看到图片来代替启动过程中显示的文本信息,这些信息在启动后用dmesg也可以看到

Linux下取消软连接,做个案例来说明:

1.先建立一个软连接

[root@rekfan.com test]# ls -il

总计  0

1491138 -rw-r–r– 1 root root 48 07-14 14:17 file1

1491139 -rw-r–r– 2  root root 0 07-14 14:17 file2

1491139 -rw-r–r– 2 root root 0 07-14 14:17  file2hand

#建立file1和file1soft软连接

[root@rekfan.com test]# ln -s file1  file1soft

[root@rekfan.com test]# ls -il

总计 0

1491138 -rw-r–r– 1 root  root 48 07-14 14:17 file1

1491140 lrwxrwxrwx 1 root root 5 07-14 14:24  file1soft -> file1

1491139 -rw-r–r– 2 root root 0 07-14 14:17  file2

1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2hand

2.删除上面建立的软连接

[root@rekfan.com test]# ls -il

总计  0

1491138 -rw-r–r– 1 root root 0 07-14 14:17 file1

1491140 lrwxrwxrwx 1  root root 5 07-14 14:24 file1soft -> file1

1491139 -rw-r–r– 2 root root 0  07-14 14:17 file2

1491139 -rw-r–r– 2 root root 0 07-14 14:17  file2hand

#删除软连接

[root@rekfan.com test]# rm -rf file1soft

[root@rekfan.com test]#  ls -il

总计 0

1491138 -rw-r–r– 1 root root 0 07-14 14:17 file1

1491139  -rw-r–r– 2 root root 0 07-14 14:17 file2

1491139 -rw-r–r– 2 root root 0 07-14  14:17 file2hand

linux文件系统中,文件数据存为一处data block,文件属性存为一处inode,inode指向数据块data block,所谓硬链接,只不过是新建立了一个inode,即多个inode指向同一个数据块。软链接本身是一个文件,指向文件的inode


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/7630532.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-08
下一篇2023-04-08

发表评论

登录后才能评论

评论列表(0条)

    保存