3

I'm trying to access my Windows files from Ubuntu, and so far I was able to create a script that mounts the folder I want and have it on the system startup. I am able to list, delete, move, create files, but I'm not able to open them with VLC I get the error:

Your input can't be opened:

VLC is unable to open the MRL 'file:///home/tiago/Windows/Videos/Filmes/x-subterranea-720p.mkv'. Check the log for details.

Can someone help me identify what I'm doing wrong?

This is my Bash script:

!/bin/bash
sudo -S -k mount -t ntfs-3g -o rw /dev/sda3 /root/win
sudo -S -k mount --bind /root/win/Users/Tiago/ /home/tiago/Windows

One of the files I can't open:

root@tiago-X510UR:/home/tiago/Windows/Videos/Filmes# ls -l  ex-subterranea-720p.mkv
-rwxrwxrwx 2 root root 4693513161 set 23  2017 ex-subterranea-720p.mkv
  • What do you mean by 'open'? I would say that when you can view a file, you can open it (with the viewer). Are there problems only with multimedia files? In that case maybe you need to install the package ubuntu-restricted-extras. – sudodus Oct 15 '18 at 17:51
  • VLC can't load the file. I get an error. If I copy the file to the local system folder I can open it with no problems – Tiago VICENTAO Oct 15 '18 at 18:00
  • There might be a problem with ownership (of /root/win or /home/tiago/Windows or some subdirectory), so that VLC is not allowed to see the file. Please notice, that you should not run VLC with elevated permissions, so the file should be visible by the regular user ID (I guess it is 'tiago'). – sudodus Oct 15 '18 at 18:29
  • Maybe the following link can help you mount the Windows partition with suitable options, Mount NTFS partition in a USB drive with custom permissions and owner – sudodus Oct 15 '18 at 18:33
  • i thought that by giving rwx to others would allow anyone to be able to open the file. vlc included – Tiago VICENTAO Oct 15 '18 at 19:42
  • Yes, but some directory in the path might not have enough permissions. I tested with an NTFS file system in a USB pendrive and could make the difference depending on the ownership of the mountpoint. So I suggest that you try after changing ownership. – sudodus Oct 16 '18 at 04:42
  • Thanks! I'm a real noob this is my first time doing this. I read the thread you sent but I was not able to understand the ownership part. Can you please help me on how I can change the ownership and what should I change it to? – Tiago VICENTAO Oct 17 '18 at 13:06
  • I'll try, see the answer. Please ask for more details, if you need :-) – sudodus Oct 17 '18 at 16:58

1 Answers1

1

I will copy and paste from my previous AskUbuntu answer but skip some details, ...

  • Unmount the NTFS partition ...

  • Create a custom mountpoint ...

  • Check your userID's uid number ...

Mount the NTFS partition

Example 1 (without execute permissions for files, no access for 'others'),

sudo mount -o rw,user,uid=1000,dmask=007,fmask=117 /dev/sdxn /mnt/sd1  # general syntax
sudo mount -o rw,user,uid=1000,dmask=007,fmask=117 /dev/sdb1 /mnt/sd1  # modify to match your case

This way I think the files and directories in the Windows partition (which I assume has an NTFS file system) should be readable (and writable) by the main user ID, with the number 1000 (and I guess the name 'tiago'). Modify if there is another user ID.

dmask is the mask for directories and fmask is the mask for files. These should be the octal inverse of the permissions that you want (770 and 660).

Check also that you point to the correct device (modify /dev/sdb1 if necessary).

See man mount if you want more details about the mount options.


When this works (maybe after some modifications), you can put the commands into a file (make a bash shellscript), make it executable and run the shellscript in order to mount the Windows partition in a convenient way.

sudodus
  • 46,324
  • 5
  • 88
  • 152