Mounting cloud storage
AWS S3 bucket as filesystem
Ubuntu 20.04
Mount
-
Install s3fs:
-
Enter your credentials in a file
${HOME}/.passwd-s3fs
and set owner-only permissions: -
Uncomment
user_allow_other
in the/etc/fuse.conf
file:sudo nano /etc/fuse.conf
-
Run s3fs, replace
bucket_name
,mount_point
:
For more details see here.
Automatically mount
Follow the first 3 mounting steps above.
Using fstab
-
Create a bash script named aws_s3_fuse(e.g in /usr/bin, as root) with this content (replace
user_name
on whose behalf the disk will be mounted,backet_name
,mount_point
,/path/to/.passwd-s3fs
): -
Give it the execution permission:
-
Edit
/etc/fstab
adding a line like this, replacemount_point
):
Using systemd
-
Create unit file
sudo nano /etc/systemd/system/s3fs.service
(replaceuser_name
,bucket_name
,mount_point
,/path/to/.passwd-s3fs
): -
Update the system configurations, enable unit autorun when the system boots, mount the bucket:
Check
A file /etc/mtab
contains records of currently mounted filesystems.
Unmount filesystem
If you used systemd to mount a bucket:
Microsoft Azure container as filesystem
Ubuntu 20.04
Mount
-
Set up the Microsoft package repository.(More here)
-
Install
blobfuse
andfuse
:For more details see here
-
Create environments (replace
account_name
,account_key
,mount_point
): -
Create a folder for cache:
-
Make sure the file must be owned by the user who mounts the container:
-
Create the mount point, if it doesn’t exists:
-
Uncomment
user_allow_other
in the/etc/fuse.conf
file:sudo nano /etc/fuse.conf
-
Mount container(replace
your_container
):
Automatically mount
Follow the first 7 mounting steps above.
Using fstab
-
Create configuration file
connection.cfg
with same content, change accountName, select one from accountKey or sasToken and replace with your value: -
Create a bash script named
azure_fuse
(e.g in /usr/bin, as root) with content below (replaceuser_name
on whose behalf the disk will be mounted,mount_point
,/path/to/blobfusetmp
,/path/to/connection.cfg
): -
Give it the execution permission:
-
Edit
/etc/fstab
with the blobfuse script. Add the following line(replace paths):
Using systemd
-
Create unit file
sudo nano /etc/systemd/system/blobfuse.service
. (replaceuser_name
,mount_point
,container_name
,/path/to/connection.cfg
): -
Update the system configurations, enable unit autorun when the system boots, mount the container:
Or for more detail see here
Check
A file /etc/mtab
contains records of currently mounted filesystems.
Unmount filesystem
If you used systemd to mount a container:
If you have any mounting problems, check out the answers to common problems
Google Drive as filesystem
Ubuntu 20.04
Mount
To mount a google drive as a filesystem in user space(FUSE) you can use google-drive-ocamlfuse To do this follow the instructions below:
-
Install google-drive-ocamlfuse:
-
Run
google-drive-ocamlfuse
without parameters:This command will create the default application directory (~/.gdfuse/default), containing the configuration file config (see the wiki page for more details about configuration). And it will start a web browser to obtain authorization to access your Google Drive. This will let you modify default configuration before mounting the filesystem.
Then you can choose a local directory to mount your Google Drive (e.g.: ~/GoogleDrive).
-
Create the mount point, if it doesn’t exist(replace mount_point):
-
Uncomment
user_allow_other
in the/etc/fuse.conf
file:sudo nano /etc/fuse.conf
-
Mount the filesystem:
Automatically mount
Follow the first 4 mounting steps above.
Using fstab
-
Create a bash script named gdfuse(e.g in /usr/bin, as root) with this content (replace
user_name
on whose behalf the disk will be mounted,label
,mount_point
): -
Give it the execution permission:
-
Edit
/etc/fstab
adding a line like this, replacemount_point
):For more details see here
Using systemd
-
Create unit file
sudo nano /etc/systemd/system/google-drive-ocamlfuse.service
. (replaceuser_name
,label
(defaultlabel=default
),mount_point
): -
Update the system configurations, enable unit autorun when the system boots, mount the drive:
For more details see here
Check
A file /etc/mtab
contains records of currently mounted filesystems.
Unmount filesystem
If you used systemd to mount a drive: