UFS UFS SU+J or gjournal?

Status
Not open for further replies.
B

badbrain

Guest


I found people have many different ideas about SU+J vs gjournal. I don't want to revive that old thread so I started a new one. Please share your thoughts, is SU+J or gjournal more suitable for my usage? My concern is about boot time and data loss in case of unclean shutdown. Thanks.
 

tankist02

Well-Known Member

Reaction score: 43
Messages: 310

I had data loses with SU+J in case of unclean shutdown (e.g. lost electricity). And I vaguely remember somebody recommended gjournal as a reliable way to restore data on UFS in case of unclean shutdowns.
 
OP
OP
B

badbrain

Guest


I had data loses with SU+J in case of unclean shutdown (e.g. lost electricity). And I vaguely remember somebody recommended gjournal as a reliable way to restore data on UFS in case of unclean shutdowns.
What about boot time when everything is normal? I also concerned about boot time as I shutdown my computer regularly.
 

Wozzeck.Live

Member

Reaction score: 113
Messages: 77

UFS with SU + J IS NOT RELIABLE
I confirm 1000 times, I have completely lost several OSes since I use FreeBSD (since FreeBSD 8)
I have never lost any system with UFS + gjournal even following severe hardware failures as power interruptions.

UFS + gjournal is just a little bit slower but it really meets the last journalization standards and is nearly as robust as ZFS
Other BIG advantage : UFS + gjournal IS FULLY compatible with UFS snapshot, required if you use "dump" to backup restore your system, or simply to freeze an image of a system further reusable via a simple mountable image.

SU+ journal breaks the compatibility with UFS snapshot, and since the time this problem has never been solved, or this simply show that SU + J is regarded as deprecated. For this unique reason, there is absolutely no reason to keep this old b....shit

Make just some research in this forum .... you will find many messages of people complaining of UFS file corruption (and those people don't use gjournal as very few people are aware of this option)....nearly none for ZFS users.


But UFS + gjournal is not compatible with removable media.
Indeed before removing such media you must stop and clean the journal before.... this is not convenient at all as most of time you will forget to do that, so on next mount you will have to do a complete file check to restore the flag to clean.
For removable media, UFS + SU +J is the option to choose.
 
OP
OP
B

badbrain

Guest


UFS with SU + J IS NOT RELIABLE
I confirm 1000 times, I have completely lost several OS since I use FreeBSD (since FreeBSD 8)
I have never lost any system with UFS + gjournal even following severe hardware failures as several power interruptions.

UFS + gjournal is just a little bit slower but it really meets the last journalisation standards and is nearly as robust as ZFS
Other BIG advantage : UFS + gjournal IS FULLY compatible with UFS snapshot, required if you use "dump" to backup restore your system, or simply to freeze an image of a system further reusable via a simple mountable image.

SU+ journal breaks the compatibility with UFS snapshot, and since the time this problem has never been solved, or this simply show that SU + J is regarded as deprecated. For this unique reason, there is absolutely no reason to keep this old b....shit

Make just some research in this forum .... you will find many message of people complaining of UFS file corruption (and these people don't use gjournal as some very few people are aware of that)....nearly none for ZFS users.


But UFS + gjournal is not compatible with removable media.
Indeed before removing such media you must stop and clean the journal before.... this is not convenient at all as most of time you will forget to do that so on next mount you will have to do a complete file check to restore the flag to clean.
For removable media, UFS + SU +J is the option to choose.
The installer doesn't support UFS + gjournal out of the box. How could I install FreeBSD on UFS + gjournal from the beginning? Most tutorials have the system already installed and modified it to use gjournal. It also only journal a certain file system like /usr. I want to journal a big / from the beginning. How could I do it? And what journal size recommended? Thanks.
 
OP
OP
B

badbrain

Guest


The installer doesn't support UFS + gjournal out of the box. How could I install FreeBSD on UFS + gjournal from the beginning? Most tutorials have the system already installed and modified it to use gjournal. It also only journal a certain file system like /usr. I want to journal a big / from the beginning. How could I do it? And what journal size recommended? Thanks.
Anyone help me, please? Or should I post a new thread?
 

garry

Member

Reaction score: 45
Messages: 55

Anyone help me, please? Or should I post a new thread?
The beauty of GEOM is that GEOM can do anything!
Well, almost.

Install your system with ufs+S but NOT ufs+SJ, in other words do manual partitioning and make sure to turn off ufs journaling. Also make sure to create a separate small partition, preferably on an ssd, for the journal (to be used later -- leave it unused until after installation is complete). A gjournal is said to require 1 GB to journal one filesystem (of any size). I haven't done this but I would be cautious to make sure that my journaling partition is at LEAST 1 GB.

After installation you use tunefs() to tell geom to connect the ufs filesystem to a gjournal on the reserved partition.
So:
1. create a partition for the journal during install
2. after installation use tunefs.
3. change the mount option for the filesystem to sync

You will have to read the manpage and maybe search for examples. The critical paragraph from the manpage is

To configure journaling on the UFS file system using gjournal, one should
first create a gjournal provider using the gjournal utility, then run
newfs(8) or tunefs(8) on it with the -J flag which instructs UFS to coop-
erate with the gjournal provider below. There are important differences
in how journaled UFS works. The most important one is that sync(2) and
fsync(2) system calls do not work as expected anymore. To ensure that
data is stored on the data provider, the gjournal sync command should be
used after calling sync(2). For the best performance possible, soft-
updates should be disabled when gjournal is used. It is also safe and
recommended to use the async mount(8) option.
 

Phishfry

Son of Beastie

Reaction score: 1,524
Messages: 4,429

I don't like to speculate on things I have not done, but I would consider using the FreeBSD shell during the bsdinstall disk phase.
It allows you to drop into a shell and you can create whatever you want, and then install on it. Right below 'Manual disk creation'.

For example to install onto a gmirror(8) you would drop into the disk install shell and load the module kldload geom_mirror
Then proceed to create your RAID1 array just like the book shows. Then type exit to resume setup. Install to gm0
With this method you have to create all partitions manually so I would consider it an advanced method.
Warrens page is excellent for this task along with the manual.

I am sure you could use the same approach for glabel.
Obviously garry's solution is much easier. But if you absolutely need it during the install it is possible.
 

Phishfry

Son of Beastie

Reaction score: 1,524
Messages: 4,429

I had to do some checking on what garry was saying and he is absolutly correct. Even if you auto partition the drive you get to the last screen with all your drives. You can move the cursor to a drive and hit enter. Up top it lists partition name and label.
But at the bottom(easily missed between OK and Cancel) is Options. Highlight it with tab button and hit enter.
Under <UFS Options Dialog Box> is UFSv1 ; SU : SUJ ; TRIM.

So I assume what he is saying is pick SU and do the install then on first boot go to Single User Mode and run tunefs.
Really I think you could run tunefs at the 'post install shell' you are presented at the end.
Format your gjournal provider and edit /etc/fstab
 

Alain De Vos

Active Member

Reaction score: 36
Messages: 175

I use UFS+SU+J, very frequently remove power on my desktop in stead of shutting down. Never a loss of data.
One exception, it can happen an open file is reduced to length 0.
Note : Do you need something else then rsync to make a backup ?
Note : gjournal is "older code"
Note : UFS+SU+J keeps stuff in memory without syncing to disk for performance reasons.
 

olli@

Well-Known Member
Developer

Reaction score: 375
Messages: 486

I only use UFS + SU without gjournal and never had any problems. I've never had any power failures in the past decade, though. When I lived in an area that was prone to power outages, I had a small UPS (about half the size of a shoe box), just large enough to have plenty time for a clean shutdown. There are UPS tools in the Ports collection that automatically shut down the system when the power fais. If you also suffer from regular outages, you should consider getting a UPS, too. Saves yourself some trouble.
 

ralphbsz

Daemon

Reaction score: 1,269
Messages: 2,033

One exception, it can happen an open file is reduced to length 0.
If the program that is writing has not called fsync() or an equivalent call, then this perfectly allowed behavior.

Note : UFS+SU+J keeps stuff in memory without syncing to disk for performance reasons.
All file systems do. Exactly how much depends on the implementation. Users of file systems (people who write programs that create to files and write them) need to be aware of that.
 

trev

Aspiring Daemon

Reaction score: 179
Messages: 826

I only use UFS + SU these days having been bitten by UFS + SUJ trashing the file system on a handful of occasions after which my research suggested it was not a good idea to do that, so I no longer do. No significant issues over the last few years with just UFS + SU.
 

xtaz

Well-Known Member

Reaction score: 120
Messages: 435

Yeah. I don't understand how SU+J is the default. It just seems to be so broken to me. Every single time I've tried to use it and then run a manual fsck just to check that things are good the fsck shows a ton of errors which it then has to fix. If I disable +J then fsck always comes back clean.

It doesn't matter so much to me now anyway because I moved to ZFS. But it still troubles me that it's the default.
 

olli@

Well-Known Member
Developer

Reaction score: 375
Messages: 486

Oh, you mean the installer. Well, ok, I haven't used the installer in this century, as far as I remember.
 
OP
OP
B

badbrain

Guest


Oh, you mean the installer. Well, ok, I haven't used the installer in this century, as far as I remember.
If the installer also has Auto UFS (gjournal) in addition to Auto UFS (SU + J) it will be very good for newcomers like me :)
 

Phishfry

Son of Beastie

Reaction score: 1,524
Messages: 4,429

Here is the FreeBSD 12-Stable installer 'Add Partition' phase.
I was wrong about 'Auto Partitioning' allowing you to change options.
The <options> only becomes available on 'Add Partition'.
Not when reviewing partitions on the last screen of this phase.
 

Attachments

OP
OP
B

badbrain

Guest


UFS sucks, slow and buggy. Buy better hardware and go with ZFS.
 
OP
OP
B

badbrain

Guest


Prove it.
Personal experience can't be proved. How could I reproduce it? Of course UFS is slow. Try installing big packages with pkg, compare the time used to extract it between UFS and ZFS you will see, UFS clearly slow, even when ZFS with compression on, it could be notice even when watching the progress on the screen. Both UFS and ZFS are slower than Ext4 and XFS on Linux, though.
 
OP
OP
B

badbrain

Guest


About buggy. I used to have electricity out when the system was running. When it's back the system boot up slower because of some fsck, but finally got up and running. I see my files are still there (text files) and attempt to open it, I see nothing, the file is 0KB, f*ck.
 
Status
Not open for further replies.
Top