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

Fix empty disk space calculation for some Linux distributions #2258

Merged
merged 2 commits into from
Dec 2, 2020

Conversation

rvl
Copy link
Contributor

@rvl rvl commented Dec 1, 2020

The Linux installer runs Daedalus inside a chroot, which lives in a temporary directory.

Some - perhaps most - Linux distros have the temporary directory as a tmpfs (RAM drive).

So when Daedalus checks the free space in /, it is reporting the amount of free space on the tmpfs - typically only a few GB.

This change makes Daedalus check the free space for the state directory.

In any case, this is a good thing to do, because the state directory (in the user's home directory) may be on a different partition to /.

Testing

I haven't done any testing on this.

The Linux installer runs Daedalus inside a chroot, which lives in a
temporary directory.

Some - perhaps most - Linux distros have the temporary directory as a
tmpfs (RAM drive).

So when Daedalus checks the free space in /, it is reporting the
amount of free space on the tmpfs - typically only a few GB.

This change makes Daedalus check the free space for the state
directory.

In any case, this is a good thing to do, because the state
directory (in the user's home directory) may be on a different
partition to /.
@gabriela-ponce
Copy link

@rvl @nikolaglumac I compared this with an old build on all platforms and the information about the disk space seems to be as accurate with this fix. Here are the results:

Another build:
Windows
Mac
Linux

Build 15394:
Windows
Mac
Linux

However, I couldn't reproduce this issue initially, even with a partitioned disk. Should we ask @KtorZ to review this too?

@rvl
Copy link
Contributor Author

rvl commented Dec 2, 2020

I could reproduce on Linux Daedalus flight:

Screenshot from 2020-12-02 15-26-37

And it appears to be fixed on build 15394 testnet.

Screenshot from 2020-12-02 15-27-48

@nikolaglumac nikolaglumac changed the title Fix disk space report for some Linux distros Fix empty disk space calculation for some Linux distributions Dec 2, 2020
@nikolaglumac nikolaglumac removed the WIP label Dec 2, 2020
@nikolaglumac nikolaglumac self-requested a review December 2, 2020 07:51
Copy link
Contributor

@nikolaglumac nikolaglumac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great fix @rvl 🎉
I have checked the docs and we can actually provide the full state directory path to all platforms.
That is what I updated here - simpler code - simpler life for us all :-)

@nikolaglumac nikolaglumac merged commit babd2b6 into develop Dec 2, 2020
@iohk-bors iohk-bors bot deleted the rvl/linux-fix-disk-space branch December 2, 2020 07:53
@nikolaglumac nikolaglumac added release-2.6.0 Daedalus Mainnet and removed ⏳release-vNext labels Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug release-2.6.0 Daedalus Mainnet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants