FreeBSD on USB Flash: root remount from RW to RO takes 3 minutes

Egor

New Member

Reaction score: 1
Messages: 4

Hello, everybody!

I've installed freebsd FreeBSD on a USB stick, root partition mounted as read-only, /var and /tmp are mounted as md. Sometimes I need to mount root for writing, and then, when I call [CMD=""]mount -o ro /[/CMD] the server hangs for three minutes: sshd, named, and other network services are not responding, commands in other consoles are frozen too.

I've tried turning off softupdates, forcing mount with the -f option, single user mode - nothing helps.

[CMD=""]fstat[/CMD] doesnt show any read-write opened files on the root partition.

Does anyone knows how to fix it or what else I can try or check? I have FreeBSD 8.3.
 

jarosm

New Member


Messages: 6

Hi,

there are two ways:
1, easy - downgrade to 8.2-RELEASE
2, apply this patch - it's for pfsense distro and I have not yet tried it on FreeBSD, but I believe it will work.

On the second harder way you will have to change sysctl(8) variable 'vfs.forcesync'. I think.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 9,512
Messages: 34,309

jarosm said:
1, easy - downgrade to 8.2-RELEASE
Bad advice. FreeBSD 8.2 is end-of-life. It's not supported anymore.
 

Beeblebrox

Aspiring Daemon

Reaction score: 148
Messages: 985

and then, when I call
mount -o ro /
1. When do you call this?
2. You of course mean
# mount -o [FILE][b]rw[/b][/FILE] /
3. Try temporarily changing the entry in /etc/fstab to rw and see what happens.
 

jarosm

New Member


Messages: 6

Beeblebrox said:
1. When do you call this?
2. You of course mean
# mount -o [FILE][b]rw[/b][/FILE] /
3. Try temporarily changing the entry in /etc/fstab to rw and see what happens.


I think you get it wrong. Egor meant this:
When you open read only file system to write, write something, and close it back to read only...
# mount -o rw /
# echo "test" >/some_file_in_root_fs
# mount -o ro /

The last step is processing long time (circa 30 - 600 seconds - according to used medium). And every services what need reading from disk don't work. This problem has appeared in FreeBSD 8.3-RELEASE.
 

kpa

Beastie's Twin

Reaction score: 1,828
Messages: 6,318

Does this have something to with UFS SU+J? Or is not available on 8.3?
 

jarosm

New Member


Messages: 6

kpa said:
Does this have something to with UFS SU+J? Or is not available on 8.3?

I am not sure if I understand your questions, despite this I will try to answer.

1, No, this thread isn't about a SoftUpdate or/and a Journal.
2, Also I think the problem (topic of this thread) doesn't have solving in the SoftUpdate or in the Journal.
3, The SoftUpdate and the Journal are available on the 8.3-RELEASE, but it isn't the subject of this topic.
4, The problem was come with the 8.3-RELEASE, In the 8.2-RELEASE is working the remounting all right.
 

jarosm

New Member


Messages: 6

SirDice said:
Bad advice. FreeBSD 8.2 is end-of-life. It's not supported anymore.

But just only one useful. 8.3-RELEASE-p8 still has same problem and uncommented "patch" looks little bit dangerous.

The problem isn't only time. It brings next worse problems: Some service doesn't answer (SSH, OpenVPN, MySQL) during a system making remount to 'ro'; When you manage the system on very long distance you could feel weak heart attack while you waiting to done it.
 

Tomtor

New Member

Reaction score: 2
Messages: 13

This is still an issue on 11-CURRENT.

Reproduced on a Raspberry with micro SD card.
 
Top