Skip to content

Instantly share code, notes, and snippets.

@jay-lannister
Created November 8, 2014 04:55
Show Gist options
  • Save jay-lannister/c18d1c8ba5369122866c to your computer and use it in GitHub Desktop.
Save jay-lannister/c18d1c8ba5369122866c to your computer and use it in GitHub Desktop.
Linux partition management on AWS
fdisk -l
# CentOS 6 uses ext4 as a default filesystem
mkfs.ext4 /dev/xvdj
# CentOS 7 uses xfs as a default filesystem
mkfs.xfs /dev/xvdj
vim /etc/fstab
# /dev/xvdj /root/sonatype-work ext4 defaults,acl 0 0
# references
# [Resizing Root Partition on Linux in Amazon EC2](https://linuxacademy.com/blog/linux/resizing-root-partition-on-linux-in-amazon-ec2/)
# 1. create a snapshot of the old hdd
# 2. create a new volume which has a more storage than the old one from the snapshot
# 3. check the new partition name you want to expand by running
lsblk
# 4. expand the hdd on the fly
resize2fs /dev/xvde
# When you are getting an error message from Nagios Disk Check plugin like:
# DISK CRITICAL - /root/sonatype-work is not accessible: Permission denied
vim /etc/fstab
# check if `acl` option is appended or not just like:
# /dev/xvdj /root/sonatype-work ext4 defaults,acl 0 0
# add `acl`and remount the device
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment