• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

mount

GCP CVS Mount Instructions

January 28, 2022

Here are the mount instructions for NFS and SMB drives for GCP Netapp CVS.

NFS

sudo yum install -y nfs-utils
sudo apt-get install nfs-common
sudo mkdir /condescending-sharp-hugle
sudo mount -t nfs -o rw,hard,rsize=65536,wsize=65536,vers=3,tcp 10.49.253.6:/condescending-sharp-hugle /condescending-sharp-hugle

sudo yum install -y nfs-utils sudo apt-get install nfs-common sudo mkdir /condescending-sharp-hugle sudo mount -t nfs -o rw,hard,rsize=65536,wsize=65536,vers=3,tcp 10.49.253.6:/condescending-sharp-hugle /condescending-sharp-hugle

SMB

Mapping your network drive
1. Click the Start button and then click on Computer.
2. Click Map Network Drive.
3. In the Drive list, click any available drive letter.
4. In the folder box, type \\shared.mydomain.com\myshare.
To connect every time you log on to your computer, select the Reconnect at sign-in check box.
\\shared.mydomain.com\myshare
5. Click Finish.

Mapping your network drive 1. Click the Start button and then click on Computer. 2. Click Map Network Drive. 3. In the Drive list, click any available drive letter. 4. In the folder box, type \\shared.mydomain.com\myshare. To connect every time you log on to your computer, select the Reconnect at sign-in check box. \\shared.mydomain.com\myshare 5. Click Finish.

Filed Under: Cloud, Linux Tagged With: cvs, gcp, instructions, mount, netapp, nfs, smb

GCS Fuse

December 21, 2021

GCS Fuse allows you to mount a Google bucket as a file system. It’s similar to S3FS.

Setup repo

sudo tee /etc/yum.repos.d/gcsfuse.repo > /dev/null <<EOF
[gcsfuse]
name=gcsfuse (packages.cloud.google.com)
baseurl=https://packages.cloud.google.com/yum/repos/gcsfuse-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
       https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF

sudo tee /etc/yum.repos.d/gcsfuse.repo > /dev/null <<EOF [gcsfuse] name=gcsfuse (packages.cloud.google.com) baseurl=https://packages.cloud.google.com/yum/repos/gcsfuse-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=0 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg EOF

Yum install

sudo yum install gcsfuse

sudo yum install gcsfuse

Login to GCP and mount. Run as a user and not root.

gcloud auth login
gcsfuse my-bucket /path/to/mount

gcloud auth login gcsfuse my-bucket /path/to/mount

Unmount

fusermount -u /path/to/mount

fusermount -u /path/to/mount

Filed Under: Cloud, Linux Tagged With: bucket, fuse, gcp, gcs, mount, s3fs, umount

S3FS

May 6, 2021

s3fs allows Linux to mount S3 buckets as a file system.

Install s3fs.

sudo apt install s3fs

sudo apt install s3fs

Setup credentials.

echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > /etc/.passwd-s3fs
chmod 600 ${HOME}/.passwd-s3fs

echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > /etc/.passwd-s3fs chmod 600 ${HOME}/.passwd-s3fs

Mount it.

s3fs bucketname /mountpoint -o passwd_file=/etc/.passwd-s3fs

s3fs bucketname /mountpoint -o passwd_file=/etc/.passwd-s3fs

Mount it automatically.

bucketname /mountpoint fuse.s3fs _netdev,allow_other,passwd_file=/etc/.passwd-s3fs,rw,uid=1000,gid=1000 0 0

bucketname /mountpoint fuse.s3fs _netdev,allow_other,passwd_file=/etc/.passwd-s3fs,rw,uid=1000,gid=1000 0 0

Alternative.

s3fs#bucketname /mountpoint fuse _netdev,allow_other,use_cache=/root/cache,uid=1000,gid=1000,umask=022 0 0

s3fs#bucketname /mountpoint fuse _netdev,allow_other,use_cache=/root/cache,uid=1000,gid=1000,umask=022 0 0

Filed Under: Cloud Tagged With: bucket, file system, mount, s3, s3fs

Mounting Duplicate UUIDs

January 12, 2021

While trying to recover a directory from backup, I ran into an issue with duplicate uuids when trying to mount a recovered volume. The problem was the recovered volume had the same uuid as boot.

Here’s the original mount command I ran, but I was getting a wrong fs type error.

mkdir
mount -t xfs /dev/nvme3n1p2 /recover
mount: wrong fs type, bad option, bad superblock on /dev/nvme3n1p2,
       missing codepage or helper program, or other error

mkdir mount -t xfs /dev/nvme3n1p2 /recover mount: wrong fs type, bad option, bad superblock on /dev/nvme3n1p2, missing codepage or helper program, or other error

It turned out to be a duplicated uuid. To get around this problem, I ran -o nouuid.

mount -t xfs -o nouuid /dev/nvme3n1p2 /recover

mount -t xfs -o nouuid /dev/nvme3n1p2 /recover

Once the files were recovered, I unmounted volume and detached it from the instance.

Filed Under: Linux Tagged With: duplicate, mount, uuid

Linux Format USB Drive

July 9, 2020

Here’s how to format a USB drive on Linux.

Plug in the USB drive to see mount point.

# scan for all drives
df -Th
Filesystem     Type     Size  Used Avail Use% Mounted on
/dev/sdc1      fuseblk   30G   66M   30G   1% /media/ulysses/451B99AF225B48EC

# scan for all drives df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sdc1 fuseblk 30G 66M 30G 1% /media/ulysses/451B99AF225B48EC

Unmount USB drive.

umount /dev/sdc1

umount /dev/sdc1

Choose a file system type and run the appropriate format command.

# nfts format
mkfs.ntfs /dev/sdc1
# vfat format
mkfs.vfat /dev/sdc1
# ext4 format
mkfs.ext4 /dev/sdc1

# nfts format mkfs.ntfs /dev/sdc1 # vfat format mkfs.vfat /dev/sdc1 # ext4 format mkfs.ext4 /dev/sdc1

Filed Under: Linux Tagged With: 3.0, command line, format, mount, terminal, usb

AWS XFS Volume Setup

March 31, 2020

Here’s how to setup a XFS volume.

file -s /dev/nvme2n1
mkfs -t xfs /dev/nvme2n1

file -s /dev/nvme2n1 mkfs -t xfs /dev/nvme2n1

Mount to /data.

mkdir /data
mount /dev/nvme2n1 /data

mkdir /data mount /dev/nvme2n1 /data

Add to /etc/fstab.

vim /etc/fstab
#
#
UUID=xxxxxxxxxxxxxxxxxxxxxx /data  xfs  defaults 0 0

vim /etc/fstab # # UUID=xxxxxxxxxxxxxxxxxxxxxx /data xfs defaults 0 0

Filed Under: Cloud, Linux Tagged With: aws, fstab, mount, nvme, volumes, xfs

AWS EFS /etc/fstab

December 23, 2019

To automatically mount a EFS volume after each reboot, you’ll need to add the following format to /etc/fstab.

You can use the DNS name given by AWS.

fs-12345678:/ /mnt/efs efs defaults,_netdev 0 0

fs-12345678:/ /mnt/efs efs defaults,_netdev 0 0

Or the IP address.

10.0.0.22:/ /mnt/efs efs defaults,_netdev 0 0

10.0.0.22:/ /mnt/efs efs defaults,_netdev 0 0

Mount all with fake and verbose.

mount -fav

mount -fav

Filed Under: Cloud Tagged With: automatic, aws, efs, fstab, mount, reboot

AWS EFS Describe Mount Targets

November 4, 2019

Here’s how to display mount targets of an EFS system via AWS CLI.

 aws efs describe-mount-targets \
--file-system-id fs-xxxxxxxx \
--profile default \
--region us-east-1

aws efs describe-mount-targets \ --file-system-id fs-xxxxxxxx \ --profile default \ --region us-east-1

Filed Under: Cloud Tagged With: aws, describe, efs, mount, targets

  • Go to page 1
  • Go to page 2
  • Go to Next Page »
  • Home
  • About
  • Archives

Copyright © 2023