LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Root 100% full write error trying to mirror Apache site (https://www.linuxquestions.org/questions/linux-newbie-8/root-100-full-write-error-trying-to-mirror-apache-site-4175428566/)

mbvpixies78 09-22-2012 02:52 PM

Root 100% full write error trying to mirror Apache site
 
I've set up a CentOS web server to function as a mirror for Apache. All went well until I used rsync, per Apache's instructions to mirror/download the site.

I'm using Ceotos 6.3 on Virtualbox and dynamically allocated the hard disk, up to 90 GB in size (currently, it's half-full, at 45 GB.)

When letting rsync download and create the Apache mirror, today it fails, stating that / (root) is full, and the write fails.

My understanding is that when creating a web site, it is best practice to serve the site from /var/www/html. I also don't know how this constitutes / (root) directory.

What did I do wrong here? Why is / (root) full if I'm only halfway to my virtual hard disk's max size? Why do contents of /var/www/html count against / (root)? What are my options for a solution?

btmiller 09-22-2012 03:28 PM

It depends on how you have your hard disk partitioned. Can you post the output of "df -h" and "fdisk -l"?

mbvpixies78 09-22-2012 03:37 PM

Quote:

Originally Posted by btmiller (Post 4786730)
It depends on how you have your hard disk partitioned. Can you post the output of "df -h" and "fdisk -l"?

FYI-- This is a brand new CentOS install in Vbox and I used the default partitioning scheme. I've installed quite a few programs with yum, but this vm is only being used as a web server.

[root@buddha /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_buddha-lv_root
45G 45G 0 100% /
tmpfs 504M 296K 504M 1% /dev/shm
/dev/sda1 485M 52M 408M 12% /boot
/dev/mapper/vg_buddha-lv_home
47G 270M 44G 1% /home


(I'll post fdisk in a moment...)

mbvpixies78 09-22-2012 03:46 PM

# fdisk -l | more

Disk /dev/sda: 102.0 GB, 102001278976 bytes
255 heads, 63 sectors/track, 12400 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000af206

Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 12401 99097600 8e Linux LVM

Disk /dev/mapper/vg_buddha-lv_root: 48.7 GB, 48737812480 bytes
255 heads, 63 sectors/track, 5925 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_buddha-lv_swap: 2113 MB, 2113929216 bytes
255 heads, 63 sectors/track, 257 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

mbvpixies78 09-22-2012 05:42 PM

Update: potentially still an issue (?)
 
I've removed some apps, freeing up 300MB, which allows me to start Gnome again and continue w/rsync, but again I ran into / (root) becoming full.

I'm at a loss as to whether this should be happening, if I'm doing something wrong here.

Shouldn't default partitioning during CentOS install not lead to this issue?

btmiller 09-23-2012 06:14 AM

It looks like you have 45 GB of something on your root (/) partition, which holds all of your files except for those in /boot and /home. 45 GB seems like a lot of space to be taken up by just a default installation, so it might be worthwhile to see what's eating your space. Try looking at the output of "du -x --max-depth=1 /" and work down from there to see if you can see where that 45 GB is located.

Wim Sturkenboom 09-23-2012 07:01 AM

Quote:

My understanding is that when creating a web site, it is best practice to serve the site from /var/www/html. I also don't know how this constitutes / (root) directory.
'/var' is just a subdirectory of '/'. Log files, printer spool and often websites and mysql databases go in there. So if '/var' fills up, '/' also fills up.

mbvpixies78 09-23-2012 09:27 AM

Options for resolution
 
I checked as suggested and verified the vast majority of data is in /var/www/. Thanks for explaining about directories.

Am I correct in my understanding that I can do one of the following as my options?:

1. shrink home partition which will shift that freed space over to root

2. expand root partition (not sure how that works with a vm dynamic vhd)

3. start over and change default partitioning scheme to increase size of root partition

unSpawn 09-23-2012 11:04 AM

If you're new to Linux then it may be convenient but if the virtual machine only serves as Apache mirror then you don't need Xorg, GUI tools, KDE, GNOME or whatever else complete Desktop Environment. Removing it saves time spent on maintenance and disk space: a minimum installation of CentOS 6.3 takes up only aprox. 600 to 700 megs in /, most of which will be in /usr. And if it is supposed to become an active Apache server then you should choose to have a server partition layout with a separate /var. You've already experienced the main reason for having one.

mbvpixies78 09-23-2012 07:26 PM

Quote:

Originally Posted by unSpawn (Post 4787229)
If you're new to Linux then it may be convenient but if the virtual machine only serves as Apache mirror then you don't need Xorg, GUI tools, KDE, GNOME or whatever else complete Desktop Environment. Removing it saves time spent on maintenance and disk space: a minimum installation of CentOS 6.3 takes up only aprox. 600 to 700 megs in /, most of which will be in /usr. And if it is supposed to become an active Apache server then you should choose to have a server partition layout with a separate /var. You've already experienced the main reason for having one.

Understood. Thanks to everyone for your help. I'm downloading a minimal installation per unSpawn's suggestion and going to put /var on a separate partition. Thanks again.

mbvpixies78 09-23-2012 08:20 PM

unable to umount /home to resize
 
I may still just start over with a new vm, but I want to figure out how to resize /home if needed for the future.

In trying to do so, I get:

#umount /dev/mapper/vg_buddha-lv_home
umount: /home: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))

Then I realized I was logged into Gnome and logged out to cli, tried again, same result. Then I switched to my (only) user other than root and typed 'exit', which returned me to root command prompt, tried again, same result.

I'm referring to this article (http://www.howtoforge.com/linux_resi...xt3_partitions)

Suggestions?

unSpawn 09-23-2012 08:36 PM

Boot your guest with a Live CD and run commands from there? Unsure if the CentOS 6.3 installer DVD-1 has all the tools. If not try Gparted, KNOPPIX or whichever one you like.

suicidaleggroll 09-23-2012 08:38 PM

Quote:

Originally Posted by mbvpixies78 (Post 4787605)
I may still just start over with a new vm, but I want to figure out how to resize /home if needed for the future.

In trying to do so, I get:

#umount /dev/mapper/vg_buddha-lv_home
umount: /home: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))

Then I realized I was logged into Gnome and logged out to cli, tried again, same result. Then I switched to my (only) user other than root and typed 'exit', which returned me to root command prompt, tried again, same result.

I'm referring to this article (http://www.howtoforge.com/linux_resi...xt3_partitions)

Suggestions?

You'll need to log out from EVERY non-root user, both CLI and X. You can't even log in as a user and then su to root, no non-root user may be logged in. You should be able to use "w" to verify.

mbvpixies78 10-18-2012 06:29 PM

Quote:

Originally Posted by suicidaleggroll (Post 4787621)
You'll need to log out from EVERY non-root user, both CLI and X. You can't even log in as a user and then su to root, no non-root user may be logged in. You should be able to use "w" to verify.

Ok, thanks for your response. I'll try this when I get through some other more pressing matters which I will start other posts for help with. I'll report back if need be.

Thanks!

mbvpixies78 02-15-2013 10:38 PM

Because I was getting nowhere and had very little experience with fixing a full root partition, I opted to start over with a fresh vm. I still have this vm, with its full root partition if I ever feel cagey enough to return where I left off in fixing the problem. This problem did not repeat in the new vm, which had a much, much larger partitioning scheme.

Consequently, from this experience, I installed logwatch and have it email me every day, stating the percentage used of all partitions, along with web site traffic, http errors and other useful data. A quick scan of this email every morning reassures me all is as it should be on my server.


All times are GMT -5. The time now is 04:01 PM.