DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 25th November 2014
soderlund soderlund is offline
New User
 
Join Date: Nov 2014
Posts: 9
Default ext2fs -o sync

How is ext2fs mounted in OpenBSD? I would like to mount it with the sync option, but I get this error message:

Code:
mount_ext2fs: -o sync: option not supported
The manual says:

Quote:
Originally Posted by man mount
async: Metadata I/O to the file system should be done asynchronously. By default, only regular data is read/written asynchronously.

sync: Regular data I/O to the file system should be done synchronously. By default, only metadata is read/written synchronously.
I assume this means that, when mounting an ext2fs partition, metadata is written synchronously and regular data is written asynchronously. On the other hand, FFS is the default filesystem on OpenBSD and the default mount options described in the manual may refer to the options for FFS, not necessarily for ext2fs and other filesystems.

Also, Linux mounts ext2 as async by default, while FreeBSD mounts ext2 as sync by default. It's therefore tempting to believe that the default for ext2 on OpenBSD is sync because there is no journaling. The OpenBSD FAQ supports this reasoning in general terms:

Quote:
Originally Posted by OpenBSD FAQ
Async mounts are indeed faster than sync mounts, but they are also less safe. What happens in case of a power failure? Or a hardware problem? The quest for speed should not sacrifice the reliability and the stability of the system.
I have read mount(8), mount_ext2fs(8), the FAQ and searched the internet but I can't find anything about this except for what I quoted above.
Reply With Quote
  #2   (View Single Post)  
Old 25th November 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 8,020
Default

It is my understanding that EXT2 filesystems always mount async, which is why the option is not available.

(This is not like FFS filesystems, which are not designed to be survivable after system failure when async is used.)
Reply With Quote
  #3   (View Single Post)  
Old 26th November 2014
soderlund soderlund is offline
New User
 
Join Date: Nov 2014
Posts: 9
Default

Makes sense, but where did you find that? I haven't found any documentation about it.
Reply With Quote
  #4   (View Single Post)  
Old 26th November 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 8,020
Default

I searched the misc@ archives, where I found henning@'s comments in 2001, and Jan Stary's comments in 2009. Searching more generally, I found what appears to be confirmation in comments from Don Allen to the NetBSD tech-kern@ list in 2011. It may be applicable, as OpenBSD's ext2fs driver is based on NetBSD's.

And then to try to confirm, I looked at file allocation code in src/sys/ufs/ext2fs/ext2fs_balloc.c -- where it appears that some indirect writes are done synchronously, the rest of the allocations are done aysnc. Of course, that is only true if I understood what I was reading; I may have misunderstood the code. I haven't been a programmer in decades and I was never a C programmer.

Last edited by jggimi; 26th November 2014 at 07:15 PM. Reason: typo
Reply With Quote
  #5   (View Single Post)  
Old 26th November 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 8,020
Default

And, poking around further just now:

I found http://wiki.osdev.org/Ext2 -- which shows that ext2fs inodes have a synchronous update flag, to permit sync for individual files. Edited to add: this flag is identified in src/sys/ufs/ext2fs/ext2fs_dinode.h but is not referenced by any of the driver's modules.

I found https://wiki.freebsd.org/Ext2fs -- which states that the filesystem supports "the faster async mode" and "compensates with a robust fsck".

----

I only use ext2fs if I need to either multiboot with or move drives between OpenBSD and another Unix-like system. If a network is involved, I prefer to use NFS for file sharing.

Last edited by jggimi; 26th November 2014 at 08:50 PM. Reason: Noted the EXT2_SYNC flag in source code.
Reply With Quote
  #6   (View Single Post)  
Old 26th November 2014
soderlund soderlund is offline
New User
 
Join Date: Nov 2014
Posts: 9
Default

Ah, I never searched that mailing list or the source code. Thank you for doing all that work.

Quote:
Originally Posted by jggimi View Post
I only use ext2fs if I need to either multiboot with or move drives between OpenBSD and another Unix-like system. If a network is involved, I prefer to use NFS for file sharing.
It is for multibooting, but I've had trouble finding a suitable filesystem that Linux, FreeBSD and OpenBSD can all write to. ext2fs seems to be the only choice. By the way, I discovered the hard way that even FFS2 is not write-compatible if you share a partition between FreeBSD and OpenBSD -- FreeBSD crashes catastrophically.

A network is not involved but I will look into NFS anyway; it feels like there must be a better way to do it than what I'm doing now.
Reply With Quote
  #7   (View Single Post)  
Old 27th November 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 8,020
Default

The FFS systems used by the BSDs are largely incompatible between them. As you have discovered.
Reply With Quote
  #8   (View Single Post)  
Old 27th November 2014
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,102
Default

Quote:
Originally Posted by soderlund View Post
It is for multibooting, but I've had trouble finding a suitable filesystem that Linux, FreeBSD and OpenBSD can all write to
FAT16 Good luck booting those systems from FAT16 though.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing fstype in disklabel (ext2fs -> 4.2BSD) soderlund OpenBSD General 8 10th November 2014 07:05 AM
how fast do mirror servers sync to main server for -current ? daemonfowl OpenBSD Installation and Upgrading 3 3rd September 2012 02:58 AM
How to know if the system is in sync sepuku OpenBSD Installation and Upgrading 29 8th September 2011 12:24 PM
Best Way to sync web sites roundkat OpenBSD General 2 14th September 2008 01:48 PM
How to sync files over ftp graudeejs FreeBSD General 4 4th August 2008 10:18 PM


All times are GMT. The time now is 03:42 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick