Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Aug 2004
    Posts
    294
    cPanel/Enkompass Access Level

    Root Administrator

    Default Move /usr directory?

    Ok, im constantly running into issues with my /usr directory becoming 84% full etc... and its getting tiresome removing files.

    Ive already moved and symlinked domlogs, still get the warnings.

    Now, i have a secondary hard drive on this server, it is a 120GB drive with 109GB usable.

    Currently, the setup is:

    Filesystem Size Used Avail Use% Mounted on
    /dev/hda7 2.0G 331M 1.6G 18% /
    /dev/hda8 83G 13G 66G 16% /home
    /dev/hdc1 109G 2.5G 101G 3% /home2
    /dev/hda6 2.0G 40M 1.8G 3% /tmp
    /dev/hda3 3.9G 3.1G 656M 83% /usr
    /dev/hda2 16G 1.9G 13G 13% /var
    /dev/hda1 494M 21M 448M 5% /boot
    tmpfs 505M 0 505M 0% /dev/shm

    Obviously the /usr partition is too small but formatting etc.. is out of the question as this is a live server.

    There is no critical data on the secondary drive (hdc), only tar.gz backups which are also on a remote server i have for backups.

    My question:

    Can i format & partition the secondary hdd (hdc) to have the below:

    hdc1 - 9GB
    hdc2 - 100GB

    Then:

    - mount /dev/hdc1 /usr2

    - Copy all data from /usr to /usr2

    - umount /dev/hda3 (usr)
    - umount /dev/hdc1 (usr2)
    - mount /dev/hdc1 /usr

    - mount /dev/hdc2 /home2

    It all looks good in writing unless someone can spot any flaws?

    Also, could someone describe the steps on formatting and partitioning the drive via ssh? or point me in the right direction?

    I know most will say hire an admin but as this is only a secondary drive i would rather learn myself, after all, what harm can learning on a secondary, unused drive do?

    Any help is greatly appreciated, cheers.

  2. #2
    Member Murtaza_t's Avatar
    Join Date
    Jan 2005
    Location
    Earth
    Posts
    471

    Default

    Hello,

    I don't think you will be able to umount the the /usr partition on a Live server as it give "Partition is busy" error. You will need to either do it from the rescue mode or use the Symlink method to use the space on the /hdc drive.

    To format and resize the partition you can use mke2fs and fdisk /dev/hdc commands.

  3. #3
    Member MaestriaNick's Avatar
    Join Date
    Aug 2008
    Posts
    137

    Default

    i think, unmounting /usr in a live server is not wise , as there may be many libraries needed in /usr partition for the next mount command. So , after you create a new partition, mount it to say /usr2 and copy all the contents in /usr to /usr2 , preserving the permission (use -p option ) . Then modify the /etc/fstab, modify the line for /usr with the new partition you created.

    there will be entry like this,

    /dev/XXXX /usr ext3 defaults ......

    modify it like

    YOURNEWPARTITION /usr ext3 defaults ..

    where YOURNEWPARTITION is partition you created for /usr.

    save the file and use the command

    mount -0 remount /usr

    then verify whether the correct partition is mounted as /usr, using mount command

    Maestriatech.com
    If Someone can do it, We can do it better.
    24/7 Linux /Windows Server Support
    5+ years in the industry
    reachus@maestriatech.com

  4. #4
    Member
    Join Date
    Jun 2004
    Posts
    48

    Default

    Hi,
    What is the process of this post?

    Is it done?
    How?
    Would you explaine please?

    My /usr is 93% full and I want to resize it move it to /home3 as it is 3000GB free disk


    Regards
    Last edited by yawsh; 11-16-2008 at 08:41 PM.
    http://www.yawsh.com

  5. #5
    Member
    Join Date
    May 2006
    Location
    Morocco
    Posts
    158
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    how i can unmount the second drive and format it and re-mount it ?

Similar Threads & Tags
Similar threads

  1. /usr directory keeps filling up.
    By jols in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 12-16-2009, 04:59 PM
  2. /usr directory
    By khaledhu in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-01-2009, 01:40 PM
  3. change move directory
    By romanus in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 06-02-2005, 11:21 AM
  4. How can I move /usr & /var to a seperate drive?
    By AbeFroman in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-13-2004, 06:28 PM
  5. how to move logs out of /usr ?
    By Radio_Head in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 10-21-2003, 08:45 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube