![Ubuntu의 디렉터리에 하드 링크를 만들 수 없는 이유는 무엇입니까?](https://linux55.com/image/195001/Ubuntu%EC%9D%98%20%EB%94%94%EB%A0%89%ED%84%B0%EB%A6%AC%EC%97%90%20%ED%95%98%EB%93%9C%20%EB%A7%81%ED%81%AC%EB%A5%BC%20%EB%A7%8C%EB%93%A4%20%EC%88%98%20%EC%97%86%EB%8A%94%20%EC%9D%B4%EC%9C%A0%EB%8A%94%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
저는 "The Linux Command Line"이라는 책을 통해 리눅스 명령줄을 배우기 시작했습니다. 책의 지침에 따라 다음 명령을 입력하여 하드 링크를 만들려고 합니다 ln fun fun-hard
. 그런데 계속 이런 결과가 나오네요
ln: fun: hard link not allowed for directory
몇 가지 조사 끝에 디렉토리에 하드 링크를 만들 수 없다는 사실을 발견했습니다. 그런데 이것이 맞다면 왜 이 책의 목차에 하드 링크를 만드는 방법에 대한 지침이 포함되어 있습니까? 당신의 도움을 주셔서 감사합니다.
답변1
디렉토리에 대한 하드 링크를 생성하려고 합니다.
root@rpiserver:~# mkdir fun
root@rpiserver:~# ln fun fun_hard
ln: fun: hard link not allowed for directory
root@rpiserver:~#
이에 따르면 ln --help
불가능하다.
-d, -F, --directory allow the superuser to attempt to hard link
directories (note: will probably fail due to
system restrictions, even for the superuser)
슈퍼유저로서도 -d
실패합니다.
root@rpiserver:~# ln -d fun fun_hard
ln: failed to create hard link 'fun_hard' => 'fun': Operation not permitted
(모두 ext4를 파일 시스템으로 사용하여 Raspberry Pi에서 테스트했습니다.)