The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Backups on main disk recorded as part of space used

Discussion in 'General Discussion' started by e1ven, Dec 10, 2003.

  1. e1ven

    e1ven Registered

    Joined:
    Dec 3, 2003
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I've noticed that since I am doing backups to /backup, on a single disk, cPanel is recording that as part of the disk space used for that account.

    That seems to be a fairly large bug. The backup file in /backup is not directly related to each account, and I shouldn't have to mentally triple the disk space I allocate to each account.

    Is there a way around this problem? I'd rather not have to re-partition to backup drive to eliminate that problem..

    Any help would be appreciated!

    Colin
     
  2. perlchild

    perlchild Well-Known Member

    Joined:
    Sep 1, 2002
    Messages:
    279
    Likes Received:
    0
    Trophy Points:
    16
    Since quotas are a kernel-function calculated by the kernel itself on a filesystem-by-filesystem basis, that's one of the reasons there is a big warning not to put the backups on the same drive. However, creating a loopback filesystem would solve your problem. Here's an example of creating a six gig filesystem for your backups(yeah it sounds small if you have large accounts, but this is an example)

    dd if=/dev/zero of=/backupfs bs=1M count=6192
    mkfs.ext3 /backupfs
    mount -o loop,noquota /backupfs /backup

    please erase everything under /backup or move them or use another mountpoint if you already use /backup, otherwise you'll waste space
     
  3. e1ven

    e1ven Registered

    Joined:
    Dec 3, 2003
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Thanks. That's a valid idea, I'll do that tonight. I'm a bit ashamed not to have thought of it.

    There weren't warnings not to use the same drive, just not to use /home.

    And it would be possible to fix that, even though quotas are a kernel function. If the backup function took ownership of the backed up files, then gave the ownership back on restore, wouldn't that fix the problem?

    Colin
     
  4. perlchild

    perlchild Well-Known Member

    Joined:
    Sep 1, 2002
    Messages:
    279
    Likes Received:
    0
    Trophy Points:
    16

    I guess that just means there are no warnings to mandate /home being its own partition.. nor did you read the partition guidelines of the system requirements for cpanel, more's the pity, people don't spend enough time lintchecking their /etc/fstab either...
    Yeah but you'd have to suid the part that lets the user delete their own backups, which is kinda a security risk, having the backups owned by the user makes the most sense, allows you to find users who have been deleted, and zap their backups more easily a month or three after the user left too. On a regular cpanel system, root already owns too many files. Besides, if you had the terms of service for it, you COULD include the backups in a quota, and bill appropriately, the fact that noone does just means having a /backup with noquota should be more popular than it is
     
  5. e1ven

    e1ven Registered

    Joined:
    Dec 3, 2003
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    True enough. In thinking more about it, you're right.
    You might be able to hack something together so that cPanel set a quota differently on the system level than it reported, but it gets to be too many layers of abstraction.

    The way it is done by default probably is the best way to do it, even if it does get a bit frustrating WRT backups.

    -Colin
     
Loading...

Share This Page