Any cygwin experts here? Want answer fast

Perhaps this is in the wrong forum. If Mods choose to move it please change thread title as well:
GQ: Any cygwin experts here? Want answer fast
IMHO: Cygwin is fine, but needs a support group.
BBQ Pit: Very unhappy about cygwin today
MPSIMS: Talk to the idiot-savant … mostly idiot

I’ve been running cygwin under Windows 7 very happily for several months now. Our needs and patterns are very simple-minded: AFAIK we make few if any changes to either the cygwin or the Windows settings and environments. Yet today there was a sudden change for the worse. The first noticed surprise is that backspace key doesn’t work, acting more like space. Messages “unknown terminal type cygwin” appear. These (and other) errors seem to be due to the non-existence of /usr. I’m sure /usr existed until recently – frankly I pay little attention to such things, but notice a largish file I created in my home directory (in /home) that is obviously the output of ‘find /usr …’

There are mounts associated with /usr, though I never paid any attention before. Typing ‘df’ I see
C:/cygwin/bin mounted on /usr/bin
but ‘ls /cygwin/bin’ produces “No such file or directory” since there is no /usr.
(There’s also a mount shown for /usr/lib, but not /usr/share whose non-existence is the source of error messages produced when Xserver aborts.)

AFAIK we’ve done absolutely nothing to provoke change. Since my last run, one of my kids used the machine (but not cygwin) but insists that nothing unusual happened.

Moved from IMHO to General Questions.

Shot in the dark: Have you looked at the terminal settings for the cygwin window (right click on upper left icon, pick options, go to terminal – my machine has Type = xterm). I’ve never seen this under cygwin, but weird backspace behaviour was a staple of terminal emulation type problems back in the 90s.

I think the real problem is the unexplained loss of /usr … I misled (in the interest of completeness) by mentioning the first symptom. The bad terminal settings and other symptoms arise from ‘/usr/… not found’. Doing a ‘su septimus’ runs a tset from /home; and the backspace problem goes away. However at that point I can’t start the xserver. (I can run from the sys console in a degraded mode, but expect there may be further problems – the simpler workaround is to do needed stuff on an alternate Linux machine and wait for info on my problem.)

If I had accidentally done a ‘rm -rf /usr’ yesterday, that might explain the symptom – but that seems extremely unlikely.

Yeah, i’d think the quickest solution to the /usr thing is “re-install cygwin”, which isn’t all that useful an answer. :slight_smile:

One thought: Can you see usr though windows? I can find my cygwin usr dir in c:\cygwin\usr\ . If it’s still there on your distro, then we know it’s something in the cygwin setup not finding it correctly. If it’s not there, then there’s another way for it to have gone missing other than an accidental rm -rf.

Windows cannot see c:\cygwin\usr\ . What is the “another way for it to have gone missing.”

I guess I may need some reinstall. Is it easy to just download the default ‘/usr’ ? Complete reinstall may be harmless enough if I’m careful to back up my data carefully. Still, it would be nice to understand the mystery. I seldom visit ‘/’ and almost never type ‘rm -r’ so how the heck could ‘/usr’ just disappear? If it was a disk error, wouldn’t I be getting warnings of that somewhere?

I mean it having been messed up through windows, without even having gone into cygwin.

Maybe you can do a chkdsk before you reinstall to make sure there’s no disk error.

OK, I just did this. (To illustrate my ignorance I just now realize this requires right-clicking Command Prompt to click “Run as Admin.”)
One error is reported: “The Volume Bitmap is incorrect.” Should I rerun with the ‘/F’ option? I’m so paranoid and insecure I’m reluctant …

In my experience, chkdsk /f does not usually make things any worse than they already are, if that’s the reassurance you need.

But at this point I think some flavour of user error is more likely than disk error as the origin of the problem.

Maybe /usr was accidentally renamed, not deleted? Try using the Search feature in the Windows start menu to look for the file mkfs.exe, normally in /usr/sbin (i.e. c:\cygwin\usr\sbin).

What’s left in c:\cygwin? I’ve got directories named home, cygdrive, dev, var, usr, lib, bin, etc, and tmp. Is usr the only one you’re missing?

I suspect reinstalling Cygwin wouldn’t mess up any user data under /home (but of course you should back up anyway). (I assume you don’t have a backup you can restore that includes /usr?)

Back up what you have left and re-install cygwin. I’ve been through that a few times. I only need to use it to run an occasional compile script, but several times when I come back to it after time has passed, things aren’t right, and I re-install to fix things.

Not found. :frowning:
It seems odd that Cygwin works as well as it does, without /usr . gcc starts OK, but can’t find stdio.h. Xserver fails without /usr/share. But I can get a terminal where backspace works via ‘su septimus’ by doing control-C when it complains about terminal type.

This is what I’ll do. I’ll create tarballs for the very most critical data, but also try a shortcut:
Rename /cygwin to /ocygwin ; reinstall cygwin ; Move /ocygwin/home et al to /cygwin.
Anything wrong with that approach?

If you’re trying to be safe, I’d suggest not moving /ocygwin/home..instead, copy the whole thing. Maybe cd into ocygwin and tar up home, then go back to cygwin and untar it.

That preserves the old information, just in case something goes horribly wrong.
This is assuming that your previous comment about tarring up the important data doesn’t include grabbing all of home.

I’ll provide closure to this thread, if only so that everyone can have a good laugh at septimus.

It’s probably almost impossible for anyone here to believe, but in the 1980’s I was a computer expert of sorts. I had limitations even then, but my idiot-savant nature seems increasingly to be mostly idiot. :frowning:

I once wrote a MS-Dos lookalike OS from scratch, but know almost nothing about Windows. Nevertheless I certainly knew that to search a file system with half a million files would take quite a while so I should have realized at once the search was incomplete when I got a “Not found” response almost admittedly. I’d Pit septimus for this stupidity and make a public mockery of myself, but my own self-contempt is enough shame.

Had I clicked “Search Computer” the file would have showed up.


Anyway, I reinstalled Cygwin, a long and clumsy process with my unreliable ISP.  I didn't want much but even the simplest most routine commands like 'make' or 'bc' have to be specified explicitly.  Finally I was back to normal, and falling into old routines.

I have a directory /www which is an image (or rather a superset) of my on-line website.  I typed 'find /www -name "*.gif" -print' to find an avatar I wanted to reuse.  I didn't find the avatar but ...

... lots of gif files showed up in /www/usr/share/doc  ... !!! :smack:

Possible source of original problem:  From the Windows desktop explorer (or whatever it's called) focused on cygwin I wanted to click on www, but due to hand tremor dragged the nearby usr to www as well.

(I'm not overfond of mouse-based interfaces.)