Ronald Klop | 2 Oct 2010 14:02

Re: Data loss when hard shutdown!

On Sat, 02 Oct 2010 13:28:59 +0200, Phan Quoc Hien  
<phanquochien <at> gmail.com> wrote:

> hello everybody.
> I'm new to freebsd, When I hard shutdown my freebsd box..it caused lost  
> some
> file. I used UFS2. How can prevent that? or recovery my file?
> Thanks!
>

By hard shutdown you mean pulling the power plug?

UFS2 (and most other filesystems on other operating systems) guarantee  
consistency of metadata (filenames, directory structures, etc.) after a  
crash. However it is possible to loose the last X seconds of unwritten  
data. That can be the complete contents of a new file.

If it is really important you can mount your filesystem 'sync' see 'man  
mount' in which case it will become slow, but more up-to-date.

Ronald.
_______________________________________________
freebsd-fs <at> freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "freebsd-fs-unsubscribe <at> freebsd.org"

Phan Quoc Hien | 2 Oct 2010 14:19
Picon
Gravatar

Re: Data loss when hard shutdown!

Thanks for your respond.!
Yes. I pulled the power plug .
I edited rc.conf and save it then pulling the power plug. And system boot
next time rc.conf is a blank file...!

On Sat, Oct 2, 2010 at 7:02 PM, Ronald Klop <ronald-freebsd8 <at> klop.yi.org>wrote:

> On Sat, 02 Oct 2010 13:28:59 +0200, Phan Quoc Hien <phanquochien <at> gmail.com>
> wrote:
>
>  hello everybody.
>> I'm new to freebsd, When I hard shutdown my freebsd box..it caused lost
>> some
>> file. I used UFS2. How can prevent that? or recovery my file?
>> Thanks!
>>
>>
> By hard shutdown you mean pulling the power plug?
>
> UFS2 (and most other filesystems on other operating systems) guarantee
> consistency of metadata (filenames, directory structures, etc.) after a
> crash. However it is possible to loose the last X seconds of unwritten data.
> That can be the complete contents of a new file.
>
> If it is really important you can mount your filesystem 'sync' see 'man
> mount' in which case it will become slow, but more up-to-date.
>
> Ronald.
> _______________________________________________
> freebsd-fs <at> freebsd.org mailing list
(Continue reading)

Bruce Cran | 2 Oct 2010 14:25
Picon
Gravatar

Re: Data loss when hard shutdown!

On Sat, 2 Oct 2010 19:19:12 +0700
Phan Quoc Hien <phanquochien <at> gmail.com> wrote:

> Thanks for your respond.!
> Yes. I pulled the power plug .
> I edited rc.conf and save it then pulling the power plug. And system
> boot next time rc.conf is a blank file...!

This is an issue when using SoftUpdates - data isn't written to disk
immediately, and empty files are produced when power is lost. See
http://www.freebsd.org/doc/en/books/faq/disks.html#SAFE-SOFTUPDATES for
details. 

--

-- 
Bruce Cran
_______________________________________________
freebsd-fs <at> freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "freebsd-fs-unsubscribe <at> freebsd.org"

Phan Quoc Hien | 2 Oct 2010 14:49
Picon
Gravatar

Re: Data loss when hard shutdown!

Thank for your respond. I have checked my fstab file. I didn't see any
option about SoftUpdates for my / partition.

On Sat, Oct 2, 2010 at 7:25 PM, Bruce Cran <bruce <at> cran.org.uk> wrote:

> On Sat, 2 Oct 2010 19:19:12 +0700
> Phan Quoc Hien <phanquochien <at> gmail.com> wrote:
>
> > Thanks for your respond.!
> > Yes. I pulled the power plug .
> > I edited rc.conf and save it then pulling the power plug. And system
> > boot next time rc.conf is a blank file...!
>
> This is an issue when using SoftUpdates - data isn't written to disk
> immediately, and empty files are produced when power is lost. See
> http://www.freebsd.org/doc/en/books/faq/disks.html#SAFE-SOFTUPDATES for
> details.
>
> --
> Bruce Cran
>

--

-- 
Best regards,
Mr.Hien
E-mail: phanquochien <at> gmail.com
Website: www.mrhien.info
_______________________________________________
freebsd-fs <at> freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-fs
(Continue reading)

Ronald Klop | 2 Oct 2010 14:59

Re: Data loss when hard shutdown!

On Sat, 02 Oct 2010 14:49:50 +0200, Phan Quoc Hien  
<phanquochien <at> gmail.com> wrote:

> Thank for your respond. I have checked my fstab file. I didn't see any
> option about SoftUpdates for my / partition.

When you give the command 'mount' you will see several lines like this.

/dev/ad8s1d on /var (ufs, local, soft-updates)

Softupdates can be enabled/disabled with the command tunefs. See 'man  
tunefs'.

My advice is to not pull the power plug after changing critical files, but  
to reboot cleanly. Than there is no problem for 99% of the time and your  
computer is fast also.
Or is there a reason for you to prefer the power plug?

Ronald.

> On Sat, Oct 2, 2010 at 7:25 PM, Bruce Cran <bruce <at> cran.org.uk> wrote:
>
>> On Sat, 2 Oct 2010 19:19:12 +0700
>> Phan Quoc Hien <phanquochien <at> gmail.com> wrote:
>>
>> > Thanks for your respond.!
>> > Yes. I pulled the power plug .
>> > I edited rc.conf and save it then pulling the power plug. And system
>> > boot next time rc.conf is a blank file...!
>>
(Continue reading)

Phan Quoc Hien | 2 Oct 2010 15:07
Picon
Gravatar

Re: Data loss when hard shutdown!

The reason is power supply problems! Thank for your respond again.
Have a nice day.

On Sat, Oct 2, 2010 at 7:59 PM, Ronald Klop <ronald-freebsd8 <at> klop.yi.org>wrote:

> On Sat, 02 Oct 2010 14:49:50 +0200, Phan Quoc Hien <phanquochien <at> gmail.com>
> wrote:
>
>  Thank for your respond. I have checked my fstab file. I didn't see any
>> option about SoftUpdates for my / partition.
>>
>
> When you give the command 'mount' you will see several lines like this.
>
> /dev/ad8s1d on /var (ufs, local, soft-updates)
>
> Softupdates can be enabled/disabled with the command tunefs. See 'man
> tunefs'.
>
> My advice is to not pull the power plug after changing critical files, but
> to reboot cleanly. Than there is no problem for 99% of the time and your
> computer is fast also.
> Or is there a reason for you to prefer the power plug?
>
> Ronald.
>
>
>
>  On Sat, Oct 2, 2010 at 7:25 PM, Bruce Cran <bruce <at> cran.org.uk> wrote:
>>
(Continue reading)

Šimun Mikecin | 2 Oct 2010 15:10
Picon

Re: Data loss when hard shutdown!

2010/10/2, Phan Quoc Hien <phanquochien <at> gmail.com>:
> The reason is power supply problems! Thank for your respond again.
> Have a nice day.

In that case, ZFS should be your friend! :-)
_______________________________________________
freebsd-fs <at> freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "freebsd-fs-unsubscribe <at> freebsd.org"

Phan Quoc Hien | 2 Oct 2010 15:26
Picon
Gravatar

Re: Data loss when hard shutdown!

On Sat, Oct 2, 2010 at 7:59 PM, Ronald Klop <ronald-freebsd8 <at> klop.yi.org>wrote:

> On Sat, 02 Oct 2010 14:49:50 +0200, Phan Quoc Hien <phanquochien <at> gmail.com>
> wrote:
>
>  Thank for your respond. I have checked my fstab file. I didn't see any
>> option about SoftUpdates for my / partition.
>>
>
> When you give the command 'mount' you will see several lines like this.
>
> /dev/ad8s1d on /var (ufs, local, soft-updates)
>
> Softupdates can be enabled/disabled with the command tunefs. See 'man
> tunefs'.
>
> When I run mount command. it shown:
$ mount
/dev/ad0s1a on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
--

-- 
Best regards,
Mr.Hien
E-mail: phanquochien <at> gmail.com
Website: www.mrhien.info
_______________________________________________
freebsd-fs <at> freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "freebsd-fs-unsubscribe <at> freebsd.org"

(Continue reading)

Jeremy Chadwick | 2 Oct 2010 16:21

Re: Data loss when hard shutdown!

On Sat, Oct 02, 2010 at 08:26:48PM +0700, Phan Quoc Hien wrote:
> On Sat, Oct 2, 2010 at 7:59 PM, Ronald Klop <ronald-freebsd8 <at> klop.yi.org>wrote:
> 
> > On Sat, 02 Oct 2010 14:49:50 +0200, Phan Quoc Hien <phanquochien <at> gmail.com>
> > wrote:
> >
> >  Thank for your respond. I have checked my fstab file. I didn't see any
> >> option about SoftUpdates for my / partition.
> >>
> >
> > When you give the command 'mount' you will see several lines like this.
> >
> > /dev/ad8s1d on /var (ufs, local, soft-updates)
> >
> > Softupdates can be enabled/disabled with the command tunefs. See 'man
> > tunefs'.
> >
> > When I run mount command. it shown:
> $ mount
> /dev/ad0s1a on / (ufs, local)
> devfs on /dev (devfs, local, multilabel)

I didn't see anyone mention this to you in the thread, but:

By default in FreeBSD (during the installation phase), softupdates are
explicitly **not** applied to the root filesystem.  This is intentional,
but the reason for it I do not know.  I imagine it's justified though.

--

-- 
| Jeremy Chadwick                                   jdc <at> parodius.com |
(Continue reading)

Bruce Cran | 2 Oct 2010 16:30
Picon
Gravatar

Re: Data loss when hard shutdown!

On Sat, 2 Oct 2010 07:21:45 -0700
Jeremy Chadwick <freebsd <at> jdc.parodius.com> wrote:

> By default in FreeBSD (during the installation phase), softupdates are
> explicitly **not** applied to the root filesystem.  This is
> intentional, but the reason for it I do not know.  I imagine it's
> justified though.

See http://www.freebsd.org/doc/en/books/faq/disks.html#SAFE-SOFTUPDATES

--

-- 
Bruce Cran
_______________________________________________
freebsd-fs <at> freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "freebsd-fs-unsubscribe <at> freebsd.org"

Ronald Klop | 2 Oct 2010 14:42

Re: Data loss when hard shutdown!

On Sat, 02 Oct 2010 14:19:12 +0200, Phan Quoc Hien  
<phanquochien <at> gmail.com> wrote:

> Thanks for your respond.!
> Yes. I pulled the power plug .
> I edited rc.conf and save it then pulling the power plug. And system boot
> next time rc.conf is a blank file...!

Don't pull the power plug if you don't have to. The command to reboot is  
'shutdown -r now' and than all pending data will be saved safely.

Ronald.

> On Sat, Oct 2, 2010 at 7:02 PM, Ronald Klop  
> <ronald-freebsd8 <at> klop.yi.org>wrote:
>
>> On Sat, 02 Oct 2010 13:28:59 +0200, Phan Quoc Hien  
>> <phanquochien <at> gmail.com>
>> wrote:
>>
>>  hello everybody.
>>> I'm new to freebsd, When I hard shutdown my freebsd box..it caused lost
>>> some
>>> file. I used UFS2. How can prevent that? or recovery my file?
>>> Thanks!
>>>
>>>
>> By hard shutdown you mean pulling the power plug?
>>
>> UFS2 (and most other filesystems on other operating systems) guarantee
(Continue reading)


Gmane