File system architecture

This chapter desctibes how to navigate the MS Windows 10 filesystem, and the layout of the file system on HNM-PC.

Table of contents

Introduction

By default, MS Windows 10 file system is NTFS (New Technology File System). This has been the standard file system for Windows computers since the first release of yhe Windows NT operating system in 1993 (Window NT 3.1, so numbered to leverage on the popularity of Windows 3.1 that used the FAT16 file system). It is currently (2020) the most common file system in the world.

File explorer

The File Explorer (Win+E) is the primary tool for navigating the MS Windows 10 file system. As you can see in the screen dump below, the left sidebar has two submenus (show collapsed), headed “Quick Access” and “Desktop”.

w10_fe_01.png
The MS Windows 10 File Explorer.

The “Quick Access” submenu shows the eight most frequently used folders, and the 20 most recently accessed files. This is default selection when you open the File Explorer.

See alsoFor more about customizing what you see when you visit “Quick Access” this, see Lifewire: How to Use Windows 10 Quick Access.

The “Desktop” submenu shows the same icons that currently exists on your MS Windows 10 desktop. It also show the following items that is not on the desktop.

Drilling down in the submenus provides additional points of navigation. For instance, to see some special folders recognized by the File Explorer, as well as devices and drives connected tp the PC click the on “This PC”.

Other selections are also available, and they do what you expect them to do.

Local file system

Based upon MS Windows 10 default folders below “This PC”:

3D-objekter
Bilder
Dokunenter
Musikk
- Lydbøker
Nedlastinger
Skrivebord
Lokal disk (C:)
Fun
Work

Finding files

You may search for a file or an app by typing its name (or part of its name) into the search box on the taskbar. This is very fast and you'll see results for files and apps that is on your PC and OneDrive under “Best match”. If the file is an Windows 10 app, clicling on ot will run it. If no match is not found, web search will be suggested.

noteThis does not search the entire disk. I've not seen it documented anywhere, but it looks like it looks for your files under the folders “Documents” and “Pictures” that can be accessed from the Start-menu, as well as apps registered with Windows 10.

To search the entire PC or for a limited partof the directory tree, use the search provided by File Explorer Open File Explorer (Win+E, from the taskbar or Right click Start » File Explorer), then select a location from the left pane to search or browse. For example, select “This PC” to look in all devices and drives on your computer, or select a location in the left sidebar to limit search to files stored there. Select “All subfolders” to make the search recursive. Searching the entire PC recursively takes some time to complete.

w10_fesearch.png
Search files in or below OneDrive.

You may use wildcards (“*” will match any number of characters and “?” will match any character in a specific position). Typing only the start of the filename is equivalent to appending “*” to the name.

Templates and configuration files

These files live in a folder named “AppData\Roaming” below your Windows 10 home folder. As an example, for a user named “bob” the full path to this folder would be:

C:\Users\bob\Appdata\Roaming

This is where programs on your machine store data that is specific to your user account, such as default templates, configuration files, and other support data that applications might use.

Syncing between Windows and Unix

Unison is a file-synchronization tool developend by Benjamin C. Pierce that exists for OS/X, Unix, and Windows. It allows two replicas of a collection of files and directories to be stored on different hosts (or different directories on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other.

It is similar to the Unix utility rsync. The main differences are:

See the webmaster notes to learn how to install Unison on Ububtu.

To install Unison on MS Windows 10:

  1. Download latest stable release as a zip file.
  2. Unpack, this produces three exe-files:
    unison 2.48.4 GTK.exe, GUI, using GTK (formerly GIMP Tookit).
    unison 2.48.4 text.exe, CLI.
    unison-fsmonitor.exe, watches file system events (needed for the “watch” mode to work).

If the GUI version produces the following error message:

“This application has failed to start because libgtk-win32-2.0-0.dll was not found. Re-installing the application may fix this problem.”

… the GTK library is not installed. The simplest way to get this library is to install GIMP. You will also need to add the location of the library files (e.g. C:\Program Files\GIMP 2\32\bin to your Path environment variable.

noteMake sure you install exact the same version on all platforms. Things may go subtly wrong if the versions are not the same.

I recommend renaming “unison 2.48.4 text.exe” to “unison.exe” and moving it to a directory that is part of your $env:path.

You may get this error when testing the server (the source file must exist):

PS C:\>: unison -testserver foo.txt ssh://gisle@copymarks.no//tmp
Connecting server...
Fatal error: Error in starting shell connection:
No such file or directory [create_process(ssh)]

This means that Windows is unable to locate the ssh implementation (OpenSSH) that comes with MS Windows 10. The workaround is to copy ssh.exe into the directory you placed unison.exe. You should now be able to test the server:

PS C:\>: unison -testserver foo.txt ssh://gisle@copymarks.no//tmp
Contacting server...
Connected [//HNM-PC/C:/Users/gisle/foo.txt -> //copymarks.no//tmp]

The -testserver option just tests the connection. It exits without trying to copy any files.

To copy file, you need to supply the two directories you want to sync as arguments. The first is on the local machine, the second is one the remote. Without any options unison will report each unsynced file, recommending the direction of syncing based upon its timestamp. Answer “f” to follow recommendation, “/” to skip, or “<” or “>” to override direction. When you've stepped through all changes, you cn type “y” to proceed, or “q” to terminate without changing anything. Below is anexample.

PS C:\>: unison foobar ssh://gisle@copymarks.no//home/gisle/foobar
Contacting server...
…
Reconciling changes

local         copymarks.no
        <---- changed    aaa.txt  [f] f
        <=?=> changed    bbb.txt  [f] /
        ====> changed    ccc.txt  [f] >

Proceed with propgating updates? [] y
Propagating updates
…

To run this without any interaction, add the -batch option.

PS C:\>: unison -batch foobar ssh://gisle@copymarks.no//home/gisle/foobar

In the case of conflict Unison will always default to the newest copy, even this means deleting the destination. You will, however, get the following warning:

The root of one of the replicas has been completely emptied.
Unison may delete everything in the other replica.  (Set the
'confirmbigdel' preference to false to disable this check.)

Do you really want to proceed? [] y

Typing “y” here will delete the file, unless you override the direction of the sync like this:

deleted  ---->            aaa.txt  [f] <

This should produce the following, indicated that the file will be copied to replace the deleted file.

deleted  <====            aaa.txt  [f] <

However, if you get this warning, the tip below is a better solution:

tipIf you've gotten into a state you don't understand, deleting the archive files on both locations (these are files with names like arNNNNNNNNN in the .unison directory) will return you to a blank slate. If the replicas are identical, then deleting the archives is always safe. If they are not identical, then deleting the archives will always cause all files that exist on one side but not the other to be copied, and will report conflicts for all non-identical files that do exist on both sides.

https://superuser.com/questions/1272832/how-do-i-ignore-folders-and-its-subdirectories-in-unison-sync/1338659 https://superuser.com/questions/1350918/unison-not-ignoring-paths https://alliance.seas.upenn.edu/~bcpierce/wiki/index.php?n=Main.UnisonFAQTroubleshooting

Final word

[TBA]


Last update: 2020-03-28 [gh].