# From UFS to UFS+Journaling



## polhallen (May 20, 2013)

Hey all! 

I discovered that my root filesystem is not journaling. Can I convert a root UFS filesystem adding journal support? Or is there a "hack" to do this? Another thing: creating a new filesystem (to another freebsd FreeBSD machine) what options do I do?

`# newfs -J -U -L data /dev/ada1p0`

How does UFS support a power crash?

Thanks!

Pol


----------



## pkubaj (May 20, 2013)

http://www.freebsd.org/doc/en/articles/gjournal-desktop/configure-journal.html
http://www.freebsd.org/doc/en/books/handbook/disks-adding.html

Crash power is handled by journalling and soft updates. fsck is started at booting.


----------



## kpa (May 20, 2013)

The journaling is basically a shortcut that can be taken to bring back the filesystem to a clean state after an improper shutdown. If it fails there is always fsck(8). Note that there are still some problems with softupdate journaling on FreeBSD 9.1. If you need to do  UFS snapshots of a live UFS filesystem, for example with the -L flag of dump(8), you should turn off the journal.


----------



## polhallen (May 20, 2013)

Thanks! So... what I should do? Keep UFS or reinstall the whole system with UFS  + journaling? My anxiety is a black-out or crash of the system. I'd like to have an automatic check after boot without having to physically go to machine. This machine is for my friend and I can use SSH (he lives 50 km from me).

Thanks!

Pol


----------



## kpa (May 20, 2013)

The system should recover that same on its own without the journaling, it will just take little while longer to run full fsck(8) instead of just replaying the journal.


----------



## pkubaj (May 20, 2013)

Small OT, is the issue with backup still present? I thought it was fixed in 9-STABLE about a year ago (after releasing 9.0-RELEASE).


----------



## wblock@ (May 21, 2013)

Some problems were fixed, others remain.  If you use dump(8)/restore(8), avoid SUJ.


----------



## SirDice (May 22, 2013)

How big is the root filesystem? If it's relatively small I'd just leave journaling off. 

I do have a 2TB external HD and I've enabled journaling after I had used it for a while, a fsck(8) takes a very long time without a journal. You should be able to enable it when the filesystem is unmounted. For the root filesystem it may work to boot to single user mode so the root filesystem is mounted read-only. Otherwise you'll have to boot from a live CD.

`# tunefs -j enable /dev/ada1p0`

See tunefs(8) for more options.


----------

