Question

We have an Ubuntu Server running and I installed SVN on it. We have been using the server for 4 or 5 months and we are assigned Appuser with sudo privileges.

The problem is, we are running out of space for appuser. As far as I understand, we have 3 different disks which are root, appuser and removable disk. The snapshot for the current level is as follows

Ubuntu Disk Situation

Now, I wonder how can I prevent this or solve my problem. I had to delete some useful programs in order to create 80.6 MB disk space (before, it was 0).

One option I can think of is to move SVN to root if doable. Unfortunately, I don't know how to do it. Other option might be to create a new user with root privileges in another directory.

Long story short, I need a way to manage the limited disk I am assigned. There are several servers like this and I am having this problem in each and every one them.

By the way, is there any way to increase the disk size of /dev/sda3 /home (appuser)? If I can add some additional disk space (from root or any other source) it will be very useful.

One last I can think of is, I cannot see what is under /var/opt/appuser even tough I connect with appuser. Only root can see it. Is this a problem?

I appreciate any hints and directions.

Was it helpful?

Solution

Native filesystems supported by the Linux kernel (namely, those of extN family) have the concept of the space reserved for the superuser (that with UID 0). The idea is that when the filesystem appears to be full, and various programs start to fail due to this, the superuser still has certain scratch space available to perform recovery tasks (think of text editor's buffer swap/backup files, the need to copy files around etc). Hence what you're seeing here is the difference between what your root user sees and what your regular users see.

The typical reservation of free space is 5% when the filesystem is created (which was sensible back in the day, but not really these days, with multi-gigabyte or -terabyte filesysems). Luckily, this parameter might be tuned after the fact (using the tune2fs program for the extN filesystems). I usually set it manually to 100MiB after creating a typical reasonably large extN filesystem.

To see how many space is reserved, go like this:

  1. Ask the filesystem about its current parameters:

    # tune2fs -l /dev/sda1 | grep -Ei 'reserved|block size'
    Reserved block count:     25600
    Block size:               4096
    Reserved GDT blocks:      1012
    Reserved blocks uid:      0 (user root)
    Reserved blocks gid:      0 (group root)
    

    The actual space reserved, in bytes is Reserved block count × Block size.

  2. Tweak this to suit your needs, if you want.

    For instance, to set this to 10 MiB, you can do

    # tune2fs -r $((10*1024*1024/4096)) /dev/sda1
    

    Here 4096 is the block size and 10×1024×1024 is 10 MiB.

OTHER TIPS

Have you considered looking up a utility tool called gparted to increase the space allocated to the appuser?

A command line way to address your problem may be found here - worth a look:

resizing dev/foo_disk and increase space

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top