drvfs를 사용하여 PC Box 네트워크 드라이브를 wsl2에 마운트하는 것은 수동으로 작동하지만 /etc/fstab에서는 작동하지 않습니다.

drvfs를 사용하여 PC Box 네트워크 드라이브를 wsl2에 마운트하는 것은 수동으로 작동하지만 /etc/fstab에서는 작동하지 않습니다.

두 개의 다른 시스템(Windows 및 Linux)에서 동일한 로컬/클라우드 동기화 파일에 액세스할 수 있도록 Box 드라이브를 wsl2에 마운트하고 싶습니다. Box는 drvfs 마운트에서 지원되는 FAT32 파일 시스템입니다.

다음 mount 명령을 사용하여 .bashrc 파일에서 마운트하면 문제 없이 마운트할 수 있습니다.

sudo mount -t drvfs 'C:\Users\Jakda\Box' /mnt/box

그런 다음 내 홈 디렉토리의 심볼릭 링크를 통해 /mnt/box에 액세스할 수 있습니다.

문제는 WSL 터미널을 열 때마다 sudo 비밀번호를 입력해야 한다는 점인데, 항상 그렇게 할 수는 없습니다.

이 줄을 넣었어요/etc/fstab

'C:\Users\Jakda\Box'    /mnt/box        drvfs     defaults     0       0

내가 실행하면 mount -a다음을 얻습니다.

<4>WARNING: mount: waiting for virtio device...
<3>init: (110) ERROR: MountPlan9WithRetry:285: mount drvfsa on /mnt/box (cache=mmap,rw,msize=262144,trans=virtio,aname=drvfs;path='C:\Users\Jakda\Box';symlinkroot=/mnt/) failed: 2
mount: No such file or directory

나는 이것을 한동안 시도해 왔지만 무엇을 해야할지 모르겠습니다.

답변1

Linux에서 파일 처리는 /etc/fstab함수에 의해 수행됩니다 getmntent. 매뉴얼 페이지에 따르면 :

GETMNTENT(3)               Linux Programmer's Manual              GETMNTENT(3)

.
.
.

DESCRIPTION
       These routines are used  to  access  the  filesystem  description  file
       /etc/fstab and the mounted filesystem description file /etc/mtab.

.
.
.

       Since fields in the mtab and fstab files are separated  by  whitespace,
       octal  escapes  are  used to represent the characters space (\040), tab
       (\011), newline (\012), and backslash (\\) in those files when they oc‐
       cur in one of the four strings in a mntent structure.  The routines ad‐
       dmntent() and getmntent() will convert from  string  representation  to
       escaped  representation  and back.  When converting from escaped repre‐
       sentation, the sequence \134 is also converted to a backslash.

(이들 중 가장 일반적으로 사용되는 것은 \040공백 문자입니다. 탭과 개행 문자는 Linux 경로 이름에서는 허용되지만 실제로는 거의 사용되지 않습니다.)

따라서 따옴표를 제거하고 백슬래시를 8진수 이스케이프로 바꾸세요 \134.

C:\134Users\134Jakda\134Box    /mnt/box        drvfs     defaults     0       0

관련 정보