1

I am facing a problem while trying to create a bundle of my instance storage server

Ubuntu 12.10

ec2-bundle-vol \
--user $EC2_USER \
--privatekey $EC2_PRIVATE_KEY \
--cert $EC2_CERT \
--arch x86_64 \
--exclude /mnt,/tmp,/var/tmp \
--destination /mnt/bundles/$BUNDLE_NAME/ \
--prefix $BUNDLE_NAME

Excluding: 
     /
     /proc
     /sys
     /sys/fs/fuse/connections
     /sys/kernel/debug
     /sys/kernel/security
     /dev
     /dev/pts
     /dev
     /media
     /mnt
     /proc
     /sys
     /etc/udev/rules.d/70-persistent-net.rules
     /etc/udev/rules.d/z25_persistent-net.rules
     /mnt
     /tmp
     /var/tmp
     /mnt/bundles/130309
     /mnt/img-mnt
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.0024517 s, 428 MB/s
mke2fs 1.42.5 (29-Jul-2012)
loop: can't delete device /dev/loop0: No such device or address
Bundling image file...
ERROR: can't convert Fixnum into String

Any ideas what can be wrong?

Thanks!

potomok
  • 1,249
  • 3
  • 12
  • 16

3 Answers3

0

The dev directory is the devices directory, so you shouldn't be able to take a copy, and loop0 is the loop-back connector which is usually a reference to another mounted file system.

I noticed on your exclusions line:

--exclude /mnt,/tmp,/var/tmp \

That you don't exclude /dev directly, but you do exclude /mnt so I'm guessing you don't want external file systems rolled into your image. But the /dev directory is mentioned twice in the output, have you tried excluding either /dev, /dev/loop0 or /dev/loop* explicitly in your command line parameters?

Chris Cooper
  • 4,982
  • 1
  • 17
  • 27
  • well i just downgraded my system to ubuntu 12.04 and everything started to work. the issue was not related exactly to loop0, i think it was something to do with ami packange on ubuntu 12.10 – potomok Mar 16 '13 at 20:51
  • FYI: I tried to specifically exclude `/dev/loop0` and it did not help. – Gray Mar 07 '14 at 17:55
0

Downgrade to ruby 1.8 from 1.9 or install ruby 1.8 to begin with. Seems the AMI tools are not 1.9 compatible.

apt-get install ruby1.8
Gray
  • 115,027
  • 24
  • 293
  • 354
RaySl
  • 497
  • 2
  • 7
  • 14
0

You can apply this patch and continue to use ruby1.9. see original article : ec2_upload_bundle and ruby 1.9: can't convert Fixnum into String (many thanks to decodeideas!)

copied-pasted from original article:

The following applies to the following scenari

  • ubuntu karmic, ec2 ami
  • ruby 1.9.2 installed as /usr/bin/ruby
  • the latest ec2 tools

When you use ec2_upload_bundle to re-bundle an AMI that you modified you will get the error

ERROR: can't convert Fixnum into String

The trick to debug this is to pass --debug to the ec2 commands. The fix is on line 19 of /usr/lib/ec2-ami-tools/lib/ec2/amitools/util.rb you need to change ?A to ?A.ord to get this line:

(0..19).inject("") {|ident, n| ident+(?A.ord + Kernel.rand(26)).chr}

Before doing the change you can reproduce the problem with

ruby1.9 -r /usr/lib/ec2-ami-tools/lib/ec2/amitools/util -e 'puts gen_ident'

After applying the patch you should get a short sequence of random letters.

Gray
  • 115,027
  • 24
  • 293
  • 354