
Ich möchte ein Box-Laufwerk auf wsl2 mounten, damit ich auf zwei verschiedenen Systemen (Windows und Linux) auf dieselben lokal/in der Cloud synchronisierten Dateien zugreifen kann. Box ist ein FAT32-Dateisystem, das meines Wissens von drvfs mount unterstützt wird.
Ich kann es problemlos mounten, wenn ich es aus der .bashrc-Datei mit dem folgenden Mount-Befehl mounte:
sudo mount -t drvfs 'C:\Users\Jakda\Box' /mnt/box
Ich kann dann über einen symbolischen Link in meinem Home-Verzeichnis auf /mnt/box zugreifen.
Das Problem dabei ist, dass ich jedes Mal, wenn ich ein WSL-Terminal öffne, mein Sudo-Passwort eingeben muss, was ich nicht immer tun kann.
Ich habe diese Zeile eingefügt/etc/fstab
'C:\Users\Jakda\Box' /mnt/box drvfs defaults 0 0
und wenn ich laufe, mount -a
bekomme ich:
<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
Ich versuche das jetzt schon eine Weile und weiß nicht, was ich tun soll.
Antwort1
Die Verarbeitung der /etc/fstab
Datei erfolgt unter Linux durch eine Funktion getmntent
. Laut der Manualpage:
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.
(Das mit Abstand am häufigsten verwendete Zeichen ist \040
das Leerzeichen. Tabulatoren und Zeilenumbrüche sind zwar in Linux-Pfadnamen zulässig, werden in der Praxis jedoch selten verwendet.)
Entfernen Sie also die Anführungszeichen und ersetzen Sie die Backslashes durch ihre Oktal-Escapezeichen \134
:
C:\134Users\134Jakda\134Box /mnt/box drvfs defaults 0 0