Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
Is it possible to resize a partition without reinstalling the OS. I have inherited a linux web server and I would like to allocate more space to the /var partition ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2007
    Posts
    5

    Changing Partition Size After Installation


    Is it possible to resize a partition without reinstalling the OS. I have inherited a linux web server and I would like to allocate more space to the /var partition where the web files and mail is stored.

    See current partitions and disk space usage below:

    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/sda10 7234264 466592 6400188 7% /
    /dev/sda3 1201732 44808 1095880 4% /boot
    none 514148 0 514148 0% /dev/shm
    /dev/sda9 2893628 33560 2713076 2% /tmp
    /dev/sda5 23458072 2716336 19550120 13% /usr
    /dev/sda8 2854112 1916816 792312 71% /var
    /dev/sda2 12420708 4925612 6864144 42% /home

  2. #2
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    That's definitely possible. My suggestion would be to download and burn the GParted Live CD. You boot it just like you would an installation disc and you can easily resize partitions. It's very intuitive.

  3. #3
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Hi and Welcome !

    Yes. Its possible and pretty easy. You can use GParted LiveCD or PartedMagic LiveCD to resize partition(s). Nothing will go wrong unless you delete or create new partition(s).

    EDIT: Thrillhouse is fast.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  4. #4
    Just Joined!
    Join Date
    Oct 2007
    Posts
    5
    Thanks for the quick response. I'll try it out.

  5. #5
    Just Joined!
    Join Date
    Oct 2007
    Posts
    5

    Update - PartedMagic

    I reboot into PartedMagic. I selected my /var partition that I wanted to increase. The GUI did not give me the ability to grow the partition, only decrease the size. There are 14 gb of unallocated diskspace on the drive so that did not make sense to me.

    Do you know what I'm doing wrong?


    I'm going to try GParted next and see if I get different results.

  6. #6
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    You have to have free space to expand a partition. If you have none, you'll need to shrink another partition so that you have some free space.

    Oops... I just saw the part in your post that you do have some free space. I'm not sure what's going on, then.

    Let us know how it goes with the other partitioner.
    oz

  7. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Post the output of fdisk -l and df -h commands.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  8. #8
    Just Joined!
    Join Date
    Oct 2007
    Posts
    5
    I booted to GParted Live CD this morning and got the same results.

    Here is the fdisk and df ->

    Code:
    [root@dedicated1 root]# fdisk -l
    
    Disk /dev/sda: 73.4 GB, 73407820800 bytes
    255 heads, 63 sectors/track, 8924 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot    Start       End    Blocks   Id  System
    /dev/sda1             1         4     32098+  de  Dell Utility
    /dev/sda2             5      1575  12619057+  83  Linux
    /dev/sda3   *      1576      1727   1220940   83  Linux
    /dev/sda4          1728      8924  57809902+   f  Win95 Ext'd (LBA)
    /dev/sda5          1728      4694  23832396   83  Linux
    /dev/sda6          4695      4955   2096451   82  Linux swap
    /dev/sda7          4956      5216   2096451   82  Linux swap
    /dev/sda8          5217      5577   2899701   83  Linux
    /dev/sda9          5578      5943   2939863+  83  Linux
    /dev/sda10         5944      6858   7349706   83  Linux
    /dev/sda11         6859      7075   1743021   82  Linux swap
    
    Disk /dev/sdb: 73.4 GB, 73407820800 bytes
    255 heads, 63 sectors/track, 8924 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot    Start       End    Blocks   Id  System
    /dev/sdb1   *         1      8924  71681998+  8e  Linux LVM
    [root@dedicated1 root]# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/sda10            6.9G  456M  6.2G   7% /
    /dev/sda3             1.2G   44M  1.1G   4% /boot
    none                  503M     0  503M   0% /dev/shm
    /dev/sda9             2.8G   33M  2.6G   2% /tmp
    /dev/sda5              23G  2.6G   19G  13% /usr
    /dev/sda8             2.8G  667M  2.0G  26% /var
    /dev/sda2              12G  5.0G  6.3G  45% /home
    [root@dedicated1 root]#

  9. #9
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Partition structure is not good. 102MB space is enough for /boot partition but you have allocated 1.2GB. Moreover, there is no need to create separate /boot partition. You have 3 swap partitions. All distros can share same swap partition and there is no need to create more than one swap partition.

    Try to shrink /dev/sda9 ( /tmp ) and/or /dev/sda7 ( swap ) partitions and allocate free space to /dev/sda8 (/var).
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  10. #10
    Just Joined!
    Join Date
    Oct 2007
    Posts
    5
    Are you saying that I need to shrink sda7 or sda9 because I need to create space that is physically adjacent to sda8?

    There is unallocated space on the drive. I thought partitions could span physically separated blocks.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •