Ext2文件系统挂载与卸载流程分析

本文详细介绍了Linux系统中Ext2文件系统的挂载和卸载过程。挂载通过`mount.ext2`命令,涉及VFS、ext2_mount函数,完成dentry指针、mount结构体和目录树的关联。卸载通过`umount`命令,流程相对简单,移除文件系统从目录树。Linux允许一个目录挂载多个文件系统,但只有一个可用,且块设备可挂载到多个路径,使得挂载关系复杂。
摘要由CSDN通过智能技术生成

 

任何文件系统在使用之前都需要挂载(mount),所谓挂载就是将一个磁盘的文件系统连接到操作系统目录树的过程。通过下面命令可以实现文件系统的挂载:

mount.ext2 /dev/sdc /mnt/ext2_test

完成文件系统的挂载后,磁盘上文件系统的所有数据就称为原有目录树的一个子树。普通用户就可以访问该磁盘上的数据了。

Ext2文件系统的挂载

自然,Ext2文件系统在使用之前也是需要挂载的。我们知道挂载操作是一个命令行的工具,也就是mount命令。该命令需要两个参数,一个是需要挂载的块设备,另外一个是目的路径。也就是这个文件系统挂载到什么位置。

文件系统的挂载流程如图所示,mount命令会触发VFS的挂载函数,而该函数则会调用具体文件系统的挂载函数,以Ext2为例则是调用ext2_mount函数。该函数的主要作用是从磁盘的超级块读取数据,并完成内存超级块数据的填充。

该函数执行成功后最终是返回一个dentry指针。这个结构体包含了in

可以读写Ext2,以Ext2方式挂载Ext3文件系统(不支持Ext3日志),不支持中文! It provides Windows NT4.0/2000/XP/2003/Vista/2008 with full access to Linux Ext2 volumes (read access andwrite access). This may be useful if you have installed both Windows and Linux as a dual boot environment on your computer. What features are supported? Complete reading and writing access to files and directories of volumes with theExt2 orExt3 file system. Supports features which are specific to the I/O-system of Windows: Byte Range Locks, Directory Notfication (so the Explorer updates the view of a directory on changes within that directory), Oplocks (so SMB clients are able to cache the content of files). Allows Windows to run with paging files on Ext2 volumes. UTF-8 encoded file names are supported. The driver treats files with file names that start with a dot "." character ashidden. Supports GPT disks if the Windows version used also does. Supports use of the Windows mountvol utility to create or delete drive letters for Ext2 volumes (except on Windows NT 4.0). See also section"Can drive letters also be configured from scripts?". What features are *not* supported? Inodes that are larger than 128 bytes are not supported. Access rights are not maintained. All users can access all the directories and files of an Ext2 volume. If a new file or directory is created, it inherits all the permissions, the GID and the UID from the directory where it has been created. There is one exception to this rule: a file (but not a directory) the driver has created always has cleared "x" permissions, it inherits the "r" and the "w" permissions only. See also section"What limitations arise from not maintaining access rights?". The driver does not allow accessing special files at Ext2 volumes, the access will be always denied. (Special files are sockets, soft links, block devices, character devices and pipes.) Alternate 8.3-DOS names are not supported (just because there is no place to store them in an Ext2 file system). This can prevent legacy DOS applications, executed by the NTVDM of Windows, from accessing some files or directories. Currently the driver does not implement defragging support. So defragmentation applications will neither show fragmentation information nor defragment any Ext2 volume. This software does not achieve booting a Windows operating system from an Ext2 volume. LVM volumes are not supported, so it is not possible to access them.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

数据存储张

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值