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?

| improve this question | | | | |

Looks like you forgot to actually create a swap filesystem via:

$ mkswap /swap/swapfile
| improve this answer | | | | |
  • No. I did, I inadvertently forgot to copy it. Please see my edits. I just tried it again with the same results. Maybe this is not possible if I'm using the drive that came with the system, as in if I have to subdivide it, AWS will not like it – coyotepoint Apr 24 '15 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.