Linux file system and windows file system

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 10 ltsb без шпионажа

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.

Linux vs Windows: What’s the Difference?

It’s time to make the big switch from your Windows or Mac OS operating system.

Mac OS uses a UNIX core. Your switch from Mac OS to Linux will be relatively smooth.

It’s the Windows users who will need some adjusting. In this tutorial will introduce the Linux OS and compare it with Windows.

Click here if the video is not accessible

Windows Vs. Linux File System

In Microsoft Windows, files are stored in folders on different data drives like C: D: E:

But, in Linux, files are ordered in a tree structure starting with the root directory.

This root directory can be considered as the start of the file system, and it further branches out various other subdirectories. The root is denoted with a forward slash ‘/’.

A general tree file system on your UNIX may look like this.

KEY DIFFERENCE

  • Linux is an open source operating system so user can change source code as per requirement whereas Windows OS is a commercial operating system so user doesn’t have access to source code.
  • Linux is very well secure as it is easy to detect bugs and fix whereas Windows has a huge user base, so it becomes a target of hackers to attack windows system.
  • Linux runs faster even with older hardware whereas windows are slower compared to Linux.
  • Linux peripherals like hard drives, CD-ROMs, printers are considered files whereas Windows, hard drives, CD-ROMs, printers are considered as devices
  • Linux files are ordered in a tree structure starting with the root directory whereas in Windows, files are stored in folders on different data drives like C: D: E:
  • In Linux you can have 2 files with the same name in the same directory while in Windows, you cannot have 2 files with the same name in the same folder.
  • In Linux you would find the system and program files in different directories whereas in Windows, system and program files are usually saved in C: drive.
Читайте также:  Microsoft windows professional 10 fqc 10364

Types of Files

In Linux and UNIX, everything is a file. Directories are files, files are files, and devices like Printer, mouse, keyboard etc.are files.

Let’s look into the File types in more detail.

General Files

General Files also called as Ordinary files. They can contain image, video, program or simply text. They can be in ASCII or a Binary format. These are the most commonly used files by Linux Users.

Directory Files

These files are a warehouse for other file types. You can have a directory file within a directory (sub-directory).You can take them as ‘Folders’ found in Windows operating system.

Device Files:

In MS Windows, devices like Printers, CD-ROM, and hard drives are represented as drive letters like G: H:. In Linux, there are represented as files.For example, if the first SATA hard drive had three primary partitions, they would be named and numbered as /dev/sda1, /dev/sda2 and /dev/sda3.

Note: All device files reside in the directory /dev/

All the above file types (including devices) have permissions, which allow a user to read, edit or execute (run) them. This is a powerful Linux/Unix feature. Access restrictions can be applied for different kinds of users, by changing permissions.

Windows Vs. Linux: Users

There are 3 types of users in Linux.

  1. Regular
  2. Administrative(root)
  3. Service

Regular User

A regular user account is created for you when you install Ubuntu on your system. All your files and folders are stored in /home/ which is your home directory. As a regular user, you do not have access to directories of other users.

Root User

Other than your regular account another user account called root is created at the time of installation. The root account is a superuser who can access restricted files, install software and has administrative privileges. Whenever you want to install software, make changes to system files or perform any administrative task on Linux; you need to log in as a root user. Otherwise, for general tasks like playing music and browsing the internet, you can use your regular account.

Service user

Linux is widely used as a Server Operating System. Services such as Apache, Squid, email, etc. have their own individual service accounts. Having service accounts increases the security of your computer. Linux can allow or deny access to various resources depending on the service.

Читайте также:  Windows phone nokia lumia 925

Note:

  1. You will not see service accounts in Ubuntu Desktop version.
  2. Regular accounts are called standard accounts in Ubuntu Desktop

In Windows, there are 4 types of user account types.

  1. Administrator
  2. Standard
  3. Child
  4. Guest

Windows Vs. Linux: File Name Convention

In Windows, you cannot have 2 files with the same name in the same folder. See below —

While in Linux, you can have 2 files with the same name in the same directory, provided they use different cases.

Windows Vs. Linux: HOME Directory

For every user in Linux, a directory is created as /home/

Consider, a regular user account «Tom». He can store his personal files and directories in the directory «/home/tom». He can’t save files outside his user directory and does not have access to directories of other users. For instance, he cannot access directory «/home/jerry» of another user account»Jerry».

The concept is similar to C:\Documents and Settings in Windows.

When you boot the Linux operating system, your user directory (from the above example /home/tom) is the default working directory. Hence the directory «/home/tom is also called the Home directory which is a misnomer.

The working directory can be changed using some commands which we will learn later.

Windows Vs. Linux: Other Directories

In Windows, System and Program files are usually saved in C: drive. But, in Linux, you would find the system and program files in different directories. For example, the boot files are stored in the /boot directory, and program and software files can be found under /bin, device files in /dev. Below are important Linux Directories and a short description of what they contain.

These are most striking differences between Linux and other Operating Systems. There are more variations you will observe when switching to Linux and we will discuss them as we move along in our tutorials.

Как использовать файловые системы Linux внутри Windows 10 с помощью WSL 2

Свежая инсайдерская сборка Windows 10 с индексом «20211» позволяет монтировать физические диски внутри WSL 2, тем самым открывая возможность получить доступ к файловым системам, не поддерживающимся Windows нативно (например, ext4). Если вы используете две системы параллельно на разных дисках, то теперь вы сможете получать доступ к файлам Linux из под Windows.

Подготовка

Для монтирования диска, необходимо открыть PowerShell с привилегиями администратора и выполнить следующую команду:

Для отображения всех доступных дисков надо выполнить:

wmic diskdrive list brief

Демонтировать диск из WSL 2 можно командой

Пути к дискам можно узнать в колонке DeviceID. Обычно он представлен в виде \\.\\\.\PHYSICALDRIVE*.

Доступ к файлам через «Проводник»

Как только диск смонтирован, к нему можно получить доступ через «Проводник», перейдя по пути \wsl$ и смонтировав папку.

Ограничения

По стандарту wsl —mount пытается смонтировать диск как ext4. Для того, чтобы указать другую файловую систему, необходимо использовать команду

Список всех доступных файловых систем можно узнать, введя

Также важно отметить, что только целые физические диски могут быть смонтированы в WSL 2. На текущий момент невозможно присоединить только один раздел. Кроме того, хотя и есть поддержка дисков USB, устройства USB Flash не могут подключаться к WSL 2.

Внимание: Это перевод статьи из блога Microsoft.

Оцените статью