0

I'm having problems with gcsfuse but I'm also having basic permission problems which makes this question relevant to this forum. I have already SSH'ed into a google cloud remote virtual machine instance. I have no problems with making a directory and mounting a storage bucket to the mount point. But after that's done I cannot get into the directory and list the files. The directory in question is temp_dir3 In this series of command I tried changing ownership but the system got stuck and I had to hit control c

kylefoley@kfoley76:/mnt/disks$ sudo chmod o+rx -R /mnt/disks/temp_dir3
kylefoley@kfoley76:/mnt/disks$ cd temp_dir3
kylefoley@kfoley76:/mnt/disks/temp_dir3$ cd ..
kylefoley@kfoley76:/mnt/disks$ sudo gcsfuse deduction3 /mnt/disks/temp_dir3
Using mount point: /mnt/disks/temp_dir3
Opening GCS connection...
Opening bucket...
Mounting file system...
File system has been successfully mounted.
kylefoley@kfoley76:/mnt/disks$ cd temp_dir3
-bash: cd: temp_dir3: Permission denied
kylefoley@kfoley76:/mnt/disks$ sudo chmod o+rx -R /mnt/disks/temp_dir3

^C

In this series I thought that maybe temp_dir3 got stuck because the files were too large. After all they do take up about 200 gigs. So I made a new directory and mounted a smaller storage bucket. But that did not work either. I also tried temp_dir3 again, but that also did not work.

kylefoley@kfoley76:/mnt/disks$ sudo mkdir -p /mnt/disks/temp_dir4
kylefoley@kfoley76:/mnt/disks$ sudo gcsfuse deduction1 /mnt/disks/temp_dir4
Using mount point: /mnt/disks/temp_dir4
Opening GCS connection...
Opening bucket...
Mounting file system...
File system has been successfully mounted.
kylefoley@kfoley76:/mnt/disks$ cd temp_dir4
-bash: cd: temp_dir4: Permission denied
kylefoley@kfoley76:/mnt$ sudo chmod a+w /mnt/disks/temp_dir4
kylefoley@kfoley76:/mnt/disks$ cd temp_dir4
-bash: cd: temp_dir4: Permission denied
kylefoley@kfoley76:/mnt/disks$ sudo chmod o+rx -R /mnt/disks/temp_dir4
kylefoley@kfoley76:/mnt/disks$ cd temp_dir4
-bash: cd: temp_dir4: Permission denied
kylefoley@kfoley76:/mnt/disks$ sudo chmod a+w /mnt/disks/temp_dir4
kylefoley@kfoley76:/mnt/disks$ cd temp_dir4
-bash: cd: temp_dir4: Permission denied

Here are my stats on the temp_dir4 folder. I can only get the stats if I unmount the storage bucket

kylefoley@kfoley76:/mnt/disks$ stat /mnt/disks/temp_dir4
stat: cannot stat '/mnt/disks/temp_dir4': Permission denied
kylefoley@kfoley76:/mnt/disks$ stat /mnt/disks
  File: /mnt/disks
  Size: 4096        Blocks: 8          IO Block: 4096   directory
Device: 801h/2049d  Inode: 528485      Links: 6
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-01-29 04:11:23.616670923 +0000
Modify: 2020-01-29 04:11:20.780424372 +0000
Change: 2020-01-29 04:11:20.780424372 +0000
 Birth: -
kylefoley@kfoley76:/mnt/disks$ sudo umount /mnt/disks/temp_dir4
kylefoley@kfoley76:/mnt/disks$ cd temp_dir4
kylefoley@kfoley76:/mnt/disks/temp_dir4$ stat temp_dir4
stat: cannot stat 'temp_dir4': No such file or directory
kylefoley@kfoley76:/mnt/disks/temp_dir4$ stat /mnt/disks/temp_dir4
  File: /mnt/disks/temp_dir4
  Size: 4096        Blocks: 8          IO Block: 4096   directory
Device: 801h/2049d  Inode: 18055       Links: 2
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-01-29 04:11:58.379493620 +0000
Modify: 2020-01-29 04:11:20.780424372 +0000
Change: 2020-01-29 04:11:20.780424372 +0000
logic1976
  • 241
  • 1
  • 2
  • 8

1 Answers1

0

You have to work it using the "root" account user:

sudo -i

Now you have all of the permissions. When you finish

logout
zx485
  • 2,170
  • 11
  • 17
  • 24
xear
  • 32
  • 4
  • -1. In this particular case `sudo` is the problem in the first place. [The documentation of `gcsfuse`](https://github.com/GoogleCloudPlatform/gcsfuse/blob/master/docs/mounting.md) reads [emphasis mine]: *You should run `gcsfuse` as the user who will be using the file system, not as root. Similarly, the directory should be owned by that user. **Do not use `sudo` for either of the steps above or you will wind up with permissions issues.*** – Kamil Maciorowski Jan 29 '20 at 17:06
  • Note the OP accepted your answer and almost immediately posted [this other question](https://superuser.com/q/1521031/432690) which is practically a duplicate. IMO the underlying problem is the same. – Kamil Maciorowski Jan 29 '20 at 17:11
  • kamil, you will never had a problem with the permissions because yo have to know whats jobs was made with root user, and that only root's user can edit this, is just "common sense" – xear Jan 29 '20 at 23:38