- Отличия файловых систем Linux и Windows
- Отличия файловых систем Linux и Windows
- Структура каталогов
- Чувствительность к регистру
- Косая черта vs. Обратная косая черта
- Символ «/» вместо буквы диска
- Everything is a File
- Вы можете удалять или изменять открытые файлы
- Заключение
- Difference Between Linux File System and Windows File System
- Access Linux filesystems in Windows and WSL 2
- Getting started
- Accessing these files with File Explorer
- Limitations
- Give us your feedback!
- Linux Explore
- Exploring Linux
- Linux File System and Windows File System, Difference
Отличия файловых систем Linux и Windows
Обновл. 15 Авг 2021 |
В сравнении с Windows, файловые системы Linux имеют довольно много отличий. Вы не найдете здесь никаких букв для обозначения дисков или символа обратной косой черты ( \ ), указывающего на подкаталоги. При этом сами файлы могут иметь одни и те же имена, различающиеся только регистром букв. На этом уроке мы рассмотрим некоторые различия между файловыми системами Linux и Windows, узнать о которых будет полезно начинающим пользователям Linux-систем.
Отличия файловых систем Linux и Windows
Структура каталогов
В файловых системах Linux отсутствуют папки Windows, Program Files, Users (хотя каталог /home/ очень похож на папку Users в Windows).
Структура каталогов Linux не просто использует разные имена для папок и файлов. В ней применяется в целом иной принцип их расположения. Например, приложение в Windows может хранить все свои файлы в папке C:\Program Files\Имя_приложения, в то время как в Linux данные файлы будут разделены между несколькими расположениями: двоичные файлы будут помещены в /usr/bin, библиотеки — в /usr/lib, а конфигурационные файлы — в /etc/.
Структура каталогов в Debian Linux
Чувствительность к регистру
В Windows вы не можете в одной папке одновременно иметь файлы file и FILE. Файловая система Windows не чувствительна к регистру, поэтому она обрабатывает их имена как один и тот же файл.
В Linux же файловая система является чувствительной к регистру букв. Это означает, что у вас в одной папке могут находиться файлы с именами file, File и FILE соответственно. При этом они будут отличаться своим содержимым, т.к. Linux рассматривает заглавные и строчные буквы как разные символы.
Косая черта vs. Обратная косая черта
Windows, как и DOS, использует обратную косую черту. Например, путь к каталогу пользователя в Windows имеет следующий вид:
В Linux же путь к домашнему каталогу пользователя представлен в виде:
Примечание: Также не трудно заметить, что URL-адрес в вашем веб-браузере — даже в Windows — использует символ прямой косой черты, например, https://ravesli.com/ .
Символ «/» вместо буквы диска
Каждому разделу или целому диску в Windows назначается соответствующая буква. Независимо от того, имеется ли у вас несколько жестких дисков, несколько разделов на одном жестком диске или подключены съемные устройства, каждая файловая система будет доступна под своей собственной буквой:
В Linux же дела обстоят совсем иначе: вместо букв здесь применяются пути к различным каталогам (в Windows такое тоже возможно, но требуется дополнительная настройка).
В Linux все файлы находятся в / — корневом каталоге. Вне корневого каталога файлов нет. Когда вы подключаете к компьютеру какое-нибудь устройство, оно монтируется (подключается) в разделе /media/. При этом содержимое каталога будет отображать содержимое смонтированного раздела:
Если у вас несколько жестких дисков или разделов жесткого диска, вы можете смонтировать их в любом месте вашей файловой системы. Например, разместить свои домашние каталоги в отдельном разделе, смонтировав его в /home или в любой другой каталог, даже в /myBackupDrive.
Everything is a File
Точно так же, как каждая смонтированная файловая система является каталогом внутри корневого каталога / , всё в Linux является файлом. Например, ваш первый жесткий диск в системе представлен каталогом /dev/sda, CD-привод доступен в /dev/cdrom, а ваша мышь — в /dev/mouse.
Примечание: Детально о принципе «Everything is a File» в Linux-системах мы расскажем в отдельной статье.
Вы можете удалять или изменять открытые файлы
В Linux и других UNIX-подобных операционных системах приложения не блокируют доступ к файлам так, как это делает Windows. Например, предположим, что вы смотрите фильм через медиаплеер VLC в Windows. Идут титры, вы закончили его смотреть и поэтому пытаетесь удалить. Система выдаст сообщение об ошибке — вам нужно прекратить просмотр файла в VLC, прежде чем вы сможете удалить его (переименовать или сделать с ним что-либо еще).
В Linux, как правило, вы можете удалить или изменить видеофайл во время его воспроизведения. Вы не увидите сообщений об ошибках, в которых говорится, что файл в данный момент используется кем-то еще.
Заключение
Эти различия должны относиться и к другим UNIX-подобным операционным системам, хотя могут быть свои нюансы (например, в macOS регистр не учитывается). Повторюсь, что здесь представлены те различия между файловыми системами Windows и Linux, узнать о которых полезно именно новичкам в мире Linux.
Поделиться в социальных сетях:
Источник
Difference Between Linux File System and Windows File System
June 27, 2011 Posted by Indika
Linux File System vs Windows File System
A file system (also known as filesystem) is a technique for storing data in an organized and a human-readable form. The basic unit of a data file system is called a file. A file system is a very important component residing in most data storage devices like hard drives, CDs and DVDs. A file system helps the devices to maintain the physical location of the files. Furthermore, a file system can allow its files to be accessed from a network by becoming a client to network protocols like NFS.
What is Windows File System?
Windows mainly support FAT (File Allocation Table) and NTFS (New Technology File system). Windows NT 4.0, Windows 200, Windows XP, Windows .NET server and Windows workstation use NTFS as their preferred file system. Still, FAT can be used with floppy disks and older Windows versions (for multi-boot systems). FAT is the initial file system used in Windows. FAT was used with DOS, and its three versions are FAT12, FAT16 and FAT32. The number of bits used to identify a cluster is the number that is used as the suffix in the name. FAT12, FAT16 and FAT32 have 32MB, 4GB and 32GB as the maximum partition sizes.
NTFS has completely different data organization architecture. Basically, Microsoft developed NTFS to compete with UNIX, by replacing the much more simple FAT. However, the newest FAT version called exFAT is claimed to have certain advantages over NTFS. A FAT partition can be easily converted to a NTFS partition without loosing data. NTFS supports features like indexing, quota tracking, encryption, compression and repair points. Windows uses drive letter to distinguish partitions. Traditionally, The C drive is the primary partition. Primary partition is used to install and boot Windows. Drive letter can be used for mapping network drives as well.
What is Linux File System?
A variety of files systems can be sued with Linux. Commonly used file systems are ext* family (ext, ext2, ext3 and ext4) and XFS. Silicon Graphics developed XFS, which is a journaling system with high performance. The ext (extended file system) was developed in early 1990’s. It was the first file system used in Linux operating system. Remy Card developed it by getting inspiration from the UFS (UNIX File System).
On Linux, everything is a file. If something is not a file, then it is a process. Programs, audio, video, I/O devices and other devices are considered as files. In Linux, there is no difference between a file and a directory. A directory is simply a file containing names of a set of other files. Special files are a mechanism used for I/O (found in /dev). Sockets (another special file type) provide inter-process communication. Named pipes (much like sockets) are used for inter-process communication without network semantics.
What is the difference between Linux File System and Windows File System?
Windows uses FAT and NTFS as file systems, while Linux uses a variety of file systems. Unlike Windows, Linux is bootable from a network drive. In contrast to Windows, everything is either a file or a process in Linux. Linux has two kinds of major partitions called data partitions and swap partitions. Because of the existence of swap partitions, you never run out of memory in Linux (like in windows). In terms of recovery tools, only a limited number of tools can be used on Windows, while there is a large number of UNIX based recovery tools available for Linux file systems.
Источник
Access Linux filesystems in Windows and WSL 2
September 10th, 2020
Starting with Windows Insiders preview build 20211, WSL 2 will be offering a new feature: wsl —mount . This new parameter allows a physical disk to be attached and mounted inside WSL 2, which enables you to access filesystems that aren’t natively supported by Windows (such as ext4).
So, if you’re dual booting with Windows & Linux using different disks, you can now access your Linux files from Windows!
Getting started
To mount a disk, open a PowerShell window with administrator privileges and run:
To list the available disks in Windows, run:
To unmount and detach the disk from WSL 2, run
The disks paths are available under the ‘DeviceID’ columns. Usually under the \\.\\\.\PHYSICALDRIVE* format. Below is an example of mounting a specific partition of a given hard disk into WSL and browsing its files.
Accessing these files with File Explorer
Once mounted, it’s also possible to access these disks through the Windows explorer by navigating to \wsl$ and then to the mount folder.
Limitations
By default, wsl —mount attempts to mount the disk as ext4. To specify a filesystem, or for more advanced scenarios, check out Mount a disk in WSL 2.
Also please note that this feature comes with the limitation that only physical disks can be attached to WSL 2. At this time, it’s not possible to attach a single partition. More details on the limitations here.
Give us your feedback!
If you run into any issues, or have feedback for our team please file an issue on our Github , and if you have general questions about WSL you can find all of our team members that are on Twitter on this twitter list.
Источник
Linux Explore
Exploring Linux
Linux File System and Windows File System, Difference
Windows vs Linux
Windows uses FAT and NTFS as file systems, while Linux uses a variety of file systems.
Unlike Windows, Linux is bootable from a network drive.
In contrast to Windows, everything is either a file or a process in Linux. Please see one of my earlier post What “Everything Is a File” Means on Linux.
Linux has two kinds of major partitions called data partitions and swap partitions. Because of the existence of swap partitions, you never run out of memory in Linux (like in windows).
In terms of recovery tools, only a limited number of tools can be used on Windows, while there is a large number of UNIX based recovery tools available for Linux file systems.
From the author Nigel McFarlane:
Both Windows and Linux organize disk-based files into a hierarchy of directories. Such directories are usually called “folders” when viewed in a GUI. One whole hierarchy is called a “file system” on both platforms. The architecture of Windows and Linux file systems is similar in some points, but diverges greatly when tools are considered. Here’s a quick comparison.
On hardware derived from Intel or IBM PCs, both Windows and Linux use the Master Block Record/ Master Boot Record (MBR). That is the bit of disk used to boot the operating system and to state whether the disk is partitioned or not. On both Windows and Linux, it is common to have at most one file system per partition. That is about the end of the similarity.
Each Windows file system gets a drive letter, like “C:”. On Linux, each file system gets a device, like /dev/hda1 (“hard disk A part 1”), which is represented as a file. Such a file is a device file (since a disk is a device), hence the “dev” part of the path name. Also, the device file is not an ordinary text file, it is a “special file.” Since disks are block devices (unlike a serial mouse), such a file is fully described as a “block special device file.” The numbered part of the path can be a little weird to get right; it’s best to be guided by documentation there or extract the right name from a report.
On Windows, file systems can be FAT16, FAT32 or NTFS, to name a few. Recall FAT16 is the ancient standard responsible for Windows file names with the “8.3” file name length restriction. On Linux, filesystems can be “minix,” “ext,” or “ext2,” to name a few. Also, “minix” is an example of the ancient standard responsible for UNIX file names once being limited to 14 characters. Linux also has “msdos” and “vfat” file systems for compatibility with Windows and DOS, plus more.
Windows uses FORMAT.EXE to format a disk. Linux uses “mkfs” (“make file system”) in various specialist forms.
Each Windows file system has a File Allocation Table (FAT, VFAT, or similar) that states which disk blocks hold the topmost directory. On Linux, the equivalent on most filesystems is the superblock. A Linux file system has multiple copies of the superblock physically saved on the disk. This provides redundancy in case of a partial disk corruption. The superblock is just about always in memory on Linux; that is not the case for ancient DOS-like file systems. There are no special restrictions on files placed in the topmost directory on Linux, either.
On Windows, there is one drive letter per mounted file system: for example, C: for C: and D: for D:. On Linux there are no drive letters, so one file system is mounted on “/” and all other file systems are mounted on subdirectories of “/.” This arrangement is like the little-used MS-DOS command SUBST, or the NET USE command that supports Novell‘s NetWare. The equivalent Linux command is “mount.”
You can see all this at work on Linux, but for some of it you need to be logged in as root. Type “cat /etc/fstab” to see all the mountable devices, including floppy disks and CD players. Type “df” to see the devices currently mounted, and their free space. In the usual case you can even see the superblock: try “/sbin/dumpe2fs /dev/hda1” where hda1 comes from the output of “df.” The name “dumpe2fs” is a casualty of history; it replaces the older “dumpfs.” The information produced is really just for diagnostic purposes.
Mostly file systems work for you silently. If you want to dig into Linux further, then there are plenty of tools that can be used as inspection points.
About the author
Nigel McFarlane is an open source software analyst and technologist with a broad background in technology and software engineering. He has an extensive programming background and degrees in computer science and physics. His latest book is “Rapid Application Development with Mozilla” from Prentice Hall PTR.
Источник