Skip to content

Instantly share code, notes, and snippets.

@mandeepbal
Last active August 29, 2015 14:21
Show Gist options
  • Save mandeepbal/a7bba53fe0ef743a4847 to your computer and use it in GitHub Desktop.
Save mandeepbal/a7bba53fe0ef743a4847 to your computer and use it in GitHub Desktop.
Add storage mount to RHEL or CENTOS
##RHEL:
fdisk -l
df -alh
mkfs -t ext4 /dev/sdb
mkdir /services
mount /dev/sdb /services
df -alh
echo "/dev/sdb /services ext4 defaults 0 0" | sudo tee -a /etc/fstab
##CENTOS
fdisk -l
df -alh
mkfs -t ext3 /dev/xvdf
rmdir /opt
mkdir /opt
mount /dev/xvdf /opt
df -alh
echo "/dev/xvdf /opt ext3 defaults 0 0" | sudo tee -a /etc/fstab
##RHEL:
#!/bin/bash
mkfs -t ext4 /dev/xvdb
mkdir /data
mount /dev/xvdb /data
echo "/dev/xvdb /data ext4 defaults 0 0" | sudo tee -a /etc/fstab
rm -rf /data/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment