Btrfs fsck

SLES12. We had a power outage yesterday, since then web sites are not loading images. In the error log:

AH00529: /srv/www/htdocs/sites/sitename/images/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that ‘/srv/www/htdocs/sites/sitename/images/’ is executable

How do you run a filesystem check on btrfs?

Hi carnold6,

I hope that the outage didn’t cause too much impact…

How do you run a filesystem check on btrfs?

From the Storage Administration Guide (https://www.suse.com/documentation/sles-12/stor_admin/data/sec_filesystems_major.html#sec_filesystems_major_btrfs_admin):

So running “btrfsck” should work. Please read the docs prior to using the tools.

Regards,
Jens

[QUOTE=jmozdzen;26574]Hi carnold6,

I hope that the outage didn’t cause too much impact…

How do you run a filesystem check on btrfs?

From the Storage Administration Guide (https://www.suse.com/documentation/sles-12/stor_admin/data/sec_filesystems_major.html#sec_filesystems_major_btrfs_admin):

So running “btrfsck” should work. Please read the docs prior to using the tools.[/QUOTE]

Me too. This is the 2nd power outage that lasted longer than the UPS’s!!
Anyway, because this server is in production and can not unmount the fs, it looks like i need to use btrfs scrub start -B -r (-B do not background and printout stats when finished and -r at first to read only (does n ot attempt to fix anything)).

[EDIT]So i ran btrfs scrub start -B -r /srv/www/htdocs and it completed with 0 errors. Does that 0 errors mean that btrfs errored 0 times or found 0 errors? I only ran it on /srv/www/htdocs because that is where the web site(s) in question reside.[/EDIT]

Hi carnold6,

This is the 2nd power outage that lasted longer than the UPS’s!

maybe you should consider monitoring the UPS (and it’s remaining power) in conjunction with automatic shutdowns of the connected systems… “two times already” seems to be a strong indicator for a coming third time :wink:

Regards,
Jens

[QUOTE=jmozdzen;26593]Hi carnold6,

This is the 2nd power outage that lasted longer than the UPS’s!

maybe you should consider monitoring the UPS (and it’s remaining power) in conjunction with automatic shutdowns of the connected systems… “two times already” seems to be a strong indicator for a coming third time ;)[/QUOTE]

Last time i looked, the UPS software did not run on linux (cant remember it has been a while). Right now i am more concerned with how to get the web sites working again. btrfs scrub did not find any errors. What should the permissions be on the folders in /srv/ww/htdocs/sitename?

Hi carnold6,

I’d say “755” - and they don’t need to be owned by wwwrun… even “shouldn’t be owned by wwwrun”.

httpd needs to be able to read the stuff it is to serve publicly, and even looks at the “others” permissions before handing out content. If you have i.e. php scripts running in the httpd context that need to store things locally, the according file areas need to be writable by wwwrun (or whatever user you let httpd run under). Anything external users needn’t mess with should not be writable by wwwrun, to reduce the chances of illicit manipulation through scripting holes and other security flaws.

Regards,
Jens

PS: I had a look at http://wiki.apache.org/httpd/FileSystemPermissions - the descriptions there are both inconsistent and don’t hold true at least for SLES httpd :wink: