ubports / ubuntu-touch

Ubuntu Touch's issue inbox is now migrated to GitLab.
https://gitlab.com/ubports/ubuntu-touch
1.28k stars 110 forks source link

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

Open stekalb opened 6 years ago

stekalb commented 6 years ago

Steps to reproduce

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

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 commented 6 years ago

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

stekalb commented 6 years ago

done

Marathon2422 commented 6 years ago

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

hoh61 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

UniversalSuperBox commented 5 years ago

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 commented 5 years ago

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

UniversalSuperBox commented 5 years ago

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 commented 5 years ago

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