Skip to content

Instantly share code, notes, and snippets.

@CarlosEspejo
Last active August 29, 2015 14:23
Show Gist options
  • Save CarlosEspejo/430be4ee5e121a3a6dc4 to your computer and use it in GitHub Desktop.
Save CarlosEspejo/430be4ee5e121a3a6dc4 to your computer and use it in GitHub Desktop.
fstab settings

Auto mounting drives on boot /etc/fstab

https://help.ubuntu.com/community/Fstab

helpful commands

sudo lsblk # list block devices
sudo blkid # Get block device UUID
sudo mount -a # will try to mount everything and throw errors if fstab is screwed up.

Setup new drive

sudo mkfs -t ext4 /dev/xvdf
sudo mkdir /mnt/my-data
sudo mount /dev/xvdf /mnt/my-data
sudo blkid /dev/xvdf # To get the uuid to use in fstab

Fstab File Configuration

[Device] [Mount Point] [File System Type] [Options] [Dump] [Pass]

  • dump is usually set to zero if your not using the dump command
  • Pass fsck scanning order on boot can be left as zero

examples

UUID="6d8ee36c-9252-400a-a92c-7df89d111b3f" /backup ext4 defaults 0 0 UUID="6d8ee36c-9252-400a-a92c-7df89d111b3f" /backup ext4 defaults,noatime,nodiratime 0 0 # For database drives

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment