We have moved to a new Sailfish OS Forum. Please start new discussions there.
3

[bug] "running out of space" due to duplication in opt/alien [answered]

asked 2016-05-22 07:02:21 +0300

RobNas gravatar image

The last month or so I was getting a lot of "running out of space" notfications on Sailfish. It also let the telephone crash due to btrfs balancing, but I could save my phone doing some shell tricks in recovery mode.

What's the problem: Sailfish is giving me the notification about "running out of space". After checking with space inspector app which folders are taking the biggest bite, I discovered the /home/nemo folder is duplicated in /opt/alien. If I count up the file sizes manually, this is the rootcause. The problem gets worse since Android saves in the /home/nemo folder (android_storage), where I have maps for Sygic & Here Maps.

I thought it was possible to have Android data on SD-card (but I can't), although I have formatted card as exFAT, although I don't encounter any problems with it. I have formatted it as fat32 for the time being, without succes.

So how can I solve the /home/nemo data is duplicated/counted twice for memory space? And maybe how can I put Android stuff on my SD-card?

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by olf
close date 2020-03-07 19:15:46.356116

Comments

most likely you would have better luck when using ext3, but you would need to do some ln -s trickery.

rainisto ( 2016-05-22 09:48:57 +0300 )edit

According to Manatus' comment on this question, the "running out of space" notification is not about disk space but apparently ram usage.

Sthocs ( 2016-05-23 12:14:02 +0300 )edit

2 Answers

Sort by » oldest newest most voted
5

answered 2016-05-22 14:57:13 +0300

Self-Perfection gravatar image

This is bind mount, your files are not duplicated actually.

Here is simple check to ensure, that files in $HOME take space just once:

$ btrfs filesystem df /
Data, single: total=10.86GiB, used=8.51GiB
System, DUP: total=40.00MiB, used=4.00KiB
System, single: total=4.00MiB, used=0.00
Metadata, DUP: total=586.00MiB, used=261.17MiB
Metadata, single: total=8.00MiB, used=0.00
$ fallocate -l 100M /home/nemo/test_100MB_file
$ btrfs filesystem df /
Data, single: total=10.86GiB, used=8.61GiB
System, DUP: total=40.00MiB, used=4.00KiB
System, single: total=4.00MiB, used=0.00
Metadata, DUP: total=586.00MiB, used=261.29MiB
Metadata, single: total=8.00MiB, used=0.00
$ ls -l --inode {/opt/alien,}/home/nemo/test_100MB_file
1584445 -rw-rw-r-- 1 nemo nemo 104857600 2016-05-22 14:32 /home/nemo/test_100MB_file
1584445 -rw-rw-r-- 1 nemo nemo 104857600 2016-05-22 14:32 /opt/alien/home/nemo/test_100MB_file

Note, that "Data" usage increased just by 100MB in my case (8.51GiB -> 8.61GiB). File under /opt/alien hierarchy is actually the same file as in /home, it has the same inode (first column of ls output).

If used space reported by btrfs fi df / is much higher than you get by summing your files size it might be because you have extra subvolumes/snapshots. Check devel-su btrfs subvolume list / you should have only 4:

ID 264 gen 2728210 top level 5 path factory-@
ID 265 gen 2777055 top level 5 path factory-@home
ID 266 gen 2836596 top level 5 path @
ID 267 gen 2836577 top level 5 path @home
edit flag offensive delete publish link more

Comments

I see files in $HOME are taking space once, so that's ok.

When I check subvolumes, I see:

ID 259 gen 46623 top level 5 path @swap
ID 264 gen 2815613 top level 5 path factory-@
ID 265 gen 2815613 top level 5 path factory-@home
ID 290 gen 2152120 top level 5 path @_old
ID 292 gen 2815613 top level 290 path @_old/media/sdcard/jolla
ID 293 gen 2815613 top level 290 path @_old/media/sdcard/android
ID 294 gen 2815712 top level 290 path @_old/@
ID 356 gen 2818267 top level 5 path @
ID 357 gen 2818265 top level 5 path @home

I must say I've formatted SD as btrfs and shared partition with android in the past. But I've reverted to factory settings later.

When I calculate space: Complete available space on my phone is approximately 13GB.
The five largest folders on my phone (others are <100MB) add up to 11.5GB, where my OPT folder is a duplicate of home, usr and data (and more).

Since there aren't any other big folders and the Sailfish system was notifying me about running out of space, Sailfish does count duplicates....

RobNas ( 2016-05-23 13:14:03 +0300 )edit
1

OS does not walk over all of your dozens of thousands files to get amount of used space. It just df $MOUNTPOINT But in case of Jolla due to btrfs trickery (and probably old kernel still having problems solved long ago?) it is last line of devel-su btrfs filesystem show that matters. You have to always have at least 1GiB unallocated. That's what all of this btrfs balance fuss is all about.

Self-Perfection ( 2016-05-23 17:23:19 +0300 )edit

I know I need 1GB free space. That can't be the problem, because there is enough space. But as long as Sailfish thinks opt/alien duplications are data too and is added to the total amount, it's still giving notifications about this.

But what's causing this? Is Sailfish counting data the wrong way? If so, is this gonna be solved or can I solve it?

RobNas ( 2016-05-25 23:38:45 +0300 )edit
1

All you observe is that sometimes you unexpectedly get notification about lack of space. You don't have evidences that point to conclusion "OS counts space taken by some files twice". It can't be true.

You have to take measures to figure out what is going on. Here is a plan:

  1. next time you get lack of space notification run bothbtrfs filesystem df /anddevel-su btrfs filesystem show and record output
  2. Clean up 2 GiB. Control the process by checking df /
  3. Run again btrfs filesystem df /anddevel-su btrfs filesystem show. Check which figures has changed and which has not
  4. Perform btrfs balance
  5. Run btrfs filesystem df /anddevel-su btrfs filesystem show again and compare to results in 1. and 3.

This should give you perspective and increase your understanding of the issue.

Self-Perfection ( 2016-05-26 22:04:46 +0300 )edit

btrfs filesystem df /
Data, single: total=12.97GiB, used=12.60GiB
System, DUP: total=32MiB, used=4.00KiB
System, single: total=4MiB, used=0.00
Metadata, DUP: total=366.00MiB, used=199.12MiB

devel-su btrfs filesystem show
ERROR: unable to get label Inappropriate ioctl for device
Label: 'sailfish' uuid: 0f8aetc.etc.
    Total devices 1 FS bytes used 12.80GiB
    devid  1 size 13.75GiB used 13.75GiB path /dev/mmcblk0p28

Btrfs v3.16

removed files
Before:
output "df /":used 13623300
After:
output "df /":used 11878448

So removed 1.7GB (the same amount as I expected)

Data, single: total=12.97GiB, used=10.94GiB
System, DUP: total=32MiB, used=4.00KiB
System, single: total=4MiB, used=0.00
Metadata, DUP: total=366.00MiB, used=196.86MiB

ERROR: unable to get label Inappropriate ioctl for device
Label: 'sailfish' uuid: 0f8aetc.etc.
    Total devices 1 FS bytes used 11.13GiB
    devid  1 size 13.75GiB used 13.75GiB path /dev/mmcblk0p28

Btrfs v3.16

btrfs-blancer balance

btrfs filesystem df /
Data, single: total=12.90GiB, used=10.94GiB
System, DUP: total=32MiB, used=4.00KiB
System, single: total=4MiB, used=0.00
Metadata, DUP: total=366.00MiB, used=196.40MiB

devel-su btrfs filesystem show
ERROR: unable to get label Inappropriate ioctl for device
Label: 'sailfish' uuid: 0f8aetc.etc.
    Total devices 1 FS bytes used 11.13GiB
    devid  1 size 13.75GiB used 13.75GiB path /dev/mmcblk0p28

My conclusion is the generated data is counted correctly...
That would mean something invisible is eating up space or the notification is counting space in a different way I did with the terminal...

RobNas ( 2016-05-27 14:42:41 +0300 )edit
0

answered 2016-05-22 17:02:29 +0300

chemist gravatar image

updated 2016-05-22 17:03:29 +0300

Disregard /opt/alien/ bindmounts or you may find out that your 16GB internal storage is using more than there is physically available. Also note that while the usdcard is now available within android support, the apps you use need to support saving anywhere in the system (input full path), as the appropriate sdcard symlink within alien-dalvik is still missing (iirc HERE maps does not provide this option, OsmAnd~ does)

edit flag offensive delete publish link more

Question tools

Follow
2 followers

Stats

Asked: 2016-05-22 07:02:21 +0300

Seen: 593 times

Last updated: May 22 '16