Search code examples
amazon-ec2centostesseract

How to get more space on EC2 to install tesseract


I have a linux Ec2 that I'm trying to run a python script from. It uses pytesseract, so I need to have tesseract running.

I've been following https://stackoverflow.com/a/36999782/1052985 to get everything set up. As I'm running make for tesseract, I believe I ran out of space.

libtool: link: ranlib .libs/libtesseract.a
ranlib: .libs/libtesseract.a: No space left on device
make[2]: *** [libtesseract.la] Error 1
make[2]: Leaving directory `/home/ec2-user/tesseract-3.05.01/api'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ec2-user/tesseract-3.05.01'
make: *** [all] Error 2

Checking df -h it seems true.

Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        488M   56K  488M   1% /dev
tmpfs           497M     0  497M   0% /dev/shm
/dev/xvda1      7.8G  7.7G   33M 100% /

I've tried upgrading my instance from t2.micro to t2.medium and m5d.large but for both the size for /dev/xvda1 remains 7.8G, suggesting I will continue to fail in my quest. Although I do see the devtmpfs and tmpfs increase.

q1: What instance type should I be going for to get tesseract installed?

q2: Should I just give up and switch to ubuntu, or will I just be exchanging one set of issues for another?


Solution

  • The instance type does not define the disk space. You can choose the disk space of the attached EBS volume when creating the instance, and you can resize the EBS volume whenever you need to.

    q1. Which instance type you need to run your application/code depends on the actual CPU/RAM usage. Changing the instance type can be done with a few click in the EC2 console, and you don't have to reinstall anything.

    q2. It's really up to you. If you want to keep your curent instance, then you need to increase the size of the attached EBS volume. On CentOS you can follow these steps from RaGe (https://stackoverflow.com/a/50842362/2128454).

    Just make sure you actually change the size of the EBS volume between step 1 and 2:

    1. Snapshot all ebs volumes you care about before doing any resize operations on them.
    2. Install growpart sudo yum install cloud-utils-growpart
    3. Resize partion sudo growpart /dev/xdva 1
    4. Reboot reboot now
    5. Run lsblk and verify that the partition is now the full disk size
    6. You may still have to run sudo resize2fs /dev/xvda1 to expand the filesystem