How to get more space on EC2 to install tesseract - amazon-ec2

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?

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

Related

Increasing disk size in Vagrant archlinux using resize2fs

I am currently running a Vagrant box with archlinux for development purposes. I wanted to go beyond the 2GB so I installed the vagrant-disksize plugin and after ssh'ing into the box and changing the partition size, I ran resize2fs as suggested here.
However, when I do that, I get the following error:
resize2fs: Device or resource busy while trying to open /dev/sdax
Couldn't find valid filesystem superblock.
Here's what the man page says about resize2fs:
If the filesystem is mounted, it can be used to expand the size of the
mounted filesystem, assuming the kernel and the file system supports
on-line resizing.
How can I use resize2fs with my archlinux box?
tldr: resize2fs doesn't work on btrfs
Resolution:
After investigating the issue, I found out that the archlinux Vagrant box was set up with btrfs instead ext4. If you want to expand your disk size on Vagrant/VirtualBox and Arch Linux you will have to.
Steps to follow
Increase the physical disk size by either 1. using the Vagrant disk-resize plugin, 2. manually dismounting and cloning the drive with VBoxManage, or 3. activating the Vagrant experimental feature flag (oct. 2020).
Resize the partition inside the OS with {,c}fdisk or parted.
Check the file system on your partition with lsblk --fs. If you happen to run on btrfs, you won't be able to use resize2fs. You'll have to go through
btrfs filesystem resize max / (the mount point)
A few links that could be of use:
https://www.suse.com/support/kb/doc/?id=000018798
https://gist.github.com/christopher-hopper/9755310
https://askubuntu.com/questions/317338/how-can-i-increase-disk-size-on-a-vagrant-vm

how to install pip, gcc, python on another player on linux because device already full

I have a Nao robot, which runs on Gentoo linux.
my problem is that the root is 97% full, I have another drive
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 907096 830868 30148 97% /
/dev/root 907096 830868 30148 97% /
rc-svcdir 1024 92 932 9% /lib/rc/init.d
cgroup_root 10240 0 10240 0% /sys/fs/cgroup
udev 10240 124 10116 2% /dev
tmpfs 513316 2952 510364 1% /dev/shm
tmpfs 513316 1552 511764 1% /var/volatile
/dev/mmcblk0p1 7639920 703184 6548644 10% /var/persistent
/dev/sda1 126931 6334 114044 6% /var/persistent/media/in
I can not install anything, I do not have Pip, GCC and has no place to install anything.
Is it possible to install my modules on other drives?
Thank you.
On Nao V5, I use the VM image mounted with Virtual Box to compile the software I need. It's kind of a pain because all the tools are outdated, and don't support modern SSL connections. But you can compile Python modules and C/C++ library on the virtual machine (it has pip and GCC installed) and then transfer them to your machine using SCP.
For info, I went as far as using my own machine as a proxy to pip as pip refused the outdated https requests from Nao.
Nao V6 has some (all?) those tools installed by default in the normal robot. At least Pip was there and I could install some libraries I needed directly in the robot.

target disk is too small on reboot

I'm trying to reinstall OSx on my macbookpro 13 2010. Right when it was about to install, I get the error that target disk is too small. I reboot it again and open the terminal and type:
diskutil list
And get this result:
result of typing diskutil list
I see that diskutil has many helpful commands which can erase or merge volumes and disks. However, I'm not sure which ones are safe or exactly how to go about doing this. What should I do next?
Follow these steps and let me know if it helped:
diskutil list
diskutil apfs deleteContainer disk0s2 - this will delete the apfs partition that is currently active.
again, diskutil list
diskutil partitionDisk /dev/disk0 gpt apfs macOSX 250 - this will create a new partition for you named macOSX
Now try to re install the OS to this drive. I am sure it will succeed. Revert back if any more queries exist.
I know this is an old thread but I found an easy solution for this.
First erase the disk with disk utility using erase and then just create another partition on it and install the OS to the new partition. Don't know why but it works.

building oracle docker image on mac os x fails with "This system does not meet the minimum requirements for swap space."

I am using Docker Community Edition Version 17.03.0-ce-mac2 (15654) on OS X.
I am using these (official) oracle docker files
I am using oracle-xe-11.2.0-1.0.x86_64.rpm.zip as my installation binary.
When I run
:dockerfiles $ pwd
.../oracle/docker-images/OracleDatabase/dockerfiles
:dockerfiles $ ./buildDockerImage.sh -v 11.2.0.2 -x
I get this error:
Archive: oracle-xe-11.2.0-1.0.x86_64.rpm.zip
creating: Disk1/
creating: Disk1/upgrade/
inflating: Disk1/upgrade/gen_inst.sql
creating: Disk1/response/
inflating: Disk1/response/xe.rsp
inflating: Disk1/oracle-xe-11.2.0-1.0.x86_64.rpm
This system does not meet the minimum requirements for swap space. Based on
the amount of physical memory available on the system, Oracle Database 11g
Express Edition requires 2048 MB of swap space. This system has 1023 MB
of swap space. Configure more swap space on the system and retry the
installation.
error: %pre(oracle-xe-11.2.0-1.0.x86_64) scriptlet failed, exit status 1
error: oracle-xe-11.2.0-1.0.x86_64: install failed
Removing intermediate container 86bb92ebf0e5
This worked last week. I can't recall if I did anything different back then.
What do I need to do to fix?
The issue is that the virtual machine underpinning docker on os x has swap set to 1G. When I found "ramonpires" answer in this, it made it clear to me that I needed to add swap to that underlying vm. The instructions in that post got me most of the way there, but I had to add one final step to get it to work. So, full solution:
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
username:root
password:[empty]
close session:Ctrl+a d
free -m
This tells you how much swap is available. Check it is less than 2G.
dd if=/dev/zero of=/var/swap.file count=2000000 bs=1024
chmod go= /var/swap.file
mkswap /var/swap.file
echo "/var/swap.file swap swap defaults 0 0" >> /etc/fstab
swapon -a
The last line was missing from the linked to solution. Now run
free -m
To ensure you have more than 2G swap, and then re-run
:dockerfiles $ ./buildDockerImage.sh -v 11.2.0.2 -x

Cleaning up after a failed BSD Ports Make Install Attempt?

I am trying to clean up after failed installs from ports of Emacs 21 and Emacs 23 as well as Git. I was trying to install Emacs and Git on an OpenBSD v5.2 install on a DEC VaxStation 4000 model 90. It has a staggering 32 megs of RAM and a 2.1 gig hard drive, very high end for 1991 but all this now seems puny; so yes every last megabyte of hard drive space does matter on this hard drive which is now already 72% full.
My attempts at the installs using make install within the appropriate directory of the /usr/ports tree have failed. I did run make clean after each failed compilation and have also checked /tmp and it is largely empty. OpenBSD seems to also flush /tmp with each reboot. The hard drive capacity does however seem to shrink with each failed program compilation so I am probably accumulating some programs or tarballs or cruft with each attempted installation.
The programs in question are not available as binary packages for the VAX architecture.
How do I clean up after failed ports compilations in this scenario?
Run rm -rf /usr/ports/pobj.
Check also the directory packages within /usr/ports.

Resources