- What Is Windows File System? [Help]
- Quick Navigation :
- About Windows File System
- Types of Windows File System
- FAT32 in Windows
- NTFS in Windows
- exFAT in Windows
- Comparisons among the Three Types of Windows File System
- Compatibility
- Security
- Supported Volume Size
- Supported File Size
- File System Conversion
- Как включить Windows Projected File System на Windows 10
- Как работает Windows File Protection
- Что такое проектируемая файловая система Windows?
- Comparing WSL 1 and WSL 2
- Comparing features
- Performance across OS file systems
- What’s new in WSL 2
- WSL 2 architecture
- Full Linux kernel
- Increased file IO performance
- Full system call compatibility
- Exceptions for using WSL 1 rather than WSL 2
- Accessing network applications
- Accessing Linux networking apps from Windows (localhost)
- Accessing Windows networking apps from Linux (host IP)
- Additional networking considerations
- Connecting via remote IP addresses
- Accessing a WSL 2 distribution from your local area network (LAN)
- IPv6 access
- Expanding the size of your WSL 2 Virtual Hard Disk
What Is Windows File System? [Help]
Quick Navigation :
About Windows File System
What is file system? Have you ever paid attention to it? This article aims to introduce Windows file system to you.
In computing, file system controls how data is stored and retrieved. In other words, it is the method and data structure that an operating system uses to keep track of files on a disk or partition.
It separates the data we put in computer into pieces and gives each piece a name, so the data is easily isolated and identified.
Without file system, information saved in a storage media would be one large body of data with no way to tell where the information begins and ends.
Types of Windows File System
Knowing what is file system, let’s learn about the types of Windows file system.
There are five types of Windows file system, such as FAT12, FAT16, FAT32, NTFS and exFAT. Most of us like to choose the latter three, and I would like to introduce them respectively for you.
FAT32 in Windows
In order to overcome the limited volume size of FAT16 (its supported maximum volume size is 2GB) Microsoft designed a new version of the file system FAT32, which then becomes the most frequently used version of the FAT (File Allocation Table) file system.
NTFS in Windows
NTFS is the newer drive format. Its full name is New Technology File System. Starting with Windows NT 3.1, it is the default file system of the Windows NT family.
Microsoft has released five versions of NTFS, namely v1.0, v1.1, v1.2, v3.0, and v3.1.
exFAT in Windows
exFAT (Extended File Allocation Table) was designed by Microsoft back in 2006 and was a part of the company’s Windows CE 6.0 operating system.
This file system was created to be used on flash drives like USB memory sticks and SD cards, which gives a hint for its precursors: FAT32 and FAT16.
Comparisons among the Three Types of Windows File System
Everything comes in advantages and shortcomings. Comparisons among the three types of Windows File System will be showed in following content to help you make a choice about selecting one type of file system.
Compatibility
The three types can work in all versions of Windows.
For FAT32, it also works in game consoles and particularly anything with a USB port; for exFAT, it requires additional software on Linux; for NTFS, it is read only by default with Mac, and may be read only by default with some Linux distributions.
With respect to the ideal use, FAT32 is used on removable drives like USB and Storage Card; exFAT is used for USB flash drives and other external drivers, especially if you need files of more than 4 GB in size; NTFS can be used for servers.
Security
The files belonging to FAT32 and NTFS can be encrypted, but the flies belong to the latter can be compressed.
The encryption and compression in Windows are very useful. If other users do not use your user name to login Windows system, they will fail to open the encrypted and compressed files that created with your user name.
In other word, after some files are encrypted, such files only can be opened when people use your account to login Windows system.
Supported Volume Size
For FAT32, the partition size is no larger than 2TB, which means you cannot format a hard drive larger than 2TB as a single FAT32 partition. NTFS allows you use 64KB clusters to achieve a 256TB volume. In theory, you can achieve a 16EB volume of exFAT.
Supported File Size
For FAT32, it fails to support the single files whose size is over 4GB, while NTFS file system can support the size of single file more than 4GB, and for exFAT, the maximum size of single file, in theory, is 16EB.
In conclusion, compared with NTFS and exFAT, FAT32 comes in higher compatibility in old operating systems and removable storage devices, whereas its features limit in single file size and partition size.
Compared with FAT32 and exFAT, NTFS surpasses in security. And exFAT features larger volume volume size and single file size.
File System Conversion
Maybe you already have a hard drive featuring FAT32 or NTFS file system, and you want to make a conversion. In this situation, you can download MiniTool Partition Wizard to help you complete this conversion.
Как включить Windows Projected File System на Windows 10
Компания Microsoft недавно представила предварительную сборку Windows 10 под номером 17604 в канале обновление «Ранний доступ». В этом релизе добавляется одна интересная функция под названием Windows Projected File System.
- Откройте меню Пуск > Служебные — Windows > Панель управления > Программы и компоненты > Включение или отключение компонентов Windows. Здесь поставьте галочку напротив строки Windows Projected File System (в моём случае в сборке 17110 на ней написано beta).
Защита файлов Windows File Protection (WFP) не позволяет программам заменять критически важные системные файлы Windows. Приложения не могут перезаписывать их, поскольку операционная система и другие программы пользуются этими файлами.
Microsoft представила Windows File Protection для защиты этих критически важных системных файлов и предотвращения проблем в работе операционной системы. Windows File Protection не является новой функцией Windows. Microsoft использовала эту подсистему ещё в Windows 2000 и Windows XP, вернув обратно к жизни в 2018 году.
Однако вряд ли новый механизм полагается на архитектуру 20-летней давности. Например, Microsoft переименовала GVFS (Git Virtual File System) в ProjF (Windows Projected Filesystem).
Как работает Windows File Protection
Если программа использует метод для замены защищённых файлов, WFP восстанавливает оригинальные файлы. Инсталлятор Windows подключается к WFP при установке критически важных системных файлов и делает запрос на установку и замену защищённых файлов вместо попытки установить или заменить их самостоятельно.
WFP работает главным образом незаметно в фоновом режиме. Механизм защиты запускается после того, как WFP получает уведомление об изменении файла в защищённой директории. Система заменяет изменённый файл на файл из кэша или источника установки, отменяя изменения.
Что такое проектируемая файловая система Windows?
В последних сборках Windows 10 в бета-версии появилась новая функция, называемая Windows Projected File System. Я не могу найти в Google никакой информации, кроме API-интерфейсов программирования, которые не имеют смысла для меня.
Что это такое, и на каких пользователей он будет нацелен?
Проецируемая файловая система, также известная как ProjFS, — это функция, похожая на FUSE в Linux (или Dokan & WinFSP). Это позволяет приложениям создавать виртуальные файловые системы, которые кажутся неотличимыми от локальных папок, но все их содержимое генерируется программой «вживую». (Другими словами, вы видите проекции файлов, которых там может не быть.)
Основное использование ProjFS — Microsoft Git Virtual File System , дополнение к инструменту управления версиями Git, направленное на повышение его производительности и уменьшение использования дискового пространства при работе с массивными репозиториями. (Git был создан для репозиториев, содержащих только десятки тысяч файлов, таких как Linux.git; но Microsoft начала использовать его внутри для исходного хранилища Windows, которое на несколько порядков больше).
В настоящее время ProjFS, похоже, не документирована публично, но я ожидаю, что рано или поздно сторонние разработчики выяснят, как использовать его в качестве альтернативы FUSE для реализации таких виртуальных файловых систем, как sshfs , ftpfs и так далее.
Примечание: Pro J ected Файловая система не имеет ничего общего с Windows File Pro т перегиба.
Как отмечено в комментариях, документация теперь доступна для этой функции.
Comparing WSL 1 and WSL 2
The primary difference and reasons for updating the Windows Subsystem for Linux from WSL 1 to WSL 2 are to:
- increase file system performance,
- support full system call compatibility.
WSL 2 uses the latest and greatest in virtualization technology to run a Linux kernel inside of a lightweight utility virtual machine (VM). However, WSL 2 is not a traditional VM experience.
Comparing features
Feature | WSL 1 | WSL 2 |
---|---|---|
Integration between Windows and Linux | вњ… | вњ… |
Fast boot times | вњ… | вњ… |
Small resource foot print compared to traditional Virtual Machines | вњ… | вњ… |
Runs with current versions of VMware and VirtualBox | вњ… | вњ… |
Managed VM | вќЊ | вњ… |
Full Linux Kernel | вќЊ | вњ… |
Full system call compatibility | вќЊ | вњ… |
Performance across OS file systems | вњ… | вќЊ |
As you can tell from the comparison table above, the WSL 2 architecture outperforms WSL 1 in several ways, with the exception of performance across OS file systems.
Performance across OS file systems
We recommend against working across operating systems with your files, unless you have a specific reason for doing so. For the fastest performance speed, store your files in the WSL file system if you are working in a Linux command line (Ubuntu, OpenSUSE, etc). If you’re working in a Windows command line (PowerShell, Command Prompt), store your files in the Windows file system.
For example, when storing your WSL project files:
- Use the Linux file system root directory: \\wsl$\Ubuntu-18.04\home\ \Project
- Not the Windows file system root directory: C:\Users\ \Project
All currently running distributions ( wsl -l ) are accessible via network connection. To get there run a command [WIN+R] (keyboard shortcut) or type in File Explorer address bar \\wsl$ to find respective distribution names and access their root file systems.
You can also use windows commands inside WSL’s Linux Terminal. Try opening a Linux distribution (ie Ubuntu), be sure that you are in the Linux home directory by entering this command: cd
. Then open your Linux file system in File Explorer by entering (don’t forget the period at the end): powershell.exe /c start .
If you experience an error -bash: powershell.exe: command not found please refer to the WSL troubleshooting page to resolve it.
WSL 2 is only available in Windows 10, Version 1903, Build 18362 or higher. Check your Windows version by selecting the Windows logo key + R, type winver, select OK. (Or enter the ver command in Windows Command Prompt). You may need to update to the latest Windows version. For builds lower than 18362, WSL is not supported at all.
WSL 2 will work with VMware 15.5.5+ and VirtualBox 6+. Learn more in our WSL 2 FAQs.
What’s new in WSL 2
WSL 2 is a major overhaul of the underlying architecture and uses virtualization technology and a Linux kernel to enable new features. The primary goals of this update are to increase file system performance and add full system call compatibility.
WSL 2 architecture
A traditional VM experience can be slow to boot up, is isolated, consumes a lot of resources, and requires your time to manage it. WSL 2 does not have these attributes.
WSL 2 provides the benefits of WSL 1, including seamless integration between Windows and Linux, fast boot times, a small resource footprint, and requires no VM configuration or management. While WSL 2 does use a VM, it is managed and run behind the scenes, leaving you with the same user experience as WSL 1.
Full Linux kernel
The Linux kernel in WSL 2 is built by Microsoft from the latest stable branch, based on the source available at kernel.org. This kernel has been specially tuned for WSL 2, optimizing for size and performance to provide an amazing Linux experience on Windows. The kernel will be serviced by Windows updates, which means you will get the latest security fixes and kernel improvements without needing to manage it yourself.
The WSL 2 Linux kernel is open source. If you’d like to learn more, check outВ the blog post Shipping a Linux Kernel with Windows written by the team that built it.
Increased file IO performance
File intensive operations likeВ git clone,В npm install,В apt update,В apt upgrade, and more are all noticeably faster with WSL 2.
The actual speed increase will depend on which app you’re running and how it is interacting with the file system. Initial versions of WSL 2 run up to 20x faster compared to WSL 1 when unpacking a zipped tarball, and around 2-5x faster when usingВ git clone,В npm installВ andВ cmakeВ on various projects.
Full system call compatibility
Linux binaries use system calls to perform functions such as accessing files, requesting memory, creating processes, and more. Whereas WSL 1 used a translation layer that was built by the WSL team, WSL 2 includes its own Linux kernel with full system call compatibility. Benefits include:
A whole new set of apps that you can run inside of WSL, such as Docker and more.
Any updates to the Linux kernel are immediately ready for use. (You don’t have to wait for the WSL team to implement updates and add the changes).
Exceptions for using WSL 1 rather than WSL 2
We recommend that you use WSL 2 as it offers faster performance and 100% system call compatibility. However, there are a few specific scenarios where you might prefer using WSL 1. Consider using WSL 1 if:
- Your project files must be stored in the Windows file system. WSL 1 offers faster access to files mounted from Windows.
- If you will be using your WSL Linux distribution to access project files on the Windows file system, and these files cannot be stored on the Linux file system, you will achieve faster performance across the OS files systems by using WSL 1.
- A project which requires cross-compilation using both Windows and Linux tools on the same files.
- File performance across the Windows and Linux operating systems is faster in WSL 1 than WSL 2, so if you are using Windows applications to access Linux files, you will currently achieve faster performance with WSL 1.
- Your project needs access to a serial port or USB device.
- According to the WSL 2 FAQ, WSL 2 does not include support for accessing serial ports. The open issue on serial support indicates that support has not been added yet.
- You have strict memory requirements
- WSL 2’s memory usage grows and shrinks as you use it. When a process frees memory this is automatically returned to Windows. However, as of right now WSL 2 does not yet release cached pages in memory back to Windows until the WSL instance is shut down. If you have long running WSL sessions, or access a very large amount of files, this cache can take up memory on Windows. We are tracking the work to improve this experience on the WSL Github repository issue 4166.
Consider trying the VS Code Remote WSL Extension to enable you to store your project files on the Linux file system, using Linux command line tools, but also using VS Code on Windows to author, edit, debug, or run your project in an internet browser without any of the performance slow-downs associated with working across the Linux and Windows file systems. Learn more.
Accessing network applications
Accessing Linux networking apps from Windows (localhost)
If you are building a networking app (for example an app running on a NodeJS or SQL server) in your Linux distribution, you can access it from a Windows app (like your Edge or Chrome internet browser) using localhost (just like you normally would).
However, if you are running an older version of Windows (Build 18945 or less), you will need to get the IP address of the Linux host VM (or update to the latest Windows version).
To find the IP address of the virtual machine powering your Linux distribution:
- From your WSL distribution (ie Ubuntu), run the command: ip addr
- Find and copy the address under the inet value of the eth0 interface.
- If you have the grep tool installed, find this more easily by filtering the output with the command: ip addr | grep eth0
- Connect to your Linux server using this IP address.
The picture below shows an example of this by connecting to a Node.js server using the Edge browser.
Accessing Windows networking apps from Linux (host IP)
If you want to access a networking app running on Windows (for example an app running on a NodeJS or SQL server) from your Linux distribution (ie Ubuntu), then you need to use the IP address of your host machine. While this is not a common scenario, you can follow these steps to make it work.
- Obtain the IP address of your host machine by running this command from your Linux distribution: cat /etc/resolv.conf
- Copy the IP address following the term: nameserver .
- Connect to any Windows server using the copied IP address.
The picture below shows an example of this by connecting to a Node.js server running in Windows via curl.
Additional networking considerations
Connecting via remote IP addresses
When using remote IP addresses to connect to your applications, they will be treated as connections from the Local Area Network (LAN). This means that you will need to make sure your application can accept LAN connections.
For example, you may need to bind your application to 0.0.0.0 instead of 127.0.0.1 . In the example of a Python app using Flask, this can be done with the command: app.run(host=’0.0.0.0′) . Please keep security in mind when making these changes as this will allow connections from your LAN.
Accessing a WSL 2 distribution from your local area network (LAN)
When using a WSL 1 distribution, if your computer was set up to be accessed by your LAN, then applications run in WSL could be accessed on your LAN as well.
This isn’t the default case in WSL 2. WSL 2 has a virtualized ethernet adapter with its own unique IP address. Currently, to enable this workflow you will need to go through the same steps as you would for a regular virtual machine. (We are looking into ways to improve this experience.)
Here’s an example PowerShell command to add a port proxy that listens on port 4000 on the host and connects it to port 4000 to the WSL 2 VM with IP address 192.168.101.100.
IPv6 access
WSL 2 distributions currently cannot reach IPv6-only addresses. We are working on adding this feature.
Expanding the size of your WSL 2 Virtual Hard Disk
WSL 2 uses a Virtual Hard Disk (VHD) to store your Linux files. In WSL 2, a VHD is represented on your Windows hard drive as a .vhdx file.
The WSL 2 VHD uses the ext4 file system. This VHD automatically resizes to meet your storage needs and has an initial maximum size of 256GB. If the storage space required by your Linux files exceeds this size you may need to expand it. If your distribution grows in size to be greater than 256GB, you will see errors stating that you’ve run out of disk space. You can fix this error by expanding the VHD size.
To expand your maximum VHD size beyond 256GB:
Terminate all WSL instances using the command: wsl —shutdown
To find your distribution installation package name (‘PackageFamilyName’):
- Using PowerShell (where ‘distro’ is your distribution name) enter the command:
- Get-AppxPackage -Name «* *» | Select PackageFamilyName
- For example: Get-AppxPackage -Name «*Ubuntu*» | Select PackageFamilyName
Use the resulting PackageFamilyName to locate the VHD file fullpath used by your WSL 2 installation, this will be your pathToVHD . To find the full path:
- In your Start menu, enter: «%LOCALAPPDATA%» and select to open the %LOCALAPPDATA% file folder.
- Next, open the «Packages» folder and search for the PackageFamilyName of your distribution. Open that folder (ie. CanonicalGroupLimited.Ubuntu20.04onWindows_79xxxxx).
- Inside the PackageFamilyName folder, open the «LocalState» folder and find the .vhdx file.
- Copy the path to that file, it should look something like: %LOCALAPPDATA%\Packages\
\LocalState\ .vhdx
For example, the
for Ubuntu 20.04 should look something like: %LOCALAPPDATA%\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79xxxx\LocalState\ext4.vhdx .
Resize your WSL 2 VHD by completing the following commands:
Open Windows Command Prompt with admin privileges and enter:
Examine the output of the detail command. The output will include a value for Virtual size. This is the current maximum. Convert this value to megabytes. For example, if the detail output shows Virtual size: 256 GB, convert this to 256000.
The new value you enter must be greater than this original value. As an example, to double the virtual size listed above, you could enter the value: 512000. Once you have determined the number you would like to set for your new size (in megabytes), enter the following command in your Windows Command Prompt diskpart prompt:
Exit diskpart
Launch your WSL distribution (Ubuntu, for example).
Make WSL aware that it can expand its file system’s size by running these commands from your WSL distribution command line.
- You may see this message in response to the first mount command: «/dev: none already mounted on /dev.» This message can safely be ignored.
- Copy the name of this entry, which will look like: /dev/sdX (with the X representing any other character). In the following example the value of X is b:
- Using the example from above, we changed the vhd size to 512000, so the command would be: sudo resize2fs /dev/sbd 512000M .
You may need to install resize2fs. If so, you can use this command to install it: sudo apt install resize2fs .
The output will look similar to the following: