0

For many years, I've had home folder ~ correspond to c:\cygwin64\home\User.Name. I recently had a problem that I tried to solve by uninstalling and reinstalling Cygwin. Since I rarely do this, I went through the processof googling how to set the home directory away from c:\Users\User.Name to c:\cygwin64\home\User.Name. In /etc/nsswitch.conf, I ended up changing db_home: to /home/%U, which did the trick.

I then found that all of the previous folder trees rooted in ~ were gone. Of course I try to diligently back up snapshots of my work to a network drive, but being busy, I last did this 10 days ago. After spending time reconstructing content from material distributed all over the place, I've mitigated my losses.

I do wonder, however, is reinstalling Cygwin supposed to wipe out all of the content in ~, specifically when it corresponds to c:\cygwin64\home\User.Name?

I just now noticed that all of the lines in /etc/nsswitch.conf are commented out with a leading #, include the db_home: line. This means my setting had no effect. It seems that just by restarting Cygwin a few times (by which I mean launch mintty or X-windows + xterm) and shutting them down, ~ seemed to change by itself from c:\Users\User.Name to c:\cygwin64\home\User.Name. I'm not entirely sure, however, because I didn't really know what I was doing when I was messing around with changing the mapping of ~. However, I don't recall changing any files other than /etc/nsswitch.conf.

4
  • 1
    In my installation, $HOME is /home/chris, which corresponds to c:\cygwin\home\chris. I would have had to change stuff to get c:\users\chris as my home directory Commented Jun 2 at 15:33
  • Thanks for sharing. How long ago did you install Cygwin? Perhaps its related to new installation procedures, e.g., whether they use Windows environment variables by defaultt, and which variables. Commented Jun 2 at 15:56
  • 1
    Most recently, about 2 years ago Commented Jun 2 at 18:29
  • OK, thanks, Chris. Commented Jun 2 at 20:06

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.