/etc/fstab equivalent in Windows

6,096

Solution 1

It is a configuration file that contains information of all the partitions and storage devices in the computer.

No, it isn't. It's a configuration database for the mount command to consult, which may contain information about partitions and devices that don't even currently exist, and which may conversely not list things that do exist. It is, in essence, merely a way of supplying the filling for the blanks when one doesn't give all of the instructions explicity to the mount command.

The files that contain all of the actual mount information on Linux are /etc/mtab (an ordinary file maintained by the mount and umount programs themselves) and /proc/mounts (a file maintained by the kernel that reports the actual system state).

There's no equivalent to /etc/fstab in Windows NT because Windows NT does not work that way. Mounting volumes is not done by running a mount command. Nor is assigning a drive letter (which is done via a symbolic link in the Object Manager under \DosDevices) the same as mounting.

Assignation of a drive letter is done by associating a drive letter with an already mounted volume. Mounting is a process that involves sending a notification to a filesystem driver to mount itself on the volume. By the time that Windows NT gets to assigning a drive letter, it has often already mounted the volume. Mounting doesn't need user commands in order to happen. It's done in kernel mode as part of Plug and Play. The disc device driver tells the volume manager whenever a new disc comes along. The volume manager creates new mountable volumes (from information contained in the partition tables, LDM database, or elsewhere) for the individual or combined slices of such a disc. And the I/O manager mounts the volumes so created, trying each filesystem driver in turn, after that.

There's no configuration file for the mount command, because there isn't a mount command. Windows NT does not work that way.

Solution 2

Drive letter assignments are kept in the Registry, under HKLM\SYSTEM\MountedDevices, while filesystem mounts (Unix-style) are stored on the filesystem itself, as NTFS "junctions".

You can edit this information using mountvol or diskpart from command line, or diskmgmt.msc GUI. Do not edit the registry directly.

Share:
6,096
hari
Author by

hari

I'm still new to Java

Updated on September 18, 2022

Comments

  • hari
    hari over 1 year

    There's a file called /etc/fstab in Linux OS. It is a configuration file that contains information of all the partitions and storage devices in the computer. Basically it contains the mount information. So, my question is, is there a similar file in Windows OS that contains the mount information? If so, where is it located?

  • hari
    hari over 12 years
    @JdeBP: I don't understand this there isn't a mount command. I use the mountvol command for mounting and un-mounting an existing file system. Am I missing something here? Please let me know. I'm new to this stuff.
  • JdeBP
    JdeBP over 12 years
    The mountvol command doesn't do what a POSIX mount command does. mountvol operates, again, upon already mounted volumes. The giveaway is that one names the already mounted volume as a parameter to the command.
  • user2284570
    user2284570 over 10 years
    HKLM\SYSTEM\MountedDevices is only for the Win32/Win64 subsystems. The native part use other directories.