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? |
It depends on how you have your hard disk partitioned. Can you post the output of "df -h" and "fdisk -l"?
|
Quote:
[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...) |
# 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 |
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? |
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.
|
Quote:
|
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 |
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.
|
Quote:
|
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? |
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.
|
Quote:
|
Quote:
Thanks! |
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. |