PDA

View Full Version : Btrfs fsck



carnold6
26-Feb-2015, 13:24
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?

jmozdzen
26-Feb-2015, 13:56
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_b trfs_admin):


Btrfs administration tools are provided in the btrfsprogs package. For information about using Btrfs commands, see the man 8 btrfs, man 8 btrfsck, and man 8 mkfs.btrfs commands.

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

Regards,
Jens

carnold6
26-Feb-2015, 18:12
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_b trfs_admin):



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

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)).

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.

jmozdzen
26-Feb-2015, 18:25
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 ;)

Regards,
Jens

carnold6
26-Feb-2015, 20:48
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 ;)

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?

jmozdzen
27-Feb-2015, 11:23
Hi carnold6,

What should the permissions be on the folders in /srv/ww/htdocs/sitename?

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 ;)