Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to mount the new BoxDrive which is some kind of fake volumn. #4310

Closed
abalter opened this issue Jul 16, 2019 · 17 comments
Closed

How to mount the new BoxDrive which is some kind of fake volumn. #4310

abalter opened this issue Jul 16, 2019 · 17 comments

Comments

@abalter
Copy link

abalter commented Jul 16, 2019

Please use the following bug reporting template to help produce issues which are actionable and reproducible, including all command-line steps necessary to induce the failure condition. Please fill out all the fields! Issues with missing or incomplete issue templates will be closed.

If you have a feature request, please post to the UserVoice.

If this is a console issue (a problem with layout, rendering, colors, etc.), please post to the console issue tracker.

Important: Do not open GitHub issues for Windows crashes (BSODs) or security issues. Please direct all Windows crashes and security issues to secure@microsoft.com. Ideally, please configure your machine to capture minidumps, repro the issue, and send the minidump from "C:\Windows\minidump".

Please fill out the below information:

  • Your Windows build number: (Type ver at a Windows Command Prompt)

Microsoft Windows [Version 10.0.18362.239]

  • What you're doing and what's happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)

Trying to copy files to the new BoxDrive.

  • What's wrong / what should be happening instead:

I get a permission error if I try to access the folder. A different error if I try to mount.

(base) balter@spectre:/mnt/c$ ll
ls: cannot read symbolic link 'Box': Input/output error
ls: cannot read symbolic link 'Documents and Settings': Permission denied
ls: cannot access 'hiberfil.sys': Permission denied
ls: cannot access 'pagefile.sys': Permission denied
ls: PerfLogs: Permission denied
ls: cannot access 'swapfile.sys': Permission denied
ls: 'System Volume Information': Permission denied
total 152
drwxrwxrwx 1 balter balter   4096 Jun 10 16:12 '$Recycle.Bin'/
drwxrwxrwx 1 balter balter   4096 Jul 16 10:36  ./
drwxr-xr-x 1 root   root     4096 Jul 16 00:41  ../
lrwxrwxrwx 1 balter balter      0 Jul 16 07:50  Box
lrwxrwxrwx 1 balter balter     12 Jun 10 15:55 'Documents and Settings'
drwxrwxrwx 1 balter balter   4096 Jun 10 16:09  Intel/
drwxrwxrwx 1 balter balter   4096 Jul 16 07:38  OneDriveTemp/
d--x--x--x 1 balter balter   4096 Mar 18 21:52  PerfLogs/
(base) balter@spectre:/mnt/c$ ls Box
ls: cannot access 'Box': Input/output error
(base) balter@spectre:/mnt/c$ cd Box
bash: cd: Box: Input/output error
(base) balter@spectre:/mnt/c$ ls /mnt
box  c
(base) balter@spectre:/mnt/c$ sudo mount -t drvfs Box /mnt/box
[sudo] password for balter:
mount: /mnt/box: wrong fs type, bad option, bad superblock on Box, missing codepage or helper program, or other error.
<3>init: (14092) ERROR: UtilCreateProcessAndWait:360: /bin/mount failed with status 0x2000
No error information

The Box folder is actually located in ...\AppData\Local\Box\Box, but there aren't files there. It's a sort of database. I have no idea what method they are using to create the volume that appears in my C drive.

You could kick me back to Box on this one, but they have steadfastly refused to support linux of any kind. So perhaps if Windows folks know what kind of drive protocol they are using, there might be a way to map it from WSL.

  • Strace of the failing command, if applicable: (If some_command is failing, then run strace -o some_command.strace -f some_command some_args, and link the contents of some_command.strace in a gist here).

  • For WSL launch issues, please collect detailed logs.

See our contributing instructions for assistance.

@therealkenc
Copy link
Collaborator

[Version 10.0.18362.239]

Not familiar with BoxDrive, but from your symptoms this is basically same #1954 #2163 #2999 #2896 #1962, others. De facto by design, because WSL does not (and practically speaking cannot) support all third-party installable filesystems.

You can try WSL2 and see if that fares any better, as it uses a different mechanism in the WSL->Windows direction.

You could kick me back to Box on this one, but they have steadfastly refused to support linux of any kind.

BoxDrive wouldn't be supporting 'Linux' in your specific scenario, which is WSL1. WSL1 is really Windows. The problem (if that's the word) is WSL1 is expecting more from their Windows implementation of their filesystem (contrast a Real Linux user asking for Real Linux support). But, a practical matter, yeah, they aren't likely to look into their Windows driver either unless they are seeing a mad rush of WSL1 users asking. And they aren't, so moot. There is also fading hope WSL1 will get improved support for third-party IFS on WSL1 because efforts have shifted to WSL2.

But don't lose all hope on this one. Give WSL2 on Insiders a try when you can (or wait until 20H1). It might work. If it doesn't work, posting the update will keep your submission alive.

@abalter
Copy link
Author

abalter commented Jul 22, 2019

Hi @therealkenc -- I'm pretty sure I am using WSL2. I'm not 100% sure because some things like easy file access between windows, auto-launching VS Code, and file system speed don't seem to match up. However, I do get:

(base) balter@spectre:~$ mount
rootfs on / type wslfs (rw,noatime)

So I might be in some sort fo grey area if that's possible.

@therealkenc
Copy link
Collaborator

So I might be in some sort fo grey area if that's possible.

That's one way to put it. :)

You are on 10.0.18362.239. WSL2 didn't become available until 18917. So, you're on WSL1.

That said, you're not wrong about that wslfs returned by mount (the WSL->Windows direction). What changed there, exactly, vs WSL1 drvfs has never been explained. The WSL2 speed up is on /home not /mnt/c. The "easy file access" from Windows part is the other direction (Windows->WSL), and is available in WSL1. There's a lot of moving parts, so it can be confusing.

n.b. I don't know that BoxDrive will work on WSL2 because I haven't tried. And looking at your Permission denied again, it might not. That might (sic) be variation #4104 (and/or #2779). The Box/ directory you tried to cd into is a symlink, and there are still wslfs rough patches on WSL2. The good news is, if the problem is #4104, it has a better than snowball's chance of being addressed.

And, on WSL2 you have the option of using Real Linux mount -t cifs and share the drive that way, at least while the WSL2 wslfs improves. So there's that.

@abalter
Copy link
Author

abalter commented Jul 22, 2019

The two things that clued me in are

  1. If I create "test.txt" in my rootfs/home/balter directory from windows, it does not show up as it should in WSL
  2. I use conda which has a deep and voluminous file structure. It should be much faster in WSL2, but I have not seen that. Also things like deleting folders with lots of files.

I thought WSL2 was available after the May 1903 update, but I guess not.

When will it be available for me?

@abalter
Copy link
Author

abalter commented Jul 22, 2019

Incidentally:

C:\Windows\System32>ver

Microsoft Windows [Version 10.0.18362.239]

@therealkenc
Copy link
Collaborator

20H1 (first half of 2020). Some time around Spring of 2020. But you can try WSL2 out now on Insiders.

@abalter
Copy link
Author

abalter commented Jul 22, 2019

Yup. I think I'll do that. But need to get to a stopping point with work first in case it explodes!

Thanks!

@samuelefiorini
Copy link

Hi, I'm still experiencing the same issue. Did something change in the meantime?

@darkrain42
Copy link

At least with WSL2, I was able to mount the Box Drive by specifying the DOS path as the source for the drvfs mount (sudo mount -t drvfs 'C:\users\darkrain\box' /mnt/box)

$ cd /mnt/c/users/darkrain/box
cd: Input/output error: /mnt/c/users/darkrain/box
$ # :(
$ sudo mkdir /mnt/box
$ sudo mount -t drvfs /mnt/c/users/darkrain/box /mnt/box
mount: /mnt/box: special device /mnt/c/users/darkrain/box does not exist.
<3>init: (5883) ERROR: UtilCreateProcessAndWait:489: /bin/mount failed with status 0x2000
<3>init: (5883) ERROR: MountPlan9:478: mount cache=mmap,rw,trans=fd,rfdno=3,wfdno=3,msize=65536,aname=drvfs;path=/mnt/c/users/darkrain/box;symlinkroot=/mnt/ failed 2
No such file or directory
$ sudo mount -t drvfs 'C:\users\darkrain\box' /mnt/box
$ cd /mnt/box
$ ls
total 1837
drwxrwxrwx 1 root root     512 Jan  1  1980  ./
drwxr-xr-x 6 root root    4096 Feb 10 10:30  ../
-r-xr-xr-x 1 root root      62 Feb  8 06:06  desktop.ini*
...
$

@kdl0013
Copy link

kdl0013 commented Mar 5, 2021

@darkrain42 You are an absolute genius, thank you! I noticed that when my computer restarted, it un-mounted the drive. But it was as simple as re-running sudo mount -t drvfs 'C:\users\darkrain\box' /mnt/box again and it re-mounted.

@rturba
Copy link

rturba commented Apr 12, 2021

It used to work for me, but for some reason now I'm getting the following error:

sudo mount -t drvfs 'C:\Users\rturba\Box' /mnt/c/Users/rturb/Box
mount: C:\Users\rturb\Box: can't read superblock
<3>init: (52) ERROR: UtilCreateProcessAndWait:489: /bin/mount failed with status 0x2000
No error information

does anyone have an idea of what that means to point me in the right direction? :(

UPDATE: If I change the /mnt/c/Users/rturb/box to just /mnt/box it works. So for some reason it does not like the other path, even though the Box folder is listed there.

@norahvii
Copy link

@darkrain42 You are an absolute genius, thank you! I noticed that when my computer restarted, it un-mounted the drive. But it was as simple as re-running sudo mount -t drvfs 'C:\users\darkrain\box' /mnt/box again and it re-mounted.

To work around this you can add: sudo mount -t drvfs 'C:\Users\username\box' /mnt/box to your ~/.bashrc file.

You will be prompted for your linux password each time you log in though.

@darkrain42
Copy link

darkrain42 commented Sep 17, 2022

To work around this you can add: sudo mount -t drvfs 'C:\Users\username\box' /mnt/box to your ~/.bashrc file.

You will be prompted for your linux password each time you log in though.

Mostly untested, but put something like this in your ~/.bashrc

if ! findmnt -M /mnt/box &>/dev/null; then
    sudo mount -t drvfs 'C:\users\username\box' /mnt/box
fi

And put this in /etc/sudoers.d/box (sudo visudo -f /etc/sudoers.d/box)

# Allow mounting at startup without password
%sudo    ALL=(root) NOPASSWD: mount -t drvfs C\:\\\\users\\\\username\\\\box /mnt/box

The local user must be in the sudoers group. And the sudoers file escaping is a bit, erm, non-obvious.

@norahvii
Copy link

@darkrain42
Sorry to ask but how does one add a local user to a the sudoers group?

I messed this up (produced a no valid sudoers sources found) error but fortunately was able to remove the problematic box file by typing wsl -u root in powershell.

@darkrain42
Copy link

@darkrain42 Sorry to ask but how does one add a local user to a the sudoers group?

If you can already run "sudo ...", you're probably already in the "sudo" (sudoers) group. You can run groups to see what groups you're in.

On Debian/Ubuntu, otherwise, to add a user to a group, adduser <username> <group>, e.g. adduser username sudo. On other distros/more portably something such as usermod -a -G <groupname> <username>. (It gets complicated quickly, though, because the "sudoers" group is named "sudo" on Debian/Ubuntu, but named "wheel" in RHEL/CentOS. You should probably search online for docs specific to your distro.)

I messed this up (produced a no valid sudoers sources found) error but fortunately was able to remove the problematic box file by typing wsl -u root in powershell.

Yeah, that's a hazard of editing the sudo files (and why I suggested editing it via visudo, which attempts to prevent the user from locking themself out). It happens, though!

@affert
Copy link

affert commented Apr 14, 2023

I had this problem, and was able to fix it using sudo mount -t drvfs 'C:\Users\username\box' /mnt/box

Once that is done, the folders are mounted -rwxr-xr-x 1 root root meaning they aren't readable. Weirdly, that is also the case for the Box folder, when I look at the permissions via Windows Exploer, but the files are listed as -a---- if I pull them up in PowerShell.

Once I added -o uid=1000,gid=1000 to the mount command, I had the access I expected.

So to future people here like I was, give that a try:

sudo mount -t drvfs 'C:\Users\username\Box' /mnt/box -o uid=1000,gid=1000

NOTE: bashrc isn't processed in time if you use the context menu to "Open Linux shell here". You can get around this by having WSL run as soon as you log in, and keep running. See https://medium.com/swlh/how-to-run-ubuntu-in-wsl2-at-startup-on-windows-10-c4567d6c48f1
for details.

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants