0

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 takeown used 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 before takeown finished. 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 until takeown finished.
6
  • 1
    "I used the Windows Ctrl-drag to copy, since the Cygin cp would take much, much longer." - if the new temporary tree was on the same drive letter you would have been better to use cp -al. Or even mv. Either would have been fast yet still maintained Cygwin permissions and links without increasing disk space used. Commented Jan 12, 2023 at 7:51
  • 1
    You did look in the Recycle Bin for the deleted files, didn't you..? Usually any deletions get dropped there automatically by any Windows account Commented Jan 12, 2023 at 7:53
  • @roaima: The deletion was done using Cygwin's rm, so it bypassed the Recycle Bin. As for cp-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. Commented Jan 12, 2023 at 16:05
  • I also run Cygwin. I'd assumed that your housekeeping had been with Explorer rather than the shell command line Commented Jan 12, 2023 at 16:52
  • I think I'm just old. Command line usage is wired into my autonomous nervous system, so it takes very little cognitive effort to do things. In contrast, when I use the GUI, all of my mental energy is focused on navigating the GUI and moving the pointer all over the place to get at the buttons and widgets using the clickpad. I can't keep track of the simplest tasks that I am trying to do. Commented Jan 12, 2023 at 16:57

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.