Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Archives for fstab

March 31, 2020

AWS XFS Volume Setup

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

December 23, 2019

AWS EFS /etc/fstab

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

June 10, 2019

NFS Client

Services to check.

chkconfig nfs on
service rpcbind start
service nfs start
mount -a

chkconfig nfs on service rpcbind start service nfs start mount -a

If missing, install it.

yum install nfs-utils nfs-utils-lib

yum install nfs-utils nfs-utils-lib

Mount it.

mount -a
mount 192.168.1.200:/home /mnt/nfs/home

mount -a mount 192.168.1.200:/home /mnt/nfs/home

Add to /etc/fstab.

10.10.10.10:/home on /mnt/nfs/home type nfs (rw,noatime,nolock,bg,nfsvers=2,intr,tcp,actimeo=1800,addr=10.10.10.10)

10.10.10.10:/home on /mnt/nfs/home type nfs (rw,noatime,nolock,bg,nfsvers=2,intr,tcp,actimeo=1800,addr=10.10.10.10)

May 1, 2019

Add nofail

The /etc/fstab file allow volumes to be automatically mounted on bootup. Add nofail in your automated mounts to prevent instances from hanging on boot. Nofail makes the instance to boot even if there are errors with the mounted volume.

UUID=aebf131c-6957-451e-8d34-ec978d9581ae  /data  xfs  defaults,nofail  0  2

UUID=aebf131c-6957-451e-8d34-ec978d9581ae /data xfs defaults,nofail 0 2

March 7, 2019

Adding a XFS Volume

Add a disk volume via cloud console. Then perform the following commands:

# check the new block
lsblk
# format
fdisk /dev/sdc
# create file system
mkfs.xfs -f /dev/sdc1
# get uuid
blkid /dev/sdc1
# vi /etc/fstab
UUID="xxxxxxxxxxxxxxxxxxxxx" /mnt/directory xfs defaults 0 0
# mount
mount -a

# check the new block lsblk # format fdisk /dev/sdc # create file system mkfs.xfs -f /dev/sdc1 # get uuid blkid /dev/sdc1 # vi /etc/fstab UUID="xxxxxxxxxxxxxxxxxxxxx" /mnt/directory xfs defaults 0 0 # mount mount -a

  • Cloud
  • Linux
  • Git

Copyright © 2012–2021