Re: What happened to /home?
On Wed, 23 Dec 2009 23:11:12 -0800, Charlie Kester wrote: > On Wed 23 Dec 2009 at 22:33:20 PST Giorgos Keramidas wrote: >>> I can still login as regular user, and when I run 'pwd -P' the output is >>> / and then it goes back to the prompt. Output of 'ls -ld /home is: >>> >>> lrwxr-xr-x 1 root wheel 8 Dec 18 12:08 /home -> usr/home >> >> That's your problem right there. /home does not point to the absolute >> path of '/usr/home' but to a *relative* path starting at whatever >> happens to be your current directory when you access '/home'. > > Are you sure about that? On Thu, 24 Dec 2009 08:57:11 +0100, Erik Trulsson wrote: > Wrong. Relative paths in symlinks start at the symlink is in, not the > current directory. I.e. that the symlink is relative should not be a > problem. (Under AmigaOS relative symlinks worked as you describe, which > made them a PITA and fairly useless, but under Unix relative symlinks have a > more sane behaviour.) On Thu, 24 Dec 2009 10:12:21 +0100, Polytropon wrote: > That's quite strange... I have /home@ -> export/home and /export lives > on another partition. But I have no problems accessing files as > /home/poly/some/dir/some/file from wherever I am. As far as I > understood, relative symlinks prefix their respective targets always > with their own location, so /home + export/home gives /export/home. You are all right, of course. I shouldn't post moments before jumping on a bus without testing. Something else is the real problem. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: What happened to /home?
> > I hope you won't see something like > > % cd mnt/poly > mnt/poly: Not a directory. > > % file mnt/poly > mnt/poly: cannot open `mnt/poly' (Bad file descriptor) > That is exactly what I saw, and nothing worked to try and fix the problem. So, as I indicated in an earlier post, I ran fsck -y on the /usr partition and was finally able to deep six /home. No real catastrophe because I had all of /home backed up. So, I just did a mkdir of /home and repopulated it. I'm still scratching my head as to what caused the initial problem. There was no power failure or anything like that. I remember that all of a sudden when I booted the laptop I got this message (I forgot to include this in my first post): FreeBSD/.i386 boot Default:0:ad(0,a)/boot/loader boot: Hardly the normal opening screen, and I had to hit enter to proceed. First time I did that that the computer booted OK, the second time it broke. The only thing that changed between the time of the normal boot and the problem is that I installed a USB hub to this old Compaq because it only has one USB port. Who knows. Rem ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: What happened to /home?
On Thu, 24 Dec 2009 08:33:20 +0200, Giorgos Keramidas wrote: > That's your problem right there. /home does not point to the absolute > path of '/usr/home' but to a *relative* path starting at whatever > happens to be your current directory when you access '/home'. > > Try replacing your current /home symlink with a link to /usr/home > instead: > > # cd / > # rm -f home > # ln -s /usr/home home > > Then the symlink should start working in a more useful manner. That's quite strange... I have /home@ -> export/home and /export lives on another partition. But I have no problems accessing files as /home/poly/some/dir/some/file from wherever I am. As far as I understood, relative symlinks prefix their respective targets always with their own location, so /home + export/home gives /export/home. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: What happened to /home?
On Wed, 23 Dec 2009 15:01:11 -0800, Rem P Roberti wrote: > Today I booted my laptop and discovered that /home was gone. Well...not > exactly..but for all intents and purposes. The system isn't seeing it > although I can see it when I cd to /. But if I try and cd to /home from > there the system tells me "home:Not a directory." > What happened, and > what can I do about it? Do some diagnostics. First, check inode, using the ls -i command both for the symlink /home and its target /usr/home. Then use fdsb -i /dev/ad0s1a (or the proper device) and use "inode n" (with n = the inode number you discovered by the ls commands above) to check the information. Finally, but that may be risky, run fsck on all partitions that could be affected (e. g. if /home is on ad0s1a, but home data is on ad0s1h). I still have a problem like you described: I cannot cd to my home directory (/home/poly) with the same error message. The problem is: The home directories inode information is gone. It is still mentioned in the higher level inode (/home), but the inode this entry is pointing to isn't existing. Furthermore, all files inside this directory, at least those at the next lower level, refer to the inode with the "back-pointer", which references an inode non-existing. If any symlinks are involved, check them. Check "file x" (with x = the directory name) to see what it is. I hope you won't see something like % cd mnt/poly mnt/poly: Not a directory. % file mnt/poly mnt/poly: cannot open `mnt/poly' (Bad file descriptor) Do you have the Midnight Commander installed? If your /home line is given red color and preceded by a "?", size 0, and dated Jan 1 1970, then... well... it indicates a problem some way similar to mine... Good luck! I hope you have good backups. That's not an impolite joke. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: What happened to /home?
On Thu, Dec 24, 2009 at 08:33:20AM +0200, Giorgos Keramidas wrote: > On Wed, 23 Dec 2009 15:40:13 -0800, Rem P Roberti > wrote: > >On 2009.12.24 00:21:47 +, Pieter de Goeje wrote: > >>On Thursday 24 December 2009 00:01:11 Rem P Roberti wrote: > >>> Today I booted my laptop and discovered that /home was gone. > >>> Well...not exactly..but for all intents and purposes. The system > >>> isn't seeing it although I can see it when I cd to /. But if I try > >>> and cd to /home from there the system tells me "home:Not a > >>> directory." What happened, and what can I do about it? > >> > >> Usually /home is a symlink to /usr/home. Perhaps the symlink is > >> busted? What it the output of `ls -ld /home' ? If you can still login > >> as a regular user, what does `pwd -P' say just after you are logged > >> in? > > > > I can still login as regular user, and when I run 'pwd -P' the output is > > / and then it goes back to the prompt. Output of 'ls -ld /home is: > > > > lrwxr-xr-x 1 root wheel 8 Dec 18 12:08 /home -> usr/home > > That's your problem right there. /home does not point to the absolute > path of '/usr/home' but to a *relative* path starting at whatever > happens to be your current directory when you access '/home'. Wrong. Relative paths in symlinks start at the symlink is in, not the current directory. I.e. that the symlink is relative should not be a problem. (Under AmigaOS relative symlinks worked as you describe, which made them a PITA and fairly useless, but under Unix relative symlinks have a more sane behaviour.) -- Erik Trulsson ertr1...@student.uu.se ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: What happened to /home?
On Wed 23 Dec 2009 at 22:33:20 PST Giorgos Keramidas wrote: On Wed, 23 Dec 2009 15:40:13 -0800, Rem P Roberti wrote: On 2009.12.24 00:21:47 +, Pieter de Goeje wrote: On Thursday 24 December 2009 00:01:11 Rem P Roberti wrote: Today I booted my laptop and discovered that /home was gone. Well...not exactly..but for all intents and purposes. The system isn't seeing it although I can see it when I cd to /. But if I try and cd to /home from there the system tells me "home:Not a directory." What happened, and what can I do about it? Usually /home is a symlink to /usr/home. Perhaps the symlink is busted? What it the output of `ls -ld /home' ? If you can still login as a regular user, what does `pwd -P' say just after you are logged in? I can still login as regular user, and when I run 'pwd -P' the output is / and then it goes back to the prompt. Output of 'ls -ld /home is: lrwxr-xr-x 1 root wheel 8 Dec 18 12:08 /home -> usr/home That's your problem right there. /home does not point to the absolute path of '/usr/home' but to a *relative* path starting at whatever happens to be your current directory when you access '/home'. Are you sure about that? On my FreeBSD 8 system, I just tried this: cd /etc ls /home/ckester and the result was a listing of my home directory, not some directory under /etc. Yet the result of ls -ld /home on my system is the same as above. The symlink named "home" is found in the root directory "/" and the relative path usr/home is apparently relative to that root directory, not the current directory. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: What happened to /home?
On Wed, 23 Dec 2009 15:40:13 -0800, Rem P Roberti wrote: >On 2009.12.24 00:21:47 +, Pieter de Goeje wrote: >>On Thursday 24 December 2009 00:01:11 Rem P Roberti wrote: >>> Today I booted my laptop and discovered that /home was gone. >>> Well...not exactly..but for all intents and purposes. The system >>> isn't seeing it although I can see it when I cd to /. But if I try >>> and cd to /home from there the system tells me "home:Not a >>> directory." What happened, and what can I do about it? >> >> Usually /home is a symlink to /usr/home. Perhaps the symlink is >> busted? What it the output of `ls -ld /home' ? If you can still login >> as a regular user, what does `pwd -P' say just after you are logged >> in? > > I can still login as regular user, and when I run 'pwd -P' the output is > / and then it goes back to the prompt. Output of 'ls -ld /home is: > > lrwxr-xr-x 1 root wheel 8 Dec 18 12:08 /home -> usr/home That's your problem right there. /home does not point to the absolute path of '/usr/home' but to a *relative* path starting at whatever happens to be your current directory when you access '/home'. Try replacing your current /home symlink with a link to /usr/home instead: # cd / # rm -f home # ln -s /usr/home home Then the symlink should start working in a more useful manner. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: What happened to /home?
On Wednesday 23 December 2009 15:46:57 Glen Barber wrote: > On Wed, Dec 23, 2009 at 7:43 PM, Mel Flynn > > wrote: > >> What does 'file /home' say? > > > > It is a symlink. What you really want to see is ls -l /home/. Note the > > trailing slash. > > It _should_ be a symlink, which is what I am getting at. No, it _is_ a symlink. ls says so: On Wed, Dec 23, 2009 at 6:40 PM, Rem P Roberti wrote: > lrwxr-xr-x 1 root wheel 8 Dec 18 12:08 /home -> usr/home ^ ^^^ The only thing file is gonna tell you that the symlink might be broken. # ls -l total 1 lrwxr-xr-x 1 root wheel 8 Dec 23 16:50 home -> usr/home drwxr-xr-x 3 root wheel 3 Dec 23 16:50 usr # ls -ld home/. drwxr-xr-x 2 root wheel 2 Dec 23 16:50 home/. # file home home: symbolic link to `usr/home' # chmod 000 usr/home # ls -ld home/. d- 2 root wheel 2 Dec 23 16:50 home/. # file home home: symbolic link to `usr/home' As you can see, file don't tell you much, while using ls -ld on the target will immediately show the problem. -- Mel ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: What happened to /home?
On 2009.12.23 17:45:38 +, Warren Block wrote: > On Wed, 23 Dec 2009, Rem P Roberti wrote: > > >Today I booted my laptop and discovered that /home was gone. Well...not > >exactly..but for all intents and purposes. The system isn't seeing it > >although I can see it when I cd to /. But if I try and cd to /home from > >there the system tells me "home:Not a directory." What happened, and > >what can I do about it? > > /home is (usually) a link to /usr/home. If there was some problem that > prevented /usr being mounted (power failure or crash with background > fsck disabled), or you booted in single user mode, it would act that > way. > > Does df show /usr is mounted? Yep...it was mounted. Something definitely got hosed. I ran fsck on /usr and there were a number of problems. Finally was able to delete the troubled directory and reinstall. Thankfully there was nothing of importance in /home and I had everything backed up so that I could re-populate the newly created /home. Rem ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: What happened to /home?
On Wed, Dec 23, 2009 at 7:43 PM, Mel Flynn wrote: >> >> What does 'file /home' say? > > It is a symlink. What you really want to see is ls -l /home/. Note the > trailing slash. It _should_ be a symlink, which is what I am getting at. Additionally, what does the output of 'mount' and 'cat /etc/fstab' ? -- Glen Barber ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: What happened to /home?
On Wed, 23 Dec 2009, Rem P Roberti wrote: Today I booted my laptop and discovered that /home was gone. Well...not exactly..but for all intents and purposes. The system isn't seeing it although I can see it when I cd to /. But if I try and cd to /home from there the system tells me "home:Not a directory." What happened, and what can I do about it? /home is (usually) a link to /usr/home. If there was some problem that prevented /usr being mounted (power failure or crash with background fsck disabled), or you booted in single user mode, it would act that way. Does df show /usr is mounted? -Warren Block * Rapid City, South Dakota USA ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: What happened to /home?
On Wednesday 23 December 2009 15:34:39 Glen Barber wrote: > Hi > > On Wed, Dec 23, 2009 at 6:40 PM, Rem P Roberti wrote: > > On 2009.12.24 00:21:47 +, Pieter de Goeje wrote: > >> On Thursday 24 December 2009 00:01:11 Rem P Roberti wrote: > >> > Today I booted my laptop and discovered that /home was gone. > >> > Well...not exactly..but for all intents and purposes. The system > >> > isn't seeing it although I can see it when I cd to /. But if I try > >> > and cd to /home from there the system tells me "home:Not a directory." > >> > What happened, and what can I do about it? > >> > > >> > Rem > >> > >> Usually /home is a symlink to /usr/home. Perhaps the symlink is busted? > >> What it the output of `ls -ld /home' ? If you can still login as a > >> regular user, what does `pwd -P' say just after you are logged in? > > > > I can still login as regular user, and when I run 'pwd -P' the output is > > / and then it goes back to the prompt. Output of 'ls -ld /home is: > > > > lrwxr-xr-x 1 root wheel 8 Dec 18 12:08 /home -> usr/home > > What does 'file /home' say? It is a symlink. What you really want to see is ls -l /home/. Note the trailing slash. -- Mel ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: What happened to /home?
Hi On Wed, Dec 23, 2009 at 6:40 PM, Rem P Roberti wrote: > On 2009.12.24 00:21:47 +, Pieter de Goeje wrote: >> On Thursday 24 December 2009 00:01:11 Rem P Roberti wrote: >> > Today I booted my laptop and discovered that /home was gone. Well...not >> > exactly..but for all intents and purposes. The system isn't seeing it >> > although I can see it when I cd to /. But if I try and cd to /home from >> > there the system tells me "home:Not a directory." What happened, and >> > what can I do about it? >> > >> > Rem >> >> Usually /home is a symlink to /usr/home. Perhaps the symlink is busted? What >> it the output of `ls -ld /home' ? If you can still login as a regular user, >> what does `pwd -P' say just after you are logged in? >> > > I can still login as regular user, and when I run 'pwd -P' the output is > / and then it goes back to the prompt. Output of 'ls -ld /home is: > > lrwxr-xr-x 1 root wheel 8 Dec 18 12:08 /home -> usr/home > What does 'file /home' say? -- Glen Barber ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: What happened to /home?
On 2009.12.24 00:21:47 +, Pieter de Goeje wrote: > On Thursday 24 December 2009 00:01:11 Rem P Roberti wrote: > > Today I booted my laptop and discovered that /home was gone. Well...not > > exactly..but for all intents and purposes. The system isn't seeing it > > although I can see it when I cd to /. But if I try and cd to /home from > > there the system tells me "home:Not a directory." What happened, and > > what can I do about it? > > > > Rem > > Usually /home is a symlink to /usr/home. Perhaps the symlink is busted? What > it the output of `ls -ld /home' ? If you can still login as a regular user, > what does `pwd -P' say just after you are logged in? > I can still login as regular user, and when I run 'pwd -P' the output is / and then it goes back to the prompt. Output of 'ls -ld /home is: lrwxr-xr-x 1 root wheel 8 Dec 18 12:08 /home -> usr/home Rem ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: What happened to /home?
On Wed, Dec 23, 2009 at 03:01:11PM -0800, Rem P Roberti wrote: > Today I booted my laptop and discovered that /home was gone. Well...not > exactly..but for all intents and purposes. The system isn't seeing it > although I can see it when I cd to /. But if I try and cd to /home from > there the system tells me "home:Not a directory." What happened, and > what can I do about it? Sounds like you may have written a file over it - an empty file maybe. Or something like that. jerry > > Rem > ___ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org" ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: What happened to /home?
On Thursday 24 December 2009 00:01:11 Rem P Roberti wrote: > Today I booted my laptop and discovered that /home was gone. Well...not > exactly..but for all intents and purposes. The system isn't seeing it > although I can see it when I cd to /. But if I try and cd to /home from > there the system tells me "home:Not a directory." What happened, and > what can I do about it? > > Rem Usually /home is a symlink to /usr/home. Perhaps the symlink is busted? What it the output of `ls -ld /home' ? If you can still login as a regular user, what does `pwd -P' say just after you are logged in? - Pieter ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"