# Can problems occur from not shutting down correctly?



## prdeltoid (Jun 16, 2010)

I read a long time ago that Unix can have damage done to it from shutting a computer off using the power button, or whatever. Power losses, etc. Is this true of FreeBSD? If it gets shut off by a power outage or some kind of brownout happens or hitting the power button... can any problems come up?


----------



## zeiz (Jun 17, 2010)

Technically yes: improper file systems unmounting. To avoid possible problems after unexpected power off boot in single user mode (option 4 on the boot screen), press Enter to get to # prompt and simply run

```
# fsck -p
```
In case of heavy damage you may be prompted to run *fsck* manually and confirm all the actions it does.


----------



## adamk (Jun 17, 2010)

Bear in mind that this is true of every operating system.  Certain filesystems are just better at recovering from unexpected shutdowns than others.

Adam


----------



## jb_fvwm2 (Jun 17, 2010)

In v5 & v6 an improper shutdown always
resulted in data loss.  Lately, v7, v8, 
data have not been lost (maybe I've been
lucky.)  However, in the case of filesystems
mounted on mountpoints, their bsdlabel often
becomes obliterated, so one must 

```
mount -o async -o force /dev/ad10.journal /mnt
```
 to access the data (I forget the
precise other filesystem-types examples, that
specific command is why I've become accustomed
to using gjournal on attached disks, the data
is (usually) still there although the drive cannot
be mounted without the "force" parameter. And
since fast writes to the external drives are often
the cause of the data/bsdlabel corruption/panic,
I've used the "bwlimit" parameter to rsync to
slow the copy down to where it is reliable. (See 
other posts).  
.....
Probably irrelevant mostly to permanently 
attached disks.
.....


----------

