I created an AWS m3.large instance. It comes with a single 32GB SSD. During the creation process, I added a second drive for the system. I picked the second drive for the system: xvda1 and the original 30GB drive, I loaded as xvdb.
When the instance started, I logged on as ubuntu and did the following:
fdisk /dev/xvdb
#created two partitions
mkfs -t ext4 /dev/xvdb1
tune2fs -m 0 /dev/xvdb1
mkfs -t ext4 /dev/xvdb2
tune2fs -m 0 /dev/xvdb2
mkdir /swap
mkdir /home/railsapp/tmp
mount /dev/xvdb1 /swap
mount /dev/xvdb2 /home/railsapp/tmp
#create a swap file:
sudo fallocate -l 19000000000 /swap/swapfile
sudo chmod 600 /swap/swapfile
sudo mkswap /swap/swapfile
sudo swapon /swap/swapfile
I then verified that swap was on with:
sudo swapon -s
I then removed the entry for /dev/xvdb and added the following:
/dev/xvdb1 /swap ext4 defaults 0 2
/dev/xvdb2 /home/installio/tmp ext4 defaults 0 2
/swap/swapfile none swap sw 0 0
I then stopped the instance and restarted it. I cannot reconnect. The message I'm getting from the system log is:
The disk drive for /swap is not ready yet or not present.
What am I doing wrong?