Skip to content

Instantly share code, notes, and snippets.

@wakwanza
Created April 5, 2015 12:16
Show Gist options
  • Save wakwanza/19c695ccf2360e4a9550 to your computer and use it in GitHub Desktop.
Save wakwanza/19c695ccf2360e4a9550 to your computer and use it in GitHub Desktop.
Mount and format disk on Google Compute Engine
#!/bin/bash
# Mount and format the disks
sudo mkdir -p /data
sudo yum install xfsprogs -y
sudo /usr/share/google/safe_format_and_mount -m "mkfs.xfs -isize=512" /dev/sdb /data
sudo echo "Mount persists"
sudo sh -c "echo \"/dev/sdb /data xfs noatime,data=writeback,errors=remount-ro 0 1\" >> /etc/fstab"
sudo echo "fstab done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment