给定特定 inode 结构的最大文件大小?

发布于 2024-08-30 10:52:54 字数 94 浏览 8 评论 0原文

假设 UNIX 文件系统有一些限制——例如 2 KB 块和 8B 磁盘地址。如果 inode 包含 13 个直接条目以及每个单个、两个和三个间接条目,那么最大文件大小是多少?

Suppose a UNIX file system has some constraints--say, 2 KB blocks and 8B disk addresses. What is the maximum file size if inodes contain 13 direct entries, and one single, double, and triple indirect entry each?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

不醒的梦 2024-09-06 10:52:54

这为您解释:

http://www.cis.temple。 edu/~ingargio/cis307/readings/stable.html

"The maximum size of a file will be 8KB*(10 + 2**10 + 2**20 + 2**30), that is more than 8TB."

将 8KB 替换为 2KB,并调整较小块大小的条目。

2KB*(10 + 2**8 + 2**16 + 2**24)

从你的问题中我不清楚这 13 个条目是否包括单打、双打和三打,或者它们是否是分开的,但这应该很容易调整 - 只需将表达式中的 10 更改为 13 即可。

我想我'已经正确调整了所有数学...仔细检查=|希望这不是我为你做的家庭作业;)

This explains it for you:

http://www.cis.temple.edu/~ingargio/cis307/readings/stable.html

"The maximum size of a file will be 8KB*(10 + 2**10 + 2**20 + 2**30), that is more than 8TB."

Swap 8KB for your 2KB, and adjust the entries for the smaller block size.

2KB*(10 + 2**8 + 2**16 + 2**24)

It's not clear to me from your question if the 13 entries include the singles, doubles and triples, or if they are separate, but that should be easy to adjust -- just change the 10 in the expression to a 13.

I think I've adjusted all the math correctly... double check it =| Hope this isn't homework I did for you ;)

多像笑话 2024-09-06 10:52:54

1 个块中有多少个指针?

     each block is 2kb = 2^11
     1 disk address is 8b = 2^3
     So, in 1 block there are 2^11/2^3 = 2^8 pointers"
    

文件系统中有多少个指针?

     for 13 direct entries = (2^8)*13 = 3328
     for single  = (2^8)^2 = 2^16
     for double = (2^8)^3 = 2^24
     for triple = (2^8)^4 = 2^32
     total pointer is :3328 + 2^16 + 2^24 + 2^32"
     

因此文件系统的大小为:

size of the disk is  : total of pointer*size of the pointer , which is around 34 GB "
    

How many pointers in 1 block?

     each block is 2kb = 2^11
     1 disk address is 8b = 2^3
     So, in 1 block there are 2^11/2^3 = 2^8 pointers"
    

How many pointers in the file system?

     for 13 direct entries = (2^8)*13 = 3328
     for single  = (2^8)^2 = 2^16
     for double = (2^8)^3 = 2^24
     for triple = (2^8)^4 = 2^32
     total pointer is :3328 + 2^16 + 2^24 + 2^32"
     

Therefore the size of the file system is:

size of the disk is  : total of pointer*size of the pointer , which is around 34 GB "
    

烟若柳尘 2024-09-06 10:52:54

我们有一个可用于竞争性考试的捷径,如下所示:

Max file size possible = [ block size/pointer size]^3 * block size

We hv a shortcut that can be used for competitive exams, given as :

Max file size possible = [ block size/pointer size]^3 * block size
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文