The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resizing partition of live server

Discussion in 'General Discussion' started by the_bobara, Jun 8, 2005.

  1. the_bobara

    the_bobara Well-Known Member
    PartnerNOC

    Joined:
    Sep 23, 2004
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Bulgaria
    cPanel Access Level:
    Root Administrator
    Hello, one of my boxes is having problems and i found out that /usr partition is overfilled
    this is my partition table:
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/sda2 497829 221003 251124 47% /
    /dev/sda7 100854264 1677824 94053316 2% /backup
    /dev/sda1 497861 32198 439959 7% /boot
    /dev/sdb1 114642952 1324332 107495060 2% /home
    none 1027348 0 1027348 0% /dev/shm
    /dev/sda3 1992332 33032 1858092 2% /tmp
    /dev/sda5 10831708 4596584 5684900 45% /usr
    /dev/sda6 4032092 3137024 690244 82% /var
    -------
    and i hope that i can resize my partitions (in this case /usr/) without causing any problems (i don`t want to lost any info!!!).
    can i do that?
    can anyone tell me how?
    please help...
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    The safest way is to backup, wipe the disk, repartition and then restore the data.

    If you're happy to take the risk of screwing everything up, then you could look into the parted utility:

    man parted
     
  3. nickb

    nickb Well-Known Member

    Joined:
    Feb 25, 2005
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    If your haddisk is setup to use LVM then you can resize any partition any time without any data lose...visit the link below for more info...

    http://www.tldp.org/HOWTO/LVM-HOWTO/
     
  4. the_bobara

    the_bobara Well-Known Member
    PartnerNOC

    Joined:
    Sep 23, 2004
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Bulgaria
    cPanel Access Level:
    Root Administrator
    @chirpy: that is the first time that i do that and don`t know if i can do it only with parted man pages, can you give me some instructions/commands
    @nickb: how to see if my HDD is set as LVM?

    thanks in advance
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    I can't give you any more information about parted other than what is on the man page. You could try searching Google for examples and there's always the parted website and its manual:
    http://www.gnu.org/software/parted/manual/html_chapter/parted_toc.html

    WRT LVM partitions, if you aren't sure whether you have them, you probably don't. If your partitions on are devices such as /dev/hda* or /dev/sda* then you probably haven't as those are standard disk device names, LVM's can pretty much have any name though.
     
  6. the_bobara

    the_bobara Well-Known Member
    PartnerNOC

    Joined:
    Sep 23, 2004
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Bulgaria
    cPanel Access Level:
    Root Administrator
    i spent hours in reading how to do this and what i learned is how to do this if it is clean system, not live server and there is free (unmound) space :(
    i have a lot of free space but it is on other partition :(
    i didn`t understand how to copy /var to /backup then how to resize /backup (to make it smaller) after that to resize /var (to make it bigger).
    i really don`t want what to do :(


    some command i have tried
    Code:
    (parted) cp 6 7
    Warning: Partition is being used.
    Ignore/Cancel? ignore
    Destination partition number? 7
    Warning: Partition is being used.
    Ignore/Cancel? ignore
    Warning: Filesystem was not cleanly unmounted!  You should e2fsck.
    Ignore/Cancel? ignore
    No Implementation: This ext2 filesystem has a rather strange layout!  Parted can't resize this (yet).
    
     
  7. amal

    amal Well-Known Member

    Joined:
    Nov 22, 2003
    Messages:
    155
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Refer the URL --> http://strawberry.resnet.mtu.edu/pub/gcc/lvm/0.9/ABSTRACT

    If you do not feel comfirtable with LVMs, don't go for it as you may screw things up and cause bigger issues..

    Just make sure that you have allotted enough space for /usr and /var when you partition on the new disk. What I have done is I'm using a single partition for /home and /usr ( ie, / ). I have been using it that way for years, and have never felt a performance drop due to fragmentation of the drive.
     
Loading...

Share This Page