# Cannot Boot EC2 Instance



## dave (Oct 28, 2012)

Hi,

I am trying to boot an EC2 instance (Xen) that has a storage drive.  For some reason the storage drive is not recognized on boot (even though it is attached), and the system won't progress past single user mode...

/etc/fstab

```
# Root device
/dev/ad0a / ufs rw 1 1
# List swap partitions here if you enable them in rc.conf
# /dev/xbd1s1 none swap sw 0 0
# /dev/xbd2s1 none swap sw 0 0
# /dev/xbd3s1 none swap sw 0 0
# /dev/xbd4s1 none swap sw 0 0
/dev/xbd5 /ebs ufs rw 2 2
```

Here is what the EC2 system log says.

```
...
...
Starting file system checks:
/dev/ad0a: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ad0a: clean, 2003146 free (21490 frags, 247707 blocks, 0.4% fragmentation)
Can't stat /dev/xbd5: No such file or directory
Can't stat /dev/xbd5: No such file or directory
THE FOLLOWING FILE SYSTEM HAD AN UNEXPECTED INCONSISTENCY:
	ufs: /dev/xbd5 (/ebs)
Unknown error; help!
ERROR: ABORTING BOOT (sending SIGTERM to parent)!
Oct 27 20:18:01 init: /bin/sh on /etc/rc terminated abnormally, going to single user mode

Enter full pathname of shell or RETURN for /bin/sh:
```

Any help would be appreciated.

Thanks.


----------



## SirDice (Oct 29, 2012)

Remove the line with /dev/xbd5 in /etc/fstab, it doesn't exist.


----------



## dave (Dec 3, 2012)

Yes, yes of course I realize that.  I guess my question is - does the EBS drive not auto attach on a reboot?  Do I have to manually attach it and mount it each time I start/reboot the instance, or am I missing something?  I should be enumerated on startup, and thus be available for mounting via /etc/fstab, no?


----------



## dave (Dec 12, 2012)

... because if I can't reliably boot a machine with a storage drive attached then...?

... anyone?


----------



## dave (Dec 19, 2012)

Anyone... on whether it's possible to automatically mount an ebs device on startup in the EC2?


----------



## SirDice (Dec 19, 2012)

It sounds like something somebody from Amazon support would be able to answer.


----------



## vand777 (Dec 25, 2012)

dave said:
			
		

> Anyone... on whether it's possible to automatically mount an ebs device on startup in the EC2?



I managed to connect a new EBS volume to my FreeBSD 9.1 instance running on Windows instance.

As far as I remember, my steps were:

(1) Start the instance.

(2) Create a new EBS volume and connect it to the instance.

(3) Check /var/log/messages. The following line appeared in my log:

```
Dec 10 17:14:31 ip-10-0-3-100 kernel: [color="Red"]xbd5[/color]: 51200MB <Virtual Block Device> at device/vbd/51792 on xenbusb_front0
```

(4) Construct a new file system and mount the volume.


```
# newfs /dev/xbd5
# mkdir /usr/jails
# mount /dev/xbd5 /usr/jails
```

(5) Add the following line to /etc/fstab:


```
/dev/xbd5 /usr/jails        ufs rw 0 2
```

(6) Reboot to check whether it works...

It did work for me.


----------



## vand777 (Dec 25, 2012)

Maybe you didn't connect your new EBS volume to your instance?


----------



## vand777 (Jan 13, 2013)

Did you solve the issue?


----------



## dave (Jan 13, 2013)

No.  I have removed the line from /etc/fstab, and if/when I cycle that machine, I will have to manually mount the storage and then bring up the services.


----------



## vand777 (Jan 20, 2013)

Strange... I have few machines with the auto-attached EBS volumes. Haven't had any problem with them.


----------



## dave (Jan 20, 2013)

vand777 said:
			
		

> Maybe you didn't connect your new EBS volume to your instance?



Yes, I connected it.


----------



## dave (Jan 20, 2013)

As a follow-up, I needed to expand the storage for that instance.  So, in the process, I have now switched to ZFS for storage on that instance, and when I reboot it automatically mounts the storage no problem now.

I created 3 separate 15GB volumes, attached them, labelled them, and set up ZFS in the usual way, as a raidz array.  Now I have more storage, it's easily expandable, and lots of features such as snapshots!


----------

