win10中linux子系统挂载ext3,[教程]使用WSL2挂载Linux硬盘 在Windows上访问ext4等文件系统...

例如当我们安装Windows和Linux双系统,因为文件系统不同在Windows上是无法直接读取Linux文件系统上的文件的,这让开发者们如果要读取Linux文件的话还得重启切换到Linux系统上。

针对这个非常不方便的问题微软现在通过WSL2子系统完成诸如ext4文件系统的中转,让Windows也可以直接读取Linux文件系统,当然不只是开发者安装的Linux系统,如果移动硬盘使用的诸如ext4等文件系统也可以进行读取。

版本要求:

目前此功能仅在Windows 10 Dev Build 20211版上提供,未来该功能应该会面向20H1提供,有兴趣的开发者可以关注蓝点网后续。

需要启用WSL2子系统功能且安装Linux任意发行版后使用。

使用方法:

打开PowerShell管理员模式或者直接启动Linux子系统,然后使用下列命令安装磁盘:wsl --mount # 指的是硬盘路径(设备ID+分区号),具体可以看下面的罗列方法

如果要罗列所有磁盘则使用:wmic diskdrive list brief

如果需要解挂和移除硬盘则使用:wsl --unmount 

磁盘路径在设备ID列表可以找到,下图是给定硬盘的特定分区装入WSL2并浏览其中文件的示例:\\.\\\.\PHYSICALDRIVE*

d558ddef69067240187b180aa8dcb55e.png

使用文件资源管理器访问:

完成挂载后还可以直接使用文件资源管理器访问磁盘,方法是通过打开资源管理器点击左侧导航里的WSL,然后再转到mount文件夹里,点击后即可自动转到已经挂载的所有硬盘。

0dbd10ad24f7766def08211fad5f5e01.png

需要注意的是默认情况下将把硬盘以ext4格式进行挂载,如果你需要指定文件系统和更高级的方法,请点击这里查看方法。

另外需要提醒的是以上挂载方法仅支持将整个物理硬盘挂载出来不支持单独挂载某个分区。

可以读写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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值