这是一个关于OS文件存储管理和Inode的问题

发布于 2024-10-08 00:11:11 字数 288 浏览 2 评论 0原文

这是一个关于OS文件存储管理和Inode的问题。这是一道期末考试复习题。第二题讲师没有给出答案。有人可以做到这一点并帮助我或给出一些提示吗? 哎呀!

  1. [10分] 文件存储管理与Inode b) 考虑由 Inode 表示的 Unix 文件 a 的组织。假设每个 Inode 中有 10 个直接块指针,以及一个单、双和三间接指针。假设系统块大小为4K。磁盘块指针为4字节。 我。系统支持的最大文件大小是多少? 二.假设主存中除了文件Inode之外没有任何信息,那么需要多少次磁盘访问才能访问位置54、423,956的字节。

This is a question about OS file storage management and Inode. This is a question for review of final exam..Lecturer didn't give the answer about second question. Does anybody can do this and help me or give some hints?
THnaks!

  1. [10 points] File Storage Management and Inode
    b) Consider the organization of an Unix file a represented by Inode. Assume that there 10 direct block pointers, and a singly, doubly and triply indirect pointers in each Inode. Assume that the system block size is 4K. Disk block pointer is 4 bytes.
    i. What is the maximum file size supported by the system?
    ii. Assuming no information other than the file Inode is in the main memory, how many disk accesses are required to access the byte in position 54, 423,956.

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

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

发布评论

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

评论(1

海拔太高太耀眼 2024-10-15 00:11:12
10 block pointers = 10 4K blocks = 40KB
singly indirect: 1 block full of pointers = 4K / 4 pointers = 1024 pointers = 4MB
double indirect: 1 block of pointers = 1024 single indirects = 4GB
triple indirect: 1 block of pointers = 1024 double indirects = 4TB

total max size= 4TB+4GB+4MB+40KB = 4402345713664 bytes

位置54,423,956位于双间接块之一中,因此它必须读取两个步骤并且数据块==>读取3个随机块

10 block pointers = 10 4K blocks = 40KB
singly indirect: 1 block full of pointers = 4K / 4 pointers = 1024 pointers = 4MB
double indirect: 1 block of pointers = 1024 single indirects = 4GB
triple indirect: 1 block of pointers = 1024 double indirects = 4TB

total max size= 4TB+4GB+4MB+40KB = 4402345713664 bytes

position 54,423,956 is in one of the double indirect blocks, so it has to read the two steps and the data block => 3 random blocks read

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