FSCK on a running server

Is it possible/recommended to run FSCK as read-only on a running server? How about it running on repair mode?

Following this thread.

I ran FSCK as ro while the server was running and nothing broke.

1 Like

You can run FSCK on running server, but it’s not recommended (user inputs). FSCK checking integrity of libraries. If you run FSCK on librare where some user in same time make some input (file operation) it can fail. Why you want to run in RO? Check, repare, export … ?

Just a followup question on this, what happens if FSCK are failing?
Does it corrupt the library’s or does it just report that some library’s has corruption like a false positive in your scenario above?

if you’re using FSCK for check integrity, it can just fail cause user’s input, but it shouldn’t damage files. If you run --repair then there cannot be user’s input cause it can crash whole library.

Do not run FSCK repair while server running or is accesable to other users/clients.

check -> RO
repair -> RW
export -> RO

1 Like

Perfect, thanks!
It was just what I figured but I just wanted some clarification on that.

From my point of view, it is usefull to run FSCK in check mode while Seafile is running.
It allows you to check all your libraries with no down time (checking all the libraries can be very long).

Once the check process is finished, you can then stop Seafile and run FSCK in repair mode only on the corrupted librairies.
You will therefore minimize your downtime.

1 Like

That’s what I’m saying. But I don’t know backend of “check” feature and I cannot say if it no end with fail if someone write some file to library which is in checking. I’m not mean it will destory library but check can say that there is some fail in library integrity. That’s all

I agree with @RomainC. You can run fsck in check mode when the server is running without breaking anything. Then you repair the damaged libraries.

1 Like

This is something that should be stated in the manual under FSCK as it’s something that people will wonder over if they can run the check with the server on or not.

1 Like

I want to use it for that exact purpose, since power outages are quite a common thing where I host my server. So just to confirm, running fsck on a live server won’t damage the fs? will the check fail if the library is being modified during the check?

No, it’ll not harm the DATA or damage the fs.

I should recommend you to get a UPS so your server can shutdown in the right way.
You can still get corrupted filesystems on the OS (Windows, Ubuntu, Linux etc.) because of it.

Thanks for suggestion. It’s now added.

1 Like