Re: /var corrupted.....

2006-11-05 Thread Gerard Seibert
On Saturday November 04, 2006 at 08:58:08 (AM) Eric Schuele wrote:


 Example from the man page:
   rebuild  all installed ports
 
portmanager -u -f
 
 This might be my silver bullet.  Its been running for quite some time 
 but it appears to be rebuilding everything and its full set of 
 dependencies.  Thanks!
 
 I've never used portmanager before.  Always portupgrade.  Nice.
 
 I was having all sorts of difficulties using `pkgdb -F`.  possibly 
 something else gone wrong on my machine.  It was complaining of 
 DB_PAGE_NOTFOUND? and complaining that it could not convert nil to 
 String?  Never seen it do that before.

You might have wanted to include the -l flag so you would have had a
log of what actually transpired. Not a big thing I guess. Be sure to run
'pkgdb -aFu' when portmanager finishes. It usually does not report any
errors, but it cannot hurt to be on the safe side.


-- 
Gerard
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /var corrupted.....

2006-11-04 Thread Eric Schuele

On 11/03/2006 18:39, Chris Whitehouse wrote:

Eric Schuele wrote:

On 11/02/2006 09:25, Robert Huff wrote:

Eric Schuele writes:


 How can I force a reinstall of a port and all its deps.


The port itself will handle anything above.


Well, that's what I had thought would happen, but the port does not 
seem to re-register the dependencies. It simply notes that they are 
present, and builds and registers the port I have attempted to `make 
install`. So for example if I go to /usr/ports/www/firefox, and `make 
install` it.  I only end up with firefox in my /var/db/pkg folder.  
None of its deps appear.



As for things below ... you're pretty much hosed.  If the pkg
db (or equivalent) existed, it would know which ports had been
installed and could rebuild things.
Without the pkg db, the only record of what _should_ be
installed is in your head.  




Have you tried sysutils/portmanager?

 From the man page:
 Determines ports that are out of date by comparing them to Makefiles
 downloaded through cvsup into the ports tree
So it looks like it doesn't require /var/db/pkg to work.

 -p or --pristine
  Updates a port if any dependency in it's /var/db/pkg/{port
 name}/+CONTENTS does not match what is installed. The effect is 
when
 a port is updated, any port who uses the updated port in it's 
depen-
 dency chain, no matter how deep, are rebuilt. Normally only 
ports one

 level up are rebuilt.

This looks like it rebuilds /var/db/pkg

You also probably need -f if your ports are up-to-date


Aha!
Example from the man page:
 rebuild  all installed ports

  portmanager -u -f

This might be my silver bullet.  Its been running for quite some time 
but it appears to be rebuilding everything and its full set of 
dependencies.  Thanks!


I've never used portmanager before.  Always portupgrade.  Nice.

I was having all sorts of difficulties using `pkgdb -F`.  possibly 
something else gone wrong on my machine.  It was complaining of 
DB_PAGE_NOTFOUND? and complaining that it could not convert nil to 
String?  Never seen it do that before.


Thanks!



I haven't tried it in these particular circumstances and I'm not sure if 
I've read the man page right but it's worth a try, it's a pretty clever 
utility.


Note if you try it on a single port you have to put the options after 
the port name, see the EXAMPLES section. Also see my recent question 
about portmanager and /tmp if you are rebuilding lots of ports in one 
session.


Chris














Yes.. this is now painfully obvious to me.  I guess in some way I had 
thought the pkg db, was simply a convenience.  But I now realize it is 
*the authority* on what is installed on your machine.  While I do plan 
to back it up from now on... I have added the two small scripts to my 
toolbox as well.


I alias the following as port_install
#!/bin/sh

#
# Used to create a log file of things I have installed on a machine
#

make install clean  \
printf `pwd`\t\t\t`date`\n  /root/maint/install/port_install.log

and the following as port_deinstall (mind the word-wrap).

#!/bin/sh

#
# Used to create a log file of things I have installed on a machine
#

SCRIPT_DIR=/root/maint/install

grep -v `pwd` $SCRIPT_DIR/port_install.log  
$SCRIPT_DIR/port_deinstall.log

rm $SCRIPT_DIR/port_install.log
mv $SCRIPT_DIR/port_deinstall.log $SCRIPT_DIR/port_install.log

make deinstall


Then I have a list of top level apps that *I* have installed.  I am 
using the above today, as I am reinstalling all top level apps.  :)



On the other hand, if you remeber
certain leaf ports installing them will drag in most of the
infrastructure.  (My candidates: OpenOffice, Firefox, Apache,
something involving Java. GIMP.)  It will still take time, but
within limits you can just let it run.

A scenario for the future: my /var/db/pkg has ~620 entries, and
totals just over 62mb.  Building a tarball took less than a minute
and ate another 60mb.  Might be a sound investment.



yeah... I have already added /var/db/pkg to my backup scripts.  I 
backup a bunch of system stuff every time I buildworld.  I just wasn't 
getting that.


Thanks.


Robert Huff
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
[EMAIL PROTECTED]








___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
[EMAIL PROTECTED]





--
Regards,
Eric
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /var corrupted.....

2006-11-04 Thread David King

How can I force a reinstall of a port and all its deps.


portupgrade -fRr xorg-clients, for instance
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /var corrupted.....

2006-11-03 Thread Andy Greenwood

couldn't you do something like this?

1) install all your big ports (leafs with lots of dependancies)
2) run this to get a list of depedancy ports which should already be
there, just not in /var/db/pkg

# pkg_info -ar | awk '/Dependency:/ {print $2}'|sort|uniq

3) install these ports so that they get added to /var/db/pkg.

Seems like this should work, am I missing something?

On 11/2/06, Eric Schuele [EMAIL PROTECTED] wrote:

On 11/02/2006 10:21, [EMAIL PROTECTED] wrote:
 On 11/2/06, Eric Schuele [EMAIL PROTECTED] wrote:
 On 11/01/2006 11:05, Karol Kwiatkowski wrote:
  On 01/11/2006 17:40, Eric Schuele wrote:
  Hello,
 
  [Running 6.2-PRERELEASE as of Oct 30th]
 
  My /var filesystem on my laptop died this morning.
 . . .
  2) If I have destroyed it what can I do at this point?  I have no full
  backup of /var.  I had nothing of any real importance on there.  Some
  MySQL data... but I've got that.  My package database comes to mind.
  but nothing of any personal value... just stuff to keep the OS on its
  feet.  So... if its gone... is there anyway to create a functional
 /var
  filesystem that will allow me to get back to work as usual?  Or
 is my
  only option a complete reinstall of everything?
 . . .
  The downside of this (option 2) is you'll loose some important
  information about your system, /var/db/pkg comes first to my mind.

 With respect to the package database...
 I've seen plenty of threads from folks having lost theirs in some form
 or fashion, and the solution always seems to be reinstall everything.
   Well, ok... sounds like a PITA, but how hard can it really be.  I only
 had 30-40 apps installed anyway.  With their deps it weighs in around
 350 ports total.  So I started to do just that.  Figured I'd reinstall
 in the order I originally installed in the first place.  Starting with
 Xorg.  I go to the port dir and `make install`, thinking it would
 reinstall it and all its deps.  No go.  It does in fact reinstall Xorg,
 but none of its deps because it finds them present.  Reinstalling 30-40
 apps is one things, having to manually go in and do 350... now thats a
 PITA!

 You might be able to force mount the dirty filesystem via
 mount -f
 You can also try
 dd if=/dev/ad0s1d of=some_dang_file_name*
 And then using mdconfig to play with the resulting file.
 mdconfig -t vnode -f some_dang_file_name -u 0  \
 mount -f /dev/md0c /mnt (maybe?)
 If you can get the /var/db/pkg dir off nicely, good luck.

Thanks.  Good ideas.  I'll play with this when I have time.  But after
using mtree to recreate the structure in /var (off the / filesystem),
things came back online pretty well.  I'll most likely get things put
back together and then just recreate the /var filesystem and copy
everything back into it.


 *(Note that this could take a long time on a 1 or 2G /var
 as it reads all of the empty blocks as well, you might want
 to hand it a bs= and a count= if you know about how much
 of /var was full at the time, man dd for more details. Also
 note that I have had faster results using sdd from ports)

 I had a similar problem a while back and both methods
 were able to read some of the data from the former /var,
 however the /var/db/pkg directory was trashed and I ended
 up having to fall back on the reinstall everything method.
 My method ended up consisting of:
 1) reinstalling portupgrade
 2) reinstalling several high level programs (opera, mplayer,
 gnumeric, any window managers,  so on)
 3) pkgdb -F which one at a time reinstalls everything depended
 on.  Make sure you have backups of any important files in
 /usr/local/etc as they may get overwritten.


I'm presently doing this now.  I have reinstalled most, if not all, top
level ports and will be running through `pkgdb -F` tomorrow.  I suspect
that will take a fair amount of time.

Thanks.
--
Regards,
Eric
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]




--
I'm nerdy in the extreme and whiter than sour cream
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /var corrupted.....

2006-11-03 Thread Eric Schuele

On 11/03/2006 08:42, Andy Greenwood wrote:

couldn't you do something like this?

1) install all your big ports (leafs with lots of dependancies)
2) run this to get a list of depedancy ports which should already be
there, just not in /var/db/pkg

# pkg_info -ar | awk '/Dependency:/ {print $2}'|sort|uniq

3) install these ports so that they get added to /var/db/pkg.

Seems like this should work, am I missing something?


I think the above would work just as well.  The only difference I see is 
that `pkgdb -F` is automating step 3 for me.  It's determining what 
dependencies are not present, and asking if I would like to install 
them.  This way, for example, I do not have to determine where 
vte-0.14.1_1 resides and cd in there, and make it... then on to the 
next.. etc.


Thanks.



On 11/2/06, Eric Schuele [EMAIL PROTECTED] wrote:

On 11/02/2006 10:21, [EMAIL PROTECTED] wrote:
 On 11/2/06, Eric Schuele [EMAIL PROTECTED] wrote:
 On 11/01/2006 11:05, Karol Kwiatkowski wrote:
  On 01/11/2006 17:40, Eric Schuele wrote:
  Hello,
 
  [Running 6.2-PRERELEASE as of Oct 30th]
 
  My /var filesystem on my laptop died this morning.
 . . .
  2) If I have destroyed it what can I do at this point?  I have 
no full
  backup of /var.  I had nothing of any real importance on there.  
Some
  MySQL data... but I've got that.  My package database comes to 
mind.
  but nothing of any personal value... just stuff to keep the OS 
on its

  feet.  So... if its gone... is there anyway to create a functional
 /var
  filesystem that will allow me to get back to work as usual?  Or
 is my
  only option a complete reinstall of everything?
 . . .
  The downside of this (option 2) is you'll loose some important
  information about your system, /var/db/pkg comes first to my mind.

 With respect to the package database...
 I've seen plenty of threads from folks having lost theirs in some form
 or fashion, and the solution always seems to be reinstall 
everything.
   Well, ok... sounds like a PITA, but how hard can it really be.  I 
only
 had 30-40 apps installed anyway.  With their deps it weighs in 
around

 350 ports total.  So I started to do just that.  Figured I'd reinstall
 in the order I originally installed in the first place.  Starting with
 Xorg.  I go to the port dir and `make install`, thinking it would
 reinstall it and all its deps.  No go.  It does in fact reinstall 
Xorg,
 but none of its deps because it finds them present.  Reinstalling 
30-40

 apps is one things, having to manually go in and do 350... now thats a
 PITA!

 You might be able to force mount the dirty filesystem via
 mount -f
 You can also try
 dd if=/dev/ad0s1d of=some_dang_file_name*
 And then using mdconfig to play with the resulting file.
 mdconfig -t vnode -f some_dang_file_name -u 0  \
 mount -f /dev/md0c /mnt (maybe?)
 If you can get the /var/db/pkg dir off nicely, good luck.

Thanks.  Good ideas.  I'll play with this when I have time.  But after
using mtree to recreate the structure in /var (off the / filesystem),
things came back online pretty well.  I'll most likely get things put
back together and then just recreate the /var filesystem and copy
everything back into it.


 *(Note that this could take a long time on a 1 or 2G /var
 as it reads all of the empty blocks as well, you might want
 to hand it a bs= and a count= if you know about how much
 of /var was full at the time, man dd for more details. Also
 note that I have had faster results using sdd from ports)

 I had a similar problem a while back and both methods
 were able to read some of the data from the former /var,
 however the /var/db/pkg directory was trashed and I ended
 up having to fall back on the reinstall everything method.
 My method ended up consisting of:
 1) reinstalling portupgrade
 2) reinstalling several high level programs (opera, mplayer,
 gnumeric, any window managers,  so on)
 3) pkgdb -F which one at a time reinstalls everything depended
 on.  Make sure you have backups of any important files in
 /usr/local/etc as they may get overwritten.


I'm presently doing this now.  I have reinstalled most, if not all, top
level ports and will be running through `pkgdb -F` tomorrow.  I suspect
that will take a fair amount of time.

Thanks.
--
Regards,
Eric
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
[EMAIL PROTECTED]








--
Regards,
Eric
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /var corrupted.....

2006-11-03 Thread Chris Whitehouse

Eric Schuele wrote:

On 11/02/2006 09:25, Robert Huff wrote:

Eric Schuele writes:


 How can I force a reinstall of a port and all its deps.


The port itself will handle anything above.


Well, that's what I had thought would happen, but the port does not seem 
to re-register the dependencies. It simply notes that they are present, 
and builds and registers the port I have attempted to `make install`. So 
for example if I go to /usr/ports/www/firefox, and `make install` it.  I 
only end up with firefox in my /var/db/pkg folder.  None of its deps 
appear.



As for things below ... you're pretty much hosed.  If the pkg
db (or equivalent) existed, it would know which ports had been
installed and could rebuild things.
Without the pkg db, the only record of what _should_ be
installed is in your head.  




Have you tried sysutils/portmanager?

From the man page:
 Determines ports that are out of date by comparing them to Makefiles
 downloaded through cvsup into the ports tree
So it looks like it doesn't require /var/db/pkg to work.

 -p or --pristine
  Updates a port if any dependency in it's /var/db/pkg/{port
 name}/+CONTENTS does not match what is installed. The effect 
is when
 a port is updated, any port who uses the updated port in it's 
depen-
 dency chain, no matter how deep, are rebuilt. Normally only 
ports one

 level up are rebuilt.

This looks like it rebuilds /var/db/pkg

You also probably need -f if your ports are up-to-date

I haven't tried it in these particular circumstances and I'm not sure if 
I've read the man page right but it's worth a try, it's a pretty clever 
utility.


Note if you try it on a single port you have to put the options after 
the port name, see the EXAMPLES section. Also see my recent question 
about portmanager and /tmp if you are rebuilding lots of ports in one 
session.


Chris














Yes.. this is now painfully obvious to me.  I guess in some way I had 
thought the pkg db, was simply a convenience.  But I now realize it is 
*the authority* on what is installed on your machine.  While I do plan 
to back it up from now on... I have added the two small scripts to my 
toolbox as well.


I alias the following as port_install
#!/bin/sh

#
# Used to create a log file of things I have installed on a machine
#

make install clean  \
printf `pwd`\t\t\t`date`\n  /root/maint/install/port_install.log

and the following as port_deinstall (mind the word-wrap).

#!/bin/sh

#
# Used to create a log file of things I have installed on a machine
#

SCRIPT_DIR=/root/maint/install

grep -v `pwd` $SCRIPT_DIR/port_install.log  $SCRIPT_DIR/port_deinstall.log
rm $SCRIPT_DIR/port_install.log
mv $SCRIPT_DIR/port_deinstall.log $SCRIPT_DIR/port_install.log

make deinstall


Then I have a list of top level apps that *I* have installed.  I am 
using the above today, as I am reinstalling all top level apps.  :)



On the other hand, if you remeber
certain leaf ports installing them will drag in most of the
infrastructure.  (My candidates: OpenOffice, Firefox, Apache,
something involving Java. GIMP.)  It will still take time, but
within limits you can just let it run.

A scenario for the future: my /var/db/pkg has ~620 entries, and
totals just over 62mb.  Building a tarball took less than a minute
and ate another 60mb.  Might be a sound investment.



yeah... I have already added /var/db/pkg to my backup scripts.  I backup 
a bunch of system stuff every time I buildworld.  I just wasn't getting 
that.


Thanks.


Robert Huff
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
[EMAIL PROTECTED]








___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /var corrupted.....

2006-11-02 Thread Eric Schuele

On 11/01/2006 11:05, Karol Kwiatkowski wrote:

On 01/11/2006 17:40, Eric Schuele wrote:

Hello,

[Running 6.2-PRERELEASE as of Oct 30th]

My /var filesystem on my laptop died this morning.  I had just
installed/enabled gdm.  I exited my wm and the machine spontaneously
rebooted.  Upon coming back up it said there was a bad superblock and to
try the one at offset 32.  It then said that one was bad.  'newfs -N'
tells me the next alt-superblock is at 160.  fsck says to run 'fsck -b
alt-superblk'.  However when you do that it says -b is an unknown
option.  So so googling leads me to fsck_ufs.  Which then says there are
more softupdate inconsistencies than I can say yes to.  Plus some
other issues.  I suspect something is very wrong in what I'm doing...
but I'm a trooper... so I forge ahead.  :)  I eventually end up doing a
'fsck_ufs -y' on it... and it bails out giving me something like
-73827348927342458734 BAD I=213423 many many times.  So

I may have totally destroyed my /var filesystem at this point. So my
questions are:

1) If not... pointers on what to do next would be *greatly* appreciated.

2) If I have destroyed it what can I do at this point?  I have no full
backup of /var.  I had nothing of any real importance on there.  Some
MySQL data... but I've got that.  My package database comes to mind.
but nothing of any personal value... just stuff to keep the OS on its
feet.  So... if its gone... is there anyway to create a functional /var
filesystem that will allow me to get back to work as usual?  Or is my
only option a complete reinstall of everything?


I'm not sure if option 1 is out of question (wait for other replies)
but to recreate /var directory tree you can use mtree(8) on newly
created partiton, something like:

# /usr/sbin/mtree -du -p /var -f /etc/mtree/BSD.var.dist



This worked well.  I have left my failed filesystem alone for now (on 
the off chance someone offers a fix).  I simply used mtree to 
reconstruct things in /usr/var/*.  A few straglers (cups, sendmail, etc) 
complain in the logs and I create their directories as needed.  But was 
a quick easy soln.  Thanks.



The downside of this (option 2) is you'll loose some important
information about your system, /var/db/pkg comes first to my mind. 


With respect to the package database...
I've seen plenty of threads from folks having lost theirs in some form 
or fashion, and the solution always seems to be reinstall everything. 
 Well, ok... sounds like a PITA, but how hard can it really be.  I only 
had 30-40 apps installed anyway.  With their deps it weighs in around 
350 ports total.  So I started to do just that.  Figured I'd reinstall 
in the order I originally installed in the first place.  Starting with 
Xorg.  I go to the port dir and `make install`, thinking it would 
reinstall it and all its deps.  No go.  It does in fact reinstall Xorg, 
but none of its deps because it finds them present.  Reinstalling 30-40 
apps is one things, having to manually go in and do 350... now thats a PITA!


How can I force a reinstall of a port and all its deps.

Thanks.


If
you don't have any backups try to recover anything you can first. Good
luck!


Thanks,
Eric


HTH,

Karol




--
Regards,
Eric
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /var corrupted.....

2006-11-02 Thread Robert Huff
Eric Schuele writes:

  How can I force a reinstall of a port and all its deps.

The port itself will handle anything above.
As for things below ... you're pretty much hosed.  If the pkg
db (or equivalent) existed, it would know which ports had been
installed and could rebuild things.
Without the pkg db, the only record of what _should_ be
installed is in your head.  On the other hand, if you remeber
certain leaf ports installing them will drag in most of the
infrastructure.  (My candidates: OpenOffice, Firefox, Apache,
something involving Java. GIMP.)  It will still take time, but
within limits you can just let it run.

A scenario for the future: my /var/db/pkg has ~620 entries, and
totals just over 62mb.  Building a tarball took less than a minute
and ate another 60mb.  Might be a sound investment.


Robert Huff
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /var corrupted.....

2006-11-02 Thread [EMAIL PROTECTED]

On 11/2/06, Eric Schuele [EMAIL PROTECTED] wrote:

On 11/01/2006 11:05, Karol Kwiatkowski wrote:
 On 01/11/2006 17:40, Eric Schuele wrote:
 Hello,

 [Running 6.2-PRERELEASE as of Oct 30th]

 My /var filesystem on my laptop died this morning.

. . .

 2) If I have destroyed it what can I do at this point?  I have no full
 backup of /var.  I had nothing of any real importance on there.  Some
 MySQL data... but I've got that.  My package database comes to mind.
 but nothing of any personal value... just stuff to keep the OS on its
 feet.  So... if its gone... is there anyway to create a functional /var
 filesystem that will allow me to get back to work as usual?  Or is my
 only option a complete reinstall of everything?

. . .

 The downside of this (option 2) is you'll loose some important
 information about your system, /var/db/pkg comes first to my mind.

With respect to the package database...
I've seen plenty of threads from folks having lost theirs in some form
or fashion, and the solution always seems to be reinstall everything.
  Well, ok... sounds like a PITA, but how hard can it really be.  I only
had 30-40 apps installed anyway.  With their deps it weighs in around
350 ports total.  So I started to do just that.  Figured I'd reinstall
in the order I originally installed in the first place.  Starting with
Xorg.  I go to the port dir and `make install`, thinking it would
reinstall it and all its deps.  No go.  It does in fact reinstall Xorg,
but none of its deps because it finds them present.  Reinstalling 30-40
apps is one things, having to manually go in and do 350... now thats a PITA!


You might be able to force mount the dirty filesystem via
mount -f
You can also try
dd if=/dev/ad0s1d of=some_dang_file_name*
And then using mdconfig to play with the resulting file.
mdconfig -t vnode -f some_dang_file_name -u 0  \
mount -f /dev/md0c /mnt (maybe?)
If you can get the /var/db/pkg dir off nicely, good luck.

*(Note that this could take a long time on a 1 or 2G /var
as it reads all of the empty blocks as well, you might want
to hand it a bs= and a count= if you know about how much
of /var was full at the time, man dd for more details. Also
note that I have had faster results using sdd from ports)

I had a similar problem a while back and both methods
were able to read some of the data from the former /var,
however the /var/db/pkg directory was trashed and I ended
up having to fall back on the reinstall everything method.
My method ended up consisting of:
1) reinstalling portupgrade
2) reinstalling several high level programs (opera, mplayer,
gnumeric, any window managers,  so on)
3) pkgdb -F which one at a time reinstalls everything depended
on.  Make sure you have backups of any important files in
/usr/local/etc as they may get overwritten.

--
--
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /var corrupted.....

2006-11-02 Thread Eric Schuele

On 11/02/2006 09:25, Robert Huff wrote:

Eric Schuele writes:


 How can I force a reinstall of a port and all its deps.


The port itself will handle anything above.


Well, that's what I had thought would happen, but the port does not seem 
to re-register the dependencies. It simply notes that they are present, 
and builds and registers the port I have attempted to `make install`. 
So for example if I go to /usr/ports/www/firefox, and `make install` it. 
 I only end up with firefox in my /var/db/pkg folder.  None of its deps 
appear.



As for things below ... you're pretty much hosed.  If the pkg
db (or equivalent) existed, it would know which ports had been
installed and could rebuild things.
Without the pkg db, the only record of what _should_ be
installed is in your head.  


Yes.. this is now painfully obvious to me.  I guess in some way I had 
thought the pkg db, was simply a convenience.  But I now realize it is 
*the authority* on what is installed on your machine.  While I do plan 
to back it up from now on... I have added the two small scripts to my 
toolbox as well.


I alias the following as port_install
#!/bin/sh

#
# Used to create a log file of things I have installed on a machine
#

make install clean  \
printf `pwd`\t\t\t`date`\n  /root/maint/install/port_install.log

and the following as port_deinstall (mind the word-wrap).

#!/bin/sh

#
# Used to create a log file of things I have installed on a machine
#

SCRIPT_DIR=/root/maint/install

grep -v `pwd` $SCRIPT_DIR/port_install.log  $SCRIPT_DIR/port_deinstall.log
rm $SCRIPT_DIR/port_install.log
mv $SCRIPT_DIR/port_deinstall.log $SCRIPT_DIR/port_install.log

make deinstall


Then I have a list of top level apps that *I* have installed.  I am 
using the above today, as I am reinstalling all top level apps.  :)



On the other hand, if you remeber
certain leaf ports installing them will drag in most of the
infrastructure.  (My candidates: OpenOffice, Firefox, Apache,
something involving Java. GIMP.)  It will still take time, but
within limits you can just let it run.

A scenario for the future: my /var/db/pkg has ~620 entries, and
totals just over 62mb.  Building a tarball took less than a minute
and ate another 60mb.  Might be a sound investment.



yeah... I have already added /var/db/pkg to my backup scripts.  I backup 
a bunch of system stuff every time I buildworld.  I just wasn't getting 
that.


Thanks.


Robert Huff
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]




--
Regards,
Eric
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /var corrupted.....

2006-11-02 Thread Eric Schuele

On 11/02/2006 10:21, [EMAIL PROTECTED] wrote:

On 11/2/06, Eric Schuele [EMAIL PROTECTED] wrote:

On 11/01/2006 11:05, Karol Kwiatkowski wrote:
 On 01/11/2006 17:40, Eric Schuele wrote:
 Hello,

 [Running 6.2-PRERELEASE as of Oct 30th]

 My /var filesystem on my laptop died this morning.

. . .

 2) If I have destroyed it what can I do at this point?  I have no full
 backup of /var.  I had nothing of any real importance on there.  Some
 MySQL data... but I've got that.  My package database comes to mind.
 but nothing of any personal value... just stuff to keep the OS on its
 feet.  So... if its gone... is there anyway to create a functional 
/var
 filesystem that will allow me to get back to work as usual?  Or 
is my

 only option a complete reinstall of everything?

. . .

 The downside of this (option 2) is you'll loose some important
 information about your system, /var/db/pkg comes first to my mind.

With respect to the package database...
I've seen plenty of threads from folks having lost theirs in some form
or fashion, and the solution always seems to be reinstall everything.
  Well, ok... sounds like a PITA, but how hard can it really be.  I only
had 30-40 apps installed anyway.  With their deps it weighs in around
350 ports total.  So I started to do just that.  Figured I'd reinstall
in the order I originally installed in the first place.  Starting with
Xorg.  I go to the port dir and `make install`, thinking it would
reinstall it and all its deps.  No go.  It does in fact reinstall Xorg,
but none of its deps because it finds them present.  Reinstalling 30-40
apps is one things, having to manually go in and do 350... now thats a 
PITA!


You might be able to force mount the dirty filesystem via
mount -f
You can also try
dd if=/dev/ad0s1d of=some_dang_file_name*
And then using mdconfig to play with the resulting file.
mdconfig -t vnode -f some_dang_file_name -u 0  \
mount -f /dev/md0c /mnt (maybe?)
If you can get the /var/db/pkg dir off nicely, good luck.


Thanks.  Good ideas.  I'll play with this when I have time.  But after 
using mtree to recreate the structure in /var (off the / filesystem), 
things came back online pretty well.  I'll most likely get things put 
back together and then just recreate the /var filesystem and copy 
everything back into it.




*(Note that this could take a long time on a 1 or 2G /var
as it reads all of the empty blocks as well, you might want
to hand it a bs= and a count= if you know about how much
of /var was full at the time, man dd for more details. Also
note that I have had faster results using sdd from ports)

I had a similar problem a while back and both methods
were able to read some of the data from the former /var,
however the /var/db/pkg directory was trashed and I ended
up having to fall back on the reinstall everything method.
My method ended up consisting of:
1) reinstalling portupgrade
2) reinstalling several high level programs (opera, mplayer,
gnumeric, any window managers,  so on)
3) pkgdb -F which one at a time reinstalls everything depended
on.  Make sure you have backups of any important files in
/usr/local/etc as they may get overwritten.



I'm presently doing this now.  I have reinstalled most, if not all, top 
level ports and will be running through `pkgdb -F` tomorrow.  I suspect 
that will take a fair amount of time.


Thanks.
--
Regards,
Eric
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


/var corrupted.....

2006-11-01 Thread Eric Schuele
Hello,

[Running 6.2-PRERELEASE as of Oct 30th]

My /var filesystem on my laptop died this morning.  I had just
installed/enabled gdm.  I exited my wm and the machine spontaneously
rebooted.  Upon coming back up it said there was a bad superblock and to
try the one at offset 32.  It then said that one was bad.  'newfs -N'
tells me the next alt-superblock is at 160.  fsck says to run 'fsck -b
alt-superblk'.  However when you do that it says -b is an unknown
option.  So so googling leads me to fsck_ufs.  Which then says there are
more softupdate inconsistencies than I can say yes to.  Plus some
other issues.  I suspect something is very wrong in what I'm doing...
but I'm a trooper... so I forge ahead.  :)  I eventually end up doing a
'fsck_ufs -y' on it... and it bails out giving me something like
-73827348927342458734 BAD I=213423 many many times.  So

I may have totally destroyed my /var filesystem at this point. So my
questions are:

1) If not... pointers on what to do next would be *greatly* appreciated.

2) If I have destroyed it what can I do at this point?  I have no full
backup of /var.  I had nothing of any real importance on there.  Some
MySQL data... but I've got that.  My package database comes to mind.
but nothing of any personal value... just stuff to keep the OS on its
feet.  So... if its gone... is there anyway to create a functional /var
filesystem that will allow me to get back to work as usual?  Or is my
only option a complete reinstall of everything?

Thanks,
Eric

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /var corrupted.....

2006-11-01 Thread Karol Kwiatkowski
On 01/11/2006 17:40, Eric Schuele wrote:
 Hello,
 
 [Running 6.2-PRERELEASE as of Oct 30th]
 
 My /var filesystem on my laptop died this morning.  I had just
 installed/enabled gdm.  I exited my wm and the machine spontaneously
 rebooted.  Upon coming back up it said there was a bad superblock and to
 try the one at offset 32.  It then said that one was bad.  'newfs -N'
 tells me the next alt-superblock is at 160.  fsck says to run 'fsck -b
 alt-superblk'.  However when you do that it says -b is an unknown
 option.  So so googling leads me to fsck_ufs.  Which then says there are
 more softupdate inconsistencies than I can say yes to.  Plus some
 other issues.  I suspect something is very wrong in what I'm doing...
 but I'm a trooper... so I forge ahead.  :)  I eventually end up doing a
 'fsck_ufs -y' on it... and it bails out giving me something like
 -73827348927342458734 BAD I=213423 many many times.  So
 
 I may have totally destroyed my /var filesystem at this point. So my
 questions are:
 
 1) If not... pointers on what to do next would be *greatly* appreciated.
 
 2) If I have destroyed it what can I do at this point?  I have no full
 backup of /var.  I had nothing of any real importance on there.  Some
 MySQL data... but I've got that.  My package database comes to mind.
 but nothing of any personal value... just stuff to keep the OS on its
 feet.  So... if its gone... is there anyway to create a functional /var
 filesystem that will allow me to get back to work as usual?  Or is my
 only option a complete reinstall of everything?

I'm not sure if option 1 is out of question (wait for other replies)
but to recreate /var directory tree you can use mtree(8) on newly
created partiton, something like:

# /usr/sbin/mtree -du -p /var -f /etc/mtree/BSD.var.dist

The downside of this (option 2) is you'll loose some important
information about your system, /var/db/pkg comes first to my mind. If
you don't have any backups try to recover anything you can first. Good
luck!

 Thanks,
 Eric

HTH,

Karol

-- 
Karol Kwiatkowski  freebsd at orchid dot homeunix dot org
OpenPGP: http://www.orchid.homeunix.org/carlos/gpg/0x06E09309.asc



signature.asc
Description: OpenPGP digital signature


Re: /var corrupted.....

2006-11-01 Thread Eric Schuele
On Wed, 2006-11-01 at 18:05 +0100, Karol Kwiatkowski wrote:
 On 01/11/2006 17:40, Eric Schuele wrote:
  Hello,
  
  [Running 6.2-PRERELEASE as of Oct 30th]
  
  My /var filesystem on my laptop died this morning.  I had just
  installed/enabled gdm.  I exited my wm and the machine spontaneously
  rebooted.  Upon coming back up it said there was a bad superblock and to
  try the one at offset 32.  It then said that one was bad.  'newfs -N'
  tells me the next alt-superblock is at 160.  fsck says to run 'fsck -b
  alt-superblk'.  However when you do that it says -b is an unknown
  option.  So so googling leads me to fsck_ufs.  Which then says there are
  more softupdate inconsistencies than I can say yes to.  Plus some
  other issues.  I suspect something is very wrong in what I'm doing...
  but I'm a trooper... so I forge ahead.  :)  I eventually end up doing a
  'fsck_ufs -y' on it... and it bails out giving me something like
  -73827348927342458734 BAD I=213423 many many times.  So
  
  I may have totally destroyed my /var filesystem at this point. So my
  questions are:
  
  1) If not... pointers on what to do next would be *greatly* appreciated.
  
  2) If I have destroyed it what can I do at this point?  I have no full
  backup of /var.  I had nothing of any real importance on there.  Some
  MySQL data... but I've got that.  My package database comes to mind.
  but nothing of any personal value... just stuff to keep the OS on its
  feet.  So... if its gone... is there anyway to create a functional /var
  filesystem that will allow me to get back to work as usual?  Or is my
  only option a complete reinstall of everything?
 
 I'm not sure if option 1 is out of question (wait for other replies)
 but to recreate /var directory tree you can use mtree(8) on newly
 created partiton, something like:
 
 # /usr/sbin/mtree -du -p /var -f /etc/mtree/BSD.var.dist

Ok... good tip thanks.  That would definitely leave my db/pkg out of
whack.  I wonder if a 'portupgrade -af' would fix that up?  

I'll wait for others to weigh in as well on option 1 before going this
way.

Thanks.

 
 The downside of this (option 2) is you'll loose some important
 information about your system, /var/db/pkg comes first to my mind. If
 you don't have any backups try to recover anything you can first. Good
 luck!
 
  Thanks,
  Eric
 
 HTH,
 
 Karol
 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /var corrupted.....

2006-11-01 Thread David King

Ok... good tip thanks.  That would definitely leave my db/pkg out of
whack.  I wonder if a 'portupgrade -af' would fix that up?


I doubt it. How would portupgrade know what is installed (to which -a  
applies) without a package database?





I'll wait for others to weigh in as well on option 1 before going this
way.

Thanks.



The downside of this (option 2) is you'll loose some important
information about your system, /var/db/pkg comes first to my mind. If
you don't have any backups try to recover anything you can first.  
Good

luck!


Thanks,
Eric


HTH,

Karol



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions- 
[EMAIL PROTECTED]


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]