卷的挂载过程

卷的挂载过程

原文:

The volume mount process is typically triggered by a request to open a file on a logical volume (that is, a partition or dynamic volume) as follows:

  1. A user application calls CreateFile to open a file. Or a kernel-mode driver calls ZwCreateFile or IoCreateFileSpecifyDeviceObjectHint.
  2. The I/O Manager determines which logical volume is the target of the request and checks its device object to see whether it is mounted. If the VPB_MOUNTED flag is set, the volume has been mounted by a file system.
  3. If the volume has not been mounted by a file system since system boot (that is, the VPB_MOUNTED flag is not set), the I/O Manager sends a volume mount (IRP_MJ_FILE_SYSTEM_CONTROL, IRP_MN_MOUNT_VOLUME) request to each file system that might claim the volume.

Not all built-in file systems are necessarily loaded even well after system boot. For built-in file systems that are not yet loaded, the I/O Manager sends the volume mount request to the file system recognizer (FsRec), which checks the volume boot sector on behalf of these file systems.

If FsRec determines that the volume was formatted by a not-yet-loaded file system, the I/O Manager responds by sending a load file system (IRP_MJ_FILE_SYSTEM_CONTROL, IRP_MN_LOAD_FILE_SYSTEM) request to FsRec, which loads the file system. The I/O Manager then sends the original volume mount request to the file system.

  1. Each file system that receives the mount volume request examines the volume's boot sector to determine whether the volume's format and other information indicate that the volume was formatted by that particular file system. If the format matches, the file system mounts the volume.

 

 

译文:

卷的加载过程通常在打开一个逻辑卷(一个分区或动态卷)上的文件时被触发:

1、  一个用户程序调用CreatetFile打开文件或者内核态驱动调用ZwCreateFileIoCreatetFileSpecifyDeviceObjectHint

2、  I/O管理器检查要打开的文件所在逻辑卷,并且确定该逻辑卷是否被文件系统加载过。如果VPB_MOUNTED标志被设置,则说明该逻辑卷已经被文件系统加载过了。

3、  如果自系统启动以来该逻辑卷都未被文件系统加载过,I/O管理器会发送一个卷挂载请求(IRP_MJ_FILE_SYSTEM_CONTROLIRP_MJ_MOUNT_VOLUME)给每一个可能挂载这个设备的文件系统进行卷挂载操作。

并非所有的内建文件系统会在系统启动时就被加载到内存,对于那些没有加载的内建文件系统,I/O管理器会把挂载请求发送给这些文件系统对应的文件系统识别器,这些文件系统识别器会代表对应的文件系统来检查卷的启动扇区。

如果经文件系统识别器检查发现该卷应该由一个未加载的文件系统来挂载,则I/O管理器就会向文件系统识别器发送加载文件系统请求(IRP_MJ_FILE_SYSTEM_CONTROL, IRP_MN_LOAD_FILE_SYSTEM),文件系统识别器就会加载文件系统,然后I/O管理器将会把挂载卷请求发送给刚刚加载的文件系统。

4、  每一个接收到卷加载请求的文件系统将会检查该卷的启动扇区以决定该卷的格式以及其他一些信息,这些信息都会表明该卷是被哪一种文件系统格式化的。如果格式相符合,则该文件系统就会加载这个卷。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值