Disk Usage Help?

Discussion in 'Installation/Configuration' started by Unfaiir, Aug 2, 2012.

  1. Unfaiir

    Unfaiir Member

    I followed the guide on installing ISPConfig 3 on a fresh CentOS 6 and its all up and running well now. When I goto "Monitor" => "Disk Usage" within ISPConfig I see this:

    Code:
    Filesystem 	Type 	Size 	Used 	Available 	Use% 	Mounted on
    /dev/mapper/VolGroup-lv_root						
    	ext4	50G	3.3G	44G	7%	/
    tmpfs	tmpfs	1.8G	0	1.8G	0%	/dev/shm
    /dev/sda1	ext4	485M	98M	362M	22%	/boot
    /dev/mapper/VolGroup-lv_home						
    	ext4	864G	269M	820G	1%	/home
    Whenever I add a new site and all the files, it is going onto the / partition and not the /home partition. My /home partition has 820G and the / partition only has 44G. I'm not really sure what to do, apart from the guide I've never had to deal with mounting or partitioning myself, as I'm new at this.

    Can someone please let me know what the optimal solution here is to either swap the capacities of the partitions or to change which partition the website files are stored on and how to do it?

    Thank you.
     
  2. Athar

    Athar New Member

    In theory, website files are stored in /var/www
    So, it's normal that the file system in use here is / and not /home

    I will install a multi server environment soon, so I will verify that.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Website files are stored in /var/www and email files in /var/vmail, so a large /var partition is recommended.
     
  4. Unfaiir

    Unfaiir Member

    /var partition

    I'm not sure how these partitions were setup in the first place, I just followed the guide. How do I setup a /var partition and reallocate all those gigabytes to the new /var partition from /home partition? Additionally, should I even create a /var partition or just increase the limit of the / partition?
     
  5. cfoe

    cfoe Member

    what kind of server are you using?
    a machine at home/office? a dedicated/virtual server from a hosting company?

    I also use CentOS 5 and 6 and with the standard partitioning selected on setup such a configuration should not occur.
     
  6. Unfaiir

    Unfaiir Member

    Its a home server. I used the standard partitioning as well on setup, CentOS 6.3. Is there a way to fix this or do I need to wipe and re-install everything?
     
  7. cfoe

    cfoe Member

    Windows is my domain although I love Linux/CentOS. In Windows I would know what to do.
    Sorry.
     
  8. falko

    falko Super Moderator Howtoforge Staff

    You could move the /home stuff to another directory (on the / partition, e.g. /home_tmp), delete the /dev/mapper/VolGroup-lv_home logical volume, extend the /dev/mapper/VolGroup-lv_root logical volume (make sure you extend the file system as well) and then rename /home/tmp to /home.

    You can find instructions here: http://www.howtoforge.com/linux_lvm
     
  9. Unfaiir

    Unfaiir Member

    extend file system as well?

    Thank you for the great tutorial on LVM and the solution to fix the volume groups!

    When trying to remove the /home entry from /etc/fstab I get this:

    Code:
    E325: ATTENTION
    Found a swap file by the name "/etc/.fstab.swp"
              owned by: root   dated: Wed Sep 19 08:39:26 2012
             file name: /etc/fstab
              modified: YES
             user name: root   host name: myserver.com
            process ID: 20493
    While opening file "/etc/fstab"
                 dated: Sat Jul 21 11:53:34 2012
    
    (1) Another program may be editing the same file.
        If this is the case, be careful not to end up with two
        different instances of the same file when making changes.
        Quit, or continue with caution.
    
    (2) An edit session for this file crashed.
        If this is the case, use ":recover" or "vim -r /etc/fstab"
        to recover the changes (see ":help recovery").
        If you did this already, delete the swap file "/etc/.fstab.swp"
        to avoid this message.
    "/etc/fstab" 16L, 917C
    Press ENTER or type command to continue
    What should I do? Is ISP Config 3 or related app keeping this open?
     
    Last edited: Sep 19, 2012
  10. Unfaiir

    Unfaiir Member

    How to Unmount /dev/mapper/VolGroup-lv_root?

    Hey Falko,

    Following your suggestion I've successfully removed the /home LV and also removed it from /etc/fstab.

    I'm now trying to increase the size of the / LV but it won't let me unmount it because it says:

    "device is busy."

    What can I do to the / LV?
     
  11. Unfaiir

    Unfaiir Member

    Can't kill processes keeping / LV busy...

    I've tried using fuser -k to kill all the processes but it doesn't work. What else can I do? This is all being done from the terminal btw, not SSH.

    Code:
    [root@myserver ~]# umount /dev/mapper/VolGroup-lv_root
    umount: /: device is busy.
            (In some cases useful info about processes that use
             the device is found by lsof(8) or fuser(1))
    [root@myserver ~]# fuser -m /dev/mapper/VolGroup-lv_root
    /dev/mapper/VolGroup-lv_root:     1rce     2rc     3rc     4rc     5rc     6rc     7rc     8rc     9rc    10rc    11rc    12rc    13rc    14rc    15rc    16rc    17rc    18rc    19rc    20rc    21rc    22rc    23rc    24rc    25rc    26rc    27rc    28rc    29rc    30rc    31rc    32rc    33rc    34rc    35rc    36rc    37rc    38rc    39rc    40rc    41rc    42rc    43rc    44rc    49rc    50rc    57rc    58rc    89rc    93rc    94rc    95rc   107rc   183rc   184rc   185rc   286rc   287rc   297rc   298rc   300rc   301rc   377rc   379rc   405rc   406rc   407rc   484rce   743rc   756rc   873rc   874rc   875rc   921rc   924rce   932rce   933rce  1071rc  1118rce  1136rce  1143rce  1162rce  1183rce  1201rce  1211rce  1212rce  1233rc  1234rc  1238rce  1239rce  1240rce  1241rce  1242rce  1243rce  1264rce  1271rc  1272rc  1276rc  1277rc  1281rc  1282rc  1283rc  1284rc  1285rc  1286rc  1287rc  1288rc  1291rce  1303rce  1336rce  1344rce  1380rce  1469rce  1494rce  1503rce  1515rce  1516rce  1522rce  1523rce  1528rce  1529rce  1534rce  1535rce  1610rce  1618rce  1619rce  1622rce  1624rce  1629rce  1632rce  1640rce  1653rce  1654rce  1655rce  1656rce  1657rce  1658rce  1659rce  1660rce  1661rce  1687rce  1689rce  1691rce  1693rce  1695rce  1697rce  1699rce  1700rce  1701rce  1702rce  1708rce  2403rce  2469rce  2752rce  2754rce  2772rce  2774rce
    [root@myserver ~]# fuser -k /dev/mapper/VolGroup-lv_root
    [root@myserver ~]# fuser -m /dev/mapper/VolGroup-lv_root
    /dev/mapper/VolGroup-lv_root:     1rce     2rc     3rc     4rc     5rc     6rc     7rc     8rc     9rc    10rc    11rc    12rc    13rc    14rc    15rc    16rc    17rc    18rc    19rc    20rc    21rc    22rc    23rc    24rc    25rc    26rc    27rc    28rc    29rc    30rc    31rc    32rc    33rc    34rc    35rc    36rc    37rc    38rc    39rc    40rc    41rc    42rc    43rc    44rc    49rc    50rc    57rc    58rc    89rc    93rc    94rc    95rc   107rc   183rc   184rc   185rc   286rc   287rc   297rc   298rc   300rc   301rc   377rc   379rc   405rc   406rc   407rc   484rce   743rc   756rc   873rc   874rc   875rc   921rc   924rce   932rce   933rce  1071rc  1118rce  1136rce  1143rce  1162rce  1183rce  1201rce  1211rce  1212rce  1233rc  1234rc  1238rce  1239rce  1240rce  1241rce  1242rce  1243rce  1264rce  1271rc  1272rc  1276rc  1277rc  1281rc  1282rc  1283rc  1284rc  1285rc  1286rc  1287rc  1288rc  1291rce  1303rce  1336rce  1344rce  1380rce  1469rce  1494rce  1503rce  1515rce  1516rce  1522rce  1523rce  1528rce  1529rce  1534rce  1535rce  1610rce  1618rce  1619rce  1622rce  1624rce  1629rce  1632rce  1640rce  1653rce  1654rce  1655rce  1656rce  1657rce  1658rce  1659rce  1660rce  1661rce  1687rce  1689rce  1691rce  1693rce  1695rce  1697rce  1699rce  1700rce  1701rce  1702rce  1708rce  2403rce  2469rce  2752rce  2754rce  2774rce
    
     
  12. Unfaiir

    Unfaiir Member

    Tried to create /var partition to no avail... but worked through it... thankfully!

    I can't seem to change the / partition through the shell because it is always busy. Instead I created a /var partition using the guide Falko linked in an earlier post.

    When I 'mount /dev/VolGroup/lv_var /var' everything mounted properly.

    I replaced the line that was in /etc/fstab using the same configuration that the /home LV had and put it in exactly the same place in the file:

    Code:
    /dev/mapper/VolGroup-lv_var /var ext4 defaults 1 2
    I then do a reboot and after about 5 minutes of booting, it comes to a shell that is continuously giving me the error message:

    Code:
    fcoemon: failed to connect to lldpad
    fcoemon: error 111 Connection refused
    I am still able to log in despite the contant error message overwriting my input, but when I look at /var contents this is all I see are three folders:

    Code:
    backup lock lost+found
    At this point I'm thinking OH NO! I've lost all my data! All is lost!

    So I rebooted with the disk and entered in recovery mode to try to find my lost data. It was still gone...

    But, I was able to edit /etc/fstab and comment out the /var partition and then I tried to reboot from the local drive. It worked! My /var partition was back and all services were up and running seemingly normally!

    I don't know for sure why this is so, but I'm assuming its because I'm now looking at the / partition version of /var. So I did:

    /var backup:
    Code:
    cp -R /var /var_tmp
    Mount the lv_var partition
    Code:
    mount /dev/VolGroup/lv_var /var
    copied into the newly mounted version of /var
    Code:
    cp -R /var_tmp /var
    Uncomment the lv_var partition in /etc/fstab then roboot
    Code:
    vi /etc/fstab
    reboot
    Failure.... I was back to the 5 minutes reboot and the constantly spamming 'fcoemon: Error' over my shell.

    I logged in and saw that indeed the var_tmp directory had copied into my /var directory, but it copied the folder and not the contents.

    So I spent some time researching cp more and found that I had done a couple things wrong. First, I should have used -a to make the backup and then to copy back onto the new partition to not only recursively copy, but to preserve links and file attributes. Second, I found that I should have used '/.' to copy contents.

    So I tried to use vi to edit /etc/fstab but that constantly spamming fcoemon error was causing issues with vi. I really didn't want to have to use the cd again and boot into recovery mode, so i looked up fcoemon docs and found the process is called fcoe, and stopped it, and then commented out the /var partition so I could go back and copy correctly.

    Code:
    service fcoe stop
    vi /etc/fstab 
    reboot
    And then once rebooted, I backed up the / version of /var correctly, mounted the /var partition, and copied the backup correctly into /var. I had to click y to overwrite twice, i think they were hidden files, I clicked yes hoping that was the right thing to do. Then I uncommented out the /var partition in /etc/fstab, rebooted, and crossed my fingers:

    Code:
    cp -a /var /var_tmp2
    mount /dev/VolGroup/lv_var /var
    cp -a /var_tmp2/. /var
    vi /etc/fstab
    reboot
    
    There were lots of shut down errors shutting down processes and umounting things, which didn't look promising at all... I think it was because I mounted the /var partition when services will still running on /var and didn't umount it before I rebooted. Hopefully there is no harm done....

    Success! I have rebooted with all services up and running seeming well, and the /var partition now has most the space that the /home partition had. 'df -h' shows 864G, but 'lvdisplay' shows 877.39, just like I had entered it when creating it. I've lost 13.39G somewhere. I'm not sure why. Maybe someone can explain this?

    I also still don't understand how I am supposed to be able to change the size of the / logical volume when there are tons of unstoppable processes on it? If someone can please explain that too.

    Thanks! Hope my troubles save someone else some! :cool:
     
    Last edited: Sep 19, 2012
  13. falko

    falko Super Moderator Howtoforge Staff

    To modify a system partition, you must boot into a rescue system.
     
  14. Unfaiir

    Unfaiir Member

    Thanks!

    Ah! That's really good to know. For now I'm going to stick with the large /var partition because It seems to be doing the job :cool:
     

Share This Page