Skip to content

Instantly share code, notes, and snippets.

@amcginlay
Last active November 13, 2020 17:51
Show Gist options
  • Save amcginlay/1b7736aec224a372b9b74f9b59d7dbe3 to your computer and use it in GitHub Desktop.
Save amcginlay/1b7736aec224a372b9b74f9b59d7dbe3 to your computer and use it in GitHub Desktop.
Mounting A Linux Disk Device (EBS)
sudo su - # operation requires root privileges
lsblk # to see devices and mounts, MOUNTPOINT is empty for the new device
NEW_DEVICE=xvdf # change as appropriate
# to mount a new device
file -s /dev/${NEW_DEVICE} # will display "data" if no file system is present
mkfs -t ext4 /dev/${NEW_DEVICE} # will install ext4 on device
mkdir /filesystem
mount /dev/${NEW_DEVICE} /filesystem
# to unmount the device
umount -d /dev/${NEW_DEVICE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment