BackupPC-users

Re: [BackupPC-users] prevent full OS partition when data disk fails

2015-07-15 04:31:11
Subject: Re: [BackupPC-users] prevent full OS partition when data disk fails
From: Jürgen Depicker <Jurgen.Depicker AT let DOT be>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Wed, 15 Jul 2015 08:29:12 +0000
Hi guys, I must say, I'm again really happy about the help I have received from 
all of you through this list!  Since Backuppc works so nicely, it had been a 
couple of years that I last had to ask something, but I see that the community 
is still as alive as before :-).

More comments inline below.

> Van: Les Mikesell [mailto:lesmikesell AT gmail DOT com]
> Verzonden: woensdag 15 juli 2015 4:44
> Aan: General list for user discussion, questions and support
> Onderwerp: Re: [BackupPC-users] prevent full OS partition when data disk fails
> 
> On Tue, Jul 14, 2015 at 8:29 PM,  <backuppc AT kosowsky DOT org> wrote:
> > Les Mikesell wrote at about 17:39:02 -0500 on Tuesday, July 14, 2015:
> >  > On Tue, Jul 14, 2015 at 5:31 AM, Jürgen Depicker
> <Jurgen.Depicker AT let DOT be> wrote:
> >  > > Hello,
> >  > > I wonder what is best practice to prevent the OS partition to
> > fill up when  > > my data disk fails.
> >  > > My setup: all virtualized; all backups stored in
> > /var/lib/backuppc , but  > > that is /dev/sdb1 mounted there.  So if
> > that drive fails, I’m pretty sure  > > Backuppc will fill up my /
> > partition recreating the backup in the then empty  > > /var/lib/backuppc .
> How can I prevent this?
> >  > > I guess changing topDir may be an option, but there may be a more
> > elegant  > > solution?
> >  >
> >  > I think that is a fairly unlikely scenario unless it is an external
> >  > drive being optionally automounted.   When I've seen drive failures on
> >  > running systems, the filesystem goes read-only or causes errors  >
> > instead of being unmounted, and on boot, failing to mount a partition
> > > listed in fstab is fatal.

[(JDE)] The thing is, my Backuppc server has two virtual disks, one the main OS 
and one for data.  The NAS had power failures last weekend due to still unknown 
reasons presently, but the result was the server running, as suggested below, 
in readonly mode.  I didn't get noticed about that automatically; probably I 
missed out on some essential server configuration?
Anyhow, now I put the OS disk no longer on that NAS, and want to prevent the OS 
disk filling up in case the NAS goes down again.  So I'll go with Paolo's very 
interesting (and working) hint:
If you did follow BPC install instructions, BPC should work with a non root 
user (say backuppc).
Then you can give mount point directory restrictive permissions (while backuppc 
filesystem is unmounted):
/etc/init.d/backuppc stop (or similar)
umount /dev/sdb1
chown root:root /var/lib/backuppc
chmod 750 /var/lib/backuppc

When you mount the fs again the permission are that of the mounted fs and BPC 
can write (I assume you use a unix fs, like ext3/4, xfs or so, not fat nor 
ntfs).
If /dev/sdb1 fails to be mounted, then BackupPC daemons cannot write to the 
mount point and your root partition does not fill up.
[(JDE)] Tested and working!

> > Maybe not too unlikely.
> > I have a consumer NAS device that I NFS mount.
> > One of the disks failed causing the NAS to crash and somehow
> > unmount... A couple of days later I noticed that my root partition was
> > 100% full and couldn't figure out why... Some sleuthing with divide &
> > conquer 'df -s' type commands narrowed it down to /var/lib and then I
> > remembered about the NAS crash. Sure enough /var/lib/Backuppc was
> > full...
> >
> 
> I think what happens with NFS depends on the mount options in fstab.
> If you want, you can force the mounting system to hang and wait for the server
> to be available again (which might not be that desirable either).
[(JDE)] You're surely right: with NFS this can be done.  But Paolo's suggestion 
seems bullet-proof to me.

Greetings, Jürgen
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/