Re: Recovering files after a crash

2009-08-20 Thread Erik Norgaard

Roland Smith wrote:

On Wed, Aug 19, 2009 at 09:59:32AM +0200, Erik Norgaard wrote:
Thanks, I couldn't decipher these GEOM_LABEL messages, nice to know that 
I can stop worrying. But for future incidents, the second question remains:


1. How do I best protect my system from disk errors in case of a crash?


One word: _backups_!

I have a headless system with no spare head to attach and doing 
single-user blind-folded is further complicated by the fact that I'm not 
native to the US keyboard layout, so my top priority is that it boots.


If you can connect it to another system (that has a monitor) via a serial
null-modem cable and you enable the serial console (see the Handbook), you can
watch the boot process from the other system.

If you don't have anothe machine closeby, you should get a network-accessible
KVM switch with serial connectors. [maybe something like this:
http://www.knuerr.com/web/en/products/kvm/kvm-switch-dominion-ksx.html] 
With such a switch and the serial console you should be able to watch the boot

of the machine remotely.


Ok, maybe I didn't make myself clear: I wish to protect my filesystem 
against corruption in case of a crash such that it will boot.


- How can I configure my system to reduce the probability that a crash 
will cause file system inconsistencies that require single user mode 
intervention?


backups does not answer that question, they are great for recovering 
lost data but don't prevent the crash.


KVM and serial console don't answer the question either. Certainly, it 
makes it easier to work headless. But neither prevent disk corruption.


UPS reduces the likelyhood of a crash in case of a power failure, but 
that doesn't answer the question either.


Asume that a crash will happen, how do I prevent or reduce the risk of a 
crash causing disk corruption such that the system will boot up nicely 
again?


BR, Erik
--
Erik Nørgaard
Ph: +34.666334818/+34.915211157  http://www.locolomo.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: Recovering files after a crash

2009-08-20 Thread Sebastian Seidl

Erik Norgaard wrote:

Roland Smith wrote:

On Wed, Aug 19, 2009 at 09:59:32AM +0200, Erik Norgaard wrote:
Thanks, I couldn't decipher these GEOM_LABEL messages, nice to know 
that I can stop worrying. But for future incidents, the second 
question remains:


1. How do I best protect my system from disk errors in case of a crash?


One word: _backups_!

I have a headless system with no spare head to attach and doing 
single-user blind-folded is further complicated by the fact that I'm 
not native to the US keyboard layout, so my top priority is that it 
boots.


If you can connect it to another system (that has a monitor) via a 
serial
null-modem cable and you enable the serial console (see the 
Handbook), you can

watch the boot process from the other system.

If you don't have anothe machine closeby, you should get a 
network-accessible

KVM switch with serial connectors. [maybe something like this:
http://www.knuerr.com/web/en/products/kvm/kvm-switch-dominion-ksx.html] 
With such a switch and the serial console you should be able to watch 
the boot

of the machine remotely.


Ok, maybe I didn't make myself clear: I wish to protect my filesystem 
against corruption in case of a crash such that it will boot.


- How can I configure my system to reduce the probability that a crash 
will cause file system inconsistencies that require single user mode 
intervention?


backups does not answer that question, they are great for recovering 
lost data but don't prevent the crash.


KVM and serial console don't answer the question either. Certainly, it 
makes it easier to work headless. But neither prevent disk corruption.


UPS reduces the likelyhood of a crash in case of a power failure, but 
that doesn't answer the question either.


Asume that a crash will happen, how do I prevent or reduce the risk of 
a crash causing disk corruption such that the system will boot up 
nicely again?


BR, Erik
If u want to reduce the posibility of data corruption I sugest using a 
smart UPS with management software installed and configured so that 
before battery power goes out it will do a clean shutdown and also 
restart the system when AC power is restored (see apcupsd).

That is what I'm using.

Regards,
Sebastian Seidl
___
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: Recovering files after a crash

2009-08-20 Thread Ruben de Groot
 Erik Norgaard wrote:
 
 Ok, maybe I didn't make myself clear: I wish to protect my filesystem 
 against corruption in case of a crash such that it will boot.
 
 - How can I configure my system to reduce the probability that a crash 
 will cause file system inconsistencies that require single user mode 
 intervention?
 
 backups does not answer that question, they are great for recovering 
 lost data but don't prevent the crash.
 
 KVM and serial console don't answer the question either. Certainly, it 
 makes it easier to work headless. But neither prevent disk corruption.
 
 UPS reduces the likelyhood of a crash in case of a power failure, but 
 that doesn't answer the question either.
 
 Asume that a crash will happen, how do I prevent or reduce the risk of 
 a crash causing disk corruption such that the system will boot up 
 nicely again?

You could mount all system partitions ro (using memory fs for /tmp and /var)
Setting the noauto option for your data partitions in fstab will 
allmost guarantee the system to boot to multiuser after a crash. You can then 
mount these partitions from a script in for example rc.local. If these
mounts fail, the system will then not drop to single user mode.

Ruben

___
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: Recovering files after a crash

2009-08-19 Thread Erik Norgaard

Roland Smith wrote:

On Tue, Aug 18, 2009 at 09:30:15AM +0200, Erik Norgaard wrote:



The problem is that I have no idea which files were affected.

So, now some questions:

First, how do I determine which files were corrupted? And how do I 
recover these files?


From what you have shown it is impossible to tell.

A short filesystem check (fsck -F) is run at boot time. If no major problems
are found, the complete filesystem check is done later in the background.
The result of that check will be visible in /var/log/messages.


Thanks, I couldn't decipher these GEOM_LABEL messages, nice to know that 
I can stop worrying. But for future incidents, the second question remains:


1. How do I best protect my system from disk errors in case of a crash?

I have a headless system with no spare head to attach and doing 
single-user blind-folded is further complicated by the fact that I'm not 
native to the US keyboard layout, so my top priority is that it boots.


2. When you have lost inodes or similar errors and stuff ends up in 
lost+found, how do you figure out what it was and recover the lost files?


Is there a FBSD crash guide?

Thanks, Erik
--
Erik Nørgaard
Ph: +34.666334818/+34.915211157  http://www.locolomo.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: Recovering files after a crash

2009-08-19 Thread Roland Smith
On Wed, Aug 19, 2009 at 09:59:32AM +0200, Erik Norgaard wrote:
 Thanks, I couldn't decipher these GEOM_LABEL messages, nice to know that 
 I can stop worrying. But for future incidents, the second question remains:
 
 1. How do I best protect my system from disk errors in case of a crash?

One word: _backups_!

Multiple solutions are possible. You can have two disks in RAID1 (mirroring,
which is like instantaneous backup). Or you can have two disks where the
second is kept up-to-date by rsync running from cron (this also gives you a
limited undo functionality if you accidentaly delete a file). Ar you can back
up to a NAS, USB connected disk or to tape.

 I have a headless system with no spare head to attach and doing 
 single-user blind-folded is further complicated by the fact that I'm not 
 native to the US keyboard layout, so my top priority is that it boots.

If you can connect it to another system (that has a monitor) via a serial
null-modem cable and you enable the serial console (see the Handbook), you can
watch the boot process from the other system.

If you don't have anothe machine closeby, you should get a network-accessible
KVM switch with serial connectors. [maybe something like this:
http://www.knuerr.com/web/en/products/kvm/kvm-switch-dominion-ksx.html] 
With such a switch and the serial console you should be able to watch the boot
of the machine remotely.

 2. When you have lost inodes or similar errors and stuff ends up in 
 lost+found, how do you figure out what it was and recover the lost files?

You have to look at the contents of the files in lostfound. Usually it is
easier to restore from backup.

 Is there a FBSD crash guide?

Not that I know of. The only guidance that really matter would be make sure
you have backed up critical data. No need for elaborate guides. :-)

Roland
-- 
R.F.Smith   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)


pgpT0irSuljL3.pgp
Description: PGP signature


Re: Recovering files after a crash

2009-08-19 Thread Lowell Gilbert
Roland Smith rsm...@xs4all.nl writes:

 Is there a FBSD crash guide?

 Not that I know of. The only guidance that really matter would be make sure
 you have backed up critical data. No need for elaborate guides. :-)

Any data that isn't securely backed up, including offsite, isn't really
important to you.  However, having other measures in place can be
worthwhile as well, for convenience if nothing else.  

In particular, a UPS is usually a good idea, and monitoring it so the
system does a clean shutdown before running out of power can make it
even more so (not in all situations, but in many).  Integrity checks on
files will catch damage to files; ZFS does this automatically, but
mtree(8) can do various types of checksums to serve the purpose as well.

-- 
Lowell Gilbert, embedded/networking software engineer, Boston area
http://be-well.ilk.org/~lowell/
___
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


Recovering files after a crash

2009-08-18 Thread Erik Norgaard

Hi:

I woke op to a crash this morning after a powerfailure, and now dmesg 
shows this:


WARNING: / was not properly dismounted
GEOM_LABEL: Label ufsid/442f8ac1c0db9af2 removed.
GEOM_LABEL: Label for provider ad6s1a is ufsid/442f8ac1c0db9af2.
GEOM_LABEL: Label ufsid/442f8ac5a7fa5dda removed.
GEOM_LABEL: Label for provider ad6s1d is ufsid/442f8ac5a7fa5dda.
GEOM_LABEL: Label ufsid/442f8ac950b22b46 removed.
GEOM_LABEL: Label for provider ad6s1e is ufsid/442f8ac950b22b46.
GEOM_LABEL: Label ufsid/442f8ad3e5c88ab8 removed.
GEOM_LABEL: Label for provider ad6s1f is ufsid/442f8ad3e5c88ab8.
GEOM_LABEL: Label ufsid/442f8ad59f647596 removed.
GEOM_LABEL: Label for provider ad6s1g is ufsid/442f8ad59f647596.
GEOM_LABEL: Label ufsid/442f8ae2200a8064 removed.
GEOM_LABEL: Label for provider ad6s1h is ufsid/442f8ae2200a8064.
GEOM_LABEL: Label ufsid/442f8ac1c0db9af2 removed.
GEOM_LABEL: Label ufsid/442f8ac5a7fa5dda removed.
GEOM_LABEL: Label ufsid/442f8ac950b22b46 removed.
GEOM_LABEL: Label ufsid/442f8ad3e5c88ab8 removed.
GEOM_LABEL: Label ufsid/442f8ad59f647596 removed.
GEOM_LABEL: Label ufsid/442f8ae2200a8064 removed.

The problem is that I have no idea which files were affected.

So, now some questions:

First, how do I determine which files were corrupted? And how do I 
recover these files?


Second, / is mostly read-only, in fact, I can't think of any file on 
that partition that should be modified at all: /tmp is on a separate 
partition, I have source files on /usr/local rather than the default, in 
fact, only root user files are modified during a normal day, but it's 
been days since I logged in as root.


How do I protect read-only files from being corrupted in the first 
place? I have tried mounting / read-only but that gave a load of other 
problems.


Thanks, Erik


--
Erik Nørgaard
Ph: +34.666334818/+34.915211157  http://www.locolomo.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: Recovering files after a crash

2009-08-18 Thread Ruben de Groot
On Tue, Aug 18, 2009 at 09:30:15AM +0200, Erik Norgaard typed:
 Hi:
 
 I woke op to a crash this morning after a powerfailure, and now dmesg 
 shows this:
 
 WARNING: / was not properly dismounted
 GEOM_LABEL: Label ufsid/442f8ac1c0db9af2 removed.
 GEOM_LABEL: Label for provider ad6s1a is ufsid/442f8ac1c0db9af2.
 GEOM_LABEL: Label ufsid/442f8ac5a7fa5dda removed.
 GEOM_LABEL: Label for provider ad6s1d is ufsid/442f8ac5a7fa5dda.
 GEOM_LABEL: Label ufsid/442f8ac950b22b46 removed.
 GEOM_LABEL: Label for provider ad6s1e is ufsid/442f8ac950b22b46.
 GEOM_LABEL: Label ufsid/442f8ad3e5c88ab8 removed.
 GEOM_LABEL: Label for provider ad6s1f is ufsid/442f8ad3e5c88ab8.
 GEOM_LABEL: Label ufsid/442f8ad59f647596 removed.
 GEOM_LABEL: Label for provider ad6s1g is ufsid/442f8ad59f647596.
 GEOM_LABEL: Label ufsid/442f8ae2200a8064 removed.
 GEOM_LABEL: Label for provider ad6s1h is ufsid/442f8ae2200a8064.
 GEOM_LABEL: Label ufsid/442f8ac1c0db9af2 removed.
 GEOM_LABEL: Label ufsid/442f8ac5a7fa5dda removed.
 GEOM_LABEL: Label ufsid/442f8ac950b22b46 removed.
 GEOM_LABEL: Label ufsid/442f8ad3e5c88ab8 removed.
 GEOM_LABEL: Label ufsid/442f8ad59f647596 removed.
 GEOM_LABEL: Label ufsid/442f8ae2200a8064 removed.
 
 The problem is that I have no idea which files were affected.

According to this, no file was affected.

 So, now some questions:
 
 First, how do I determine which files were corrupted? And how do I 
 recover these files?
 
 Second, / is mostly read-only, in fact, I can't think of any file on 
 that partition that should be modified at all: /tmp is on a separate 
 partition, I have source files on /usr/local rather than the default, in 
 fact, only root user files are modified during a normal day, but it's 
 been days since I logged in as root.
 
 How do I protect read-only files from being corrupted in the first 
 place? I have tried mounting / read-only but that gave a load of other 
 problems.
 
 Thanks, Erik
 
 
 -- 
 Erik N?rgaard
 Ph: +34.666334818/+34.915211157  http://www.locolomo.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
___
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: Recovering files after a crash

2009-08-18 Thread Roland Smith
On Tue, Aug 18, 2009 at 09:30:15AM +0200, Erik Norgaard wrote:
 Hi:
 
 I woke op to a crash this morning after a powerfailure, and now dmesg 
 shows this:
 
 WARNING: / was not properly dismounted

 GEOM_LABEL: Label ufsid/442f8ac1c0db9af2 removed.
 GEOM_LABEL: Label for provider ad6s1a is ufsid/442f8ac1c0db9af2.
 GEOM_LABEL: Label ufsid/442f8ac5a7fa5dda removed.
 GEOM_LABEL: Label for provider ad6s1d is ufsid/442f8ac5a7fa5dda.
 GEOM_LABEL: Label ufsid/442f8ac950b22b46 removed.
 GEOM_LABEL: Label for provider ad6s1e is ufsid/442f8ac950b22b46.
 GEOM_LABEL: Label ufsid/442f8ad3e5c88ab8 removed.
 GEOM_LABEL: Label for provider ad6s1f is ufsid/442f8ad3e5c88ab8.
 GEOM_LABEL: Label ufsid/442f8ad59f647596 removed.
 GEOM_LABEL: Label for provider ad6s1g is ufsid/442f8ad59f647596.
 GEOM_LABEL: Label ufsid/442f8ae2200a8064 removed.
 GEOM_LABEL: Label for provider ad6s1h is ufsid/442f8ae2200a8064.
 GEOM_LABEL: Label ufsid/442f8ac1c0db9af2 removed.
 GEOM_LABEL: Label ufsid/442f8ac5a7fa5dda removed.
 GEOM_LABEL: Label ufsid/442f8ac950b22b46 removed.
 GEOM_LABEL: Label ufsid/442f8ad3e5c88ab8 removed.
 GEOM_LABEL: Label ufsid/442f8ad59f647596 removed.
 GEOM_LABEL: Label ufsid/442f8ae2200a8064 removed.

These GEOM_LABEL messagel have nothing to do with filesystem checks. You can
ignore them.
 
 The problem is that I have no idea which files were affected.
 
 So, now some questions:
 
 First, how do I determine which files were corrupted? And how do I 
 recover these files?

From what you have shown it is impossible to tell.

A short filesystem check (fsck -F) is run at boot time. If no major problems
are found, the complete filesystem check is done later in the background.
The result of that check will be visible in /var/log/messages.

Roland
-- 
R.F.Smith   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)


pgpLX208Rt80N.pgp
Description: PGP signature


Re: Recovering files after a crash

2009-08-18 Thread Al Plant

Erik Norgaard wrote:

Hi:

I woke op to a crash this morning after a powerfailure, and now dmesg 
shows this:


WARNING: / was not properly dismounted
GEOM_LABEL: Label ufsid/442f8ac1c0db9af2 removed.
GEOM_LABEL: Label for provider ad6s1a is ufsid/442f8ac1c0db9af2.
GEOM_LABEL: Label ufsid/442f8ac5a7fa5dda removed.
GEOM_LABEL: Label for provider ad6s1d is ufsid/442f8ac5a7fa5dda.
GEOM_LABEL: Label ufsid/442f8ac950b22b46 removed.
GEOM_LABEL: Label for provider ad6s1e is ufsid/442f8ac950b22b46.
GEOM_LABEL: Label ufsid/442f8ad3e5c88ab8 removed.
GEOM_LABEL: Label for provider ad6s1f is ufsid/442f8ad3e5c88ab8.
GEOM_LABEL: Label ufsid/442f8ad59f647596 removed.
GEOM_LABEL: Label for provider ad6s1g is ufsid/442f8ad59f647596.
GEOM_LABEL: Label ufsid/442f8ae2200a8064 removed.
GEOM_LABEL: Label for provider ad6s1h is ufsid/442f8ae2200a8064.
GEOM_LABEL: Label ufsid/442f8ac1c0db9af2 removed.
GEOM_LABEL: Label ufsid/442f8ac5a7fa5dda removed.
GEOM_LABEL: Label ufsid/442f8ac950b22b46 removed.
GEOM_LABEL: Label ufsid/442f8ad3e5c88ab8 removed.
GEOM_LABEL: Label ufsid/442f8ad59f647596 removed.
GEOM_LABEL: Label ufsid/442f8ae2200a8064 removed.

The problem is that I have no idea which files were affected.

So, now some questions:

First, how do I determine which files were corrupted? And how do I 
recover these files?


Second, / is mostly read-only, in fact, I can't think of any file on 
that partition that should be modified at all: /tmp is on a separate 
partition, I have source files on /usr/local rather than the default, in 
fact, only root user files are modified during a normal day, but it's 
been days since I logged in as root.


How do I protect read-only files from being corrupted in the first 
place? I have tried mounting / read-only but that gave a load of other 
problems.


Thanks, Erik



Aloha Eric,

I think those readings are normal. But anything on a dead server is 
cause for alarm. I have lost powersupplies and mobo's from power strikes.


If you have power failures often you can put the server (or desktop) on 
an extended UPSupply. Here on the island we have some power outages that 
last as long as 8 hours. (Earthquakes and wind storms).2 years ago I 
took  2 small UPS and hooked them to 2 stationary gelcell batteries 
(similar to car batteries), which allow my equipment of 4 servers to 
remain up and online for at least 10 hours.


~Al Plant - Honolulu, Hawaii -  Phone:  808-284-2740
  + http://hawaiidakine.com + http://freebsdinfo.org +
  + http://aloha50.net   - Supporting - FreeBSD 6.* - 7.* - 8.* +
   email: n...@hdk5.net 
All that's really worth doing is what we do for others.- Lewis Carrol

___
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