Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anbox doesn't install on frieza due to out of disk space #771

Open
stekalb opened this issue Jul 15, 2018 · 10 comments

Comments

@stekalb
Copy link

commented Jul 15, 2018

  • Device: frieza
  • Channel: devel
  • Build: 20180715

Steps to reproduce

Clean install of 16.04 on frieza. Follow the documentation of howto install anbox:

  • export CODENAME="frieza" && export PARTITIONNAME="boot"
  • wget http://cdimage.ubports.com/anbox-images/anbox-boot-$CODENAME.img
  • adb shell sudo reboot -f bootloader
  • sudo fastboot flash $PARTITIONNAME anbox-boot-$CODENAME.img
  • sudo fastboot reboot
  • rm anbox-boot-frieza.img
  • adb shell
    On Device (ADB SHELL)
  • sudo mount -o rw,remount /
  • sudo apt update
  • sudo apt install anbox-ubuntu-touch

Expected behavior

Anbox installs

Actual behavior

Installation fails:

After this operation, 8,157 kB of additional disk space will be used.
E: You don't have enough free space in /var/cache/apt/archives/.

Logfiles and additional information

Filesystem                       Size  Used Avail Use% Mounted on
udev                             979M  4.0K  979M   1% /dev
tmpfs                            197M  1.2M  196M   1% /run
/dev/disk/by-partlabel/userdata  9.3G  3.9G  5.5G  42% /userdata
/dev/loop0                       2.0G  1.9G     0 100% /
/dev/loop1                       243M  231M  6.5M  98% /android/system
none                             4.0K     0  4.0K   0% /android
tmpfs                            981M  4.0K  981M   1% /etc/fstab
tmpfs                            981M  2.0M  979M   1% /var/lib/lxc/android/rootfs
/dev/disk/by-partlabel/system    3.8G  9.4M  3.8G   1% /android/cache
/dev/disk/by-partlabel/protect1  5.9M   44K  5.6M   1% /android/protect_f
/dev/disk/by-partlabel/protect2  5.9M   44K  5.6M   1% /android/protect_s
none                             4.0K     0  4.0K   0% /sys/fs/cgroup
tmpfs                            981M   28K  981M   1% /tmp
none                             5.0M     0  5.0M   0% /run/lock
cgmfs                            100K     0  100K   0% /run/cgmanager/fs
none                             981M  176K  981M   1% /run/shm
none                             100M     0  100M   0% /run/user
tmpfs                            981M     0  981M   0% /media
tmpfs                            981M     0  981M   0% /var/lib/openvpn/chroot/tmp
tmpfs                            981M     0  981M   0% /var/lib/sudo
tmpfs                            197M   36K  197M   1% /run/user/32011
tmpfs                            197M     0  197M   0% /run/user/0
@doniks

This comment has been minimized.

Copy link

commented Jul 15, 2018

please use code tags around the df -h, and/or format it, so it is readable

@doniks doniks changed the title Anbox doesn't install on frieza Anbox doesn't install on frieza due to out of disk space Jul 15, 2018
@stekalb

This comment has been minimized.

Copy link
Author

commented Jul 15, 2018

done

@Marathon2422

This comment has been minimized.

Copy link

commented Jul 16, 2018

Mine does the same thing ( before this version also)
M10 fhd
2018-07-15

@hoh61

This comment has been minimized.

Copy link

commented Jul 19, 2018

Its a pity on frieza that the device /dev/loop0 is chosen that small. Since it contains a lot of android image parts, i believe, the most important thing is to remove these large fragments.

In the meantime you can try this way:
sudo mount -o rw,remount /
#clear apt cache
sudo rm -r /var/cache/apt
#release more space on loop0. File system is reserving extra space for root activities. you can release it with
sudo tune2fs -m 0 /dev/loop0
#now you should have sufficient space for installing
sudo apt update
sudo apt install anbox-ubuntu-touch
#after that you should remove the freshly build apt cache again
sudo rm -r /var/cache/apt
#and make the fs read only again to avoid additional entries in the cache folder
sudo mount -o r,remount /

If you don't have too many other additional software on your device, this will work. However, if the anbox packet is too large, you may need to install dependencies manually, each time deleting the apt cache!

@doniks

This comment has been minimized.

Copy link

commented Jul 20, 2018

On the nexus 7 I apply the following hack to enlarge the root file system. I expect that it works on every device that has the rootfs mounted from /dev/loop0 and not for the actual system partition

boot to recovery
connect with adb
mount /data
cd /data
resize2fs system.img 3G

system.img is mounted as the root file system (you can check with losetup -a). The steps above make it 3 GB instead of the normal size of 3GB

@stekalb

This comment has been minimized.

Copy link
Author

commented Jul 23, 2018

thanks doniks, that works.
I think it's a valid workaround, but it should be fixed generally.

@UniversalSuperBox

This comment has been minimized.

Copy link
Member

commented Aug 1, 2019

2GB is actually about the maximum size we can use for the image file. It provides the best balance between accounting for the size of the root filesystem that can be handled by updates and not taking up a ton of the user's space.

The most important factor that feeds into the current size, though, is the system-image update service's limitations. system-image stores updates to be applied on the Android cache partition. This partition ranges from about 400 to 600MB, depending on the device. We need to compress the whole Ubuntu Touch image down to the size of the cache partition for the device or else updates can't be downloaded and applied. Right now we employ xz with maximum compression settings to manage this. Accounting for that, we're about at the maximum size of the image and the cache partition at the same time (in other words, an update that fills the cache partition is nearing the top of the 2GB image).

This is a bit of a design feature and flaw in system-image. It can be fixed, but I can't tell you how likely that would be to happen.

@webwurst

This comment has been minimized.

Copy link

commented Sep 2, 2019

Do you have some more tips what can be deleted safely from /dev/loop0 to free up some space?

@UniversalSuperBox

This comment has been minimized.

Copy link
Member

commented Sep 8, 2019

Yes, you can probably mount a tmpfs over /var/cache/apt/archives to get enough space to install. Try

sudo mount -t tmpfs tmpfs /var/cache/apt/archives

@errorcodevortex

This comment has been minimized.

Copy link

commented Sep 17, 2019

On the nexus 7 I apply the following hack to enlarge the root file system. I expect that it works on every device that has the rootfs mounted from /dev/loop0 and not for the actual system partition

boot to recovery
connect with adb
mount /data
cd /data
resize2fs system.img 3G

system.img is mounted as the root file system (you can check with losetup -a). The steps above make it 3 GB instead of the normal size of 3GB

I have a 64gb oneplus one with ubports, can we use this command to resize to system.img to near full space without destroying my setup, what percentage of space would you suggest at max? Multirom ubtouch install previously did not face this issue but the app won't update any longer with the options to install it. Got it to 6gb using hoh61's tips but then I filled that up again.

Tried to mount /data command but device or resource is busy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.