I was doing housekeeping using the Windows adminstrator account, and I erased Cygwin's /etc folder tree.
I cannot reinstall Cygwin, as I was in the process of taking stock of what files I need to capture a snapshot of. In my world, this is a very nontrivial process.
What can I do to mitigate the damage and preserve functionality while I complete the process of mirroring selected content from Cygwin user and adminsitrator accounts? I use various Bash commands, zip, find, gvim, du, cygstart, cygpath, etc. I know that at least vimrc resides /etc, so I should try to avoid terminating the Gvim process.
I could try reinstalling everything that I've installed in Cygwin, but that means ending the current processes, e.g., X-Windows, xterm, gvim. If re-installation fails to solve the problem, I fear that I won't be able to re-launch the current programs.
Afternote: In preparation to re-install Cygwin, I mirrored the user account to a Windows folder that is outside of the Cygwin folder tree. I used the Windows Ctrl-drag to copy, since the Cygin cp would take much, much longer. In the process of diffing the original with the mirror image,
I find that soft links are not accurately reproduced, which I can live with.
The process of diff'ing the mirror image with the original is lengthy, so I tried launching a new mintty terminal to do other things. I'm finding that not even newly launched terminal windows behave as expected.
In Cygwin setup executable, unfortunately, choosing to re-install "All" yielded a message that nothing needed installing. If I try installing "All" (instead of re-installing), the setup executable simply terminates. I get the same result if I first uninstall "All", then installing everything from the local repository of packages on my laptop. In fact, the setup executable terminates abruptly with no messages even if I cycle through the views Pending, Up to Date, Not Installed, etc. Rebooting did not help.
It looks like I need to remove all vestiges of Cygwin [1] and install from scratch, including the trial and error determination of all the packages for the various tools. In the process, I had to restore /etc/fstab, /etc/vimrc, and /usr/share/vim/vimfiles from not-quite-up-to-date snapshots. These files/folders contained many laptop/desktop customizations.
Notes
[1] Removal process: https://avayaucblog.com/2021/05/07/remove-and-reinstall-cygwin
- I found that the
takeownused in the above process is a DOS command. and that it takes an extremely long time. While it was working, I used Windows Explorer to delete c:\cygwin64 beforetakeownfinished. This resulted in many prompts about non-administrator files that could not be erased, even after I logged into the non-administrator account and erased c:\cygwin64\home\The-non-administrator-account. Some of the non-administrator files seem to reside in /tmp and /var. Fully erasing these required alternating between administrator and non-administrator accounts. It may still have been worth it to not wait untiltakeownfinished.
cp -al. Or evenmv. Either would have been fast yet still maintained Cygwin permissions and links without increasing disk space used.rm, so it bypassed the Recycle Bin. As forcp-al, lots to read about there, especially regarding links and preservation of attributes. Without much knowledge of the two file systems under-the-hood, however, I suspect that contributing to the slowness of the copy is the fact that Cygwin is simply a layer on top of Windows rather than an actual Linux system. Windows Explorer may exploit means of mass transfer made available by Windows which Cygwin might not. All speculation.