From 23ba3182cf0c289b19b47ebb868c1f0341e83355 Mon Sep 17 00:00:00 2001 From: weishu Date: Mon, 29 Jan 2024 21:42:52 +0800 Subject: [PATCH] website: Add description for sparse file --- userspace/ksud/src/module.rs | 2 +- website/docs/guide/faq.md | 6 ++++++ website/docs/zh_CN/guide/faq.md | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/userspace/ksud/src/module.rs b/userspace/ksud/src/module.rs index 3a500af53c91..90e52df8d801 100644 --- a/userspace/ksud/src/module.rs +++ b/userspace/ksud/src/module.rs @@ -339,7 +339,7 @@ fn _install_module(zip: &str) -> Result<()> { humansize::format_size(zip_uncompressed_size, humansize::DECIMAL) ); - let sparse_image_size = 256 * (1 << 30); // 256G + let sparse_image_size = 1024 * (1 << 30); // 1T if !modules_img_exist && !modules_update_img_exist { // if no modules and modules_update, it is brand new installation, we should create a new img // create a tmp module img and mount it to modules_update diff --git a/website/docs/guide/faq.md b/website/docs/guide/faq.md index fa17f03793be..b17c55ea1b9e 100644 --- a/website/docs/guide/faq.md +++ b/website/docs/guide/faq.md @@ -66,3 +66,9 @@ We do not recommend you to modify the system partition directly. You should use ## Can KernelSU modify hosts? How can i use AdAway? Of course. But KernelSU doesn't have builtin hosts support, you can install [systemless-hosts](https://github.com/symbuzzer/systemless-hosts-KernelSU-module) to do it. + +## Why is there a huge 1T file? + +The 1T size `modules.img` is a disk image file, **don't worry about its size**, it's a special type of file known as a [sparse file](https://en.wikipedia.org/wiki/Sparse_file), its actual size is only the size of the module you use, and it will dynamically shrink after you delete the module; it does not actually occupy 1T of disk space (actually your mobile phone may not have that much space) . + +If you're really unhappy with the size of this file, you can use the `resize2fs -M` command to make it the actual size; but the module may not work properly at this time, and we won't provide any support for this. diff --git a/website/docs/zh_CN/guide/faq.md b/website/docs/zh_CN/guide/faq.md index 8c2a34902d64..dac9ae670ce7 100644 --- a/website/docs/zh_CN/guide/faq.md +++ b/website/docs/zh_CN/guide/faq.md @@ -66,3 +66,9 @@ GKI1 跟 GKI2 完全是两个东西,所以你需要自行编译内核。 ## KernelSU 能修改 hosts 吗,我如何使用 AdAway? 当然可以。但这个功能 KernelSU 没有内置,你可以安装这个 [systemless-hosts](https://github.com/symbuzzer/systemless-hosts-KernelSU-module) + +## 为什么有个 1T 的超大文件? + +1T 大小的 `modules.img` 是一个磁盘镜像文件,**不要担心它的大小**,它是一种被称之为[稀疏文件](https://en.wikipedia.org/wiki/Sparse_file)的文件格式,它的实际大小只有你使用的模块的大小,并且你在删除模块后它会动态缩小;它并不实际占用 1T 大小的磁盘空间(实际上你手机可能并没有这么多空间)。 + +如果你真的对这个文件的大小感到不爽,你可以使用 `resize2fs -M` 命令让它变成实际大小;但此时模块可能无法正常工作,我们也不会为此提供任何支持。