Results 1 to 6 of 6

Thread: Linux - Shrinking a Partiition to Create Free Space

  1. #1
    Orca Whisperer n2ize's Avatar
    Join Date
    Dec 2007
    Location
    Crestwood, New York
    Posts
    33,899

    Linux - Shrinking a Partiition to Create Free Space

    Hi, I am currently running Fedora 22. Since I first partitioned my disc and installed Linux on this system my /var folder (which is on the root partition) has been growing in size, to the point where it's next to impossible to do upgrades because the cache under /var is too small. I want to move /var to it's own separate partition. I currenntly have a partition containing the filesystem "/mnt/volume1" that I use for projects, storing files, videos, etc. It is quite a large partition and only about 10% full. I would like to shrink this partition by about 25% - 30% and use the free space to create a new partition which will contain /var .

    From what I have read I believe I can use the "parted" or "gparted" utility to change the partition size. The question I have is once I shrink the partition will the reclaimed space show up as free space such that I can use parted (or fdisk) to make the new partition for /var ? If I can accomplish this successfully then I can copy the contents of /var to the new partition and format it (ext4) and then change fstab so that it will mount as /var boot time.

    Any suggestions ? Would the parted utility and fdisk be the best utilities for this of is their a better solution these days ?
    I keep my 2 feet on the ground, and my head in the twilight zone.

  2. #2
    Administrator ad4mg's Avatar
    Join Date
    Feb 2007
    Posts
    14,845
    Gparted should do the job for you John. Below is Gparted showing an NTFS partition on one of my HDD's. Note the orange arrow in the lower row of icons.


    Clicking that brings up the resizing window:


    You can resize the beginning or end of the partition by either dragging the arrow on either end of the partition, or you can enter the sizes manually.





    The empty space created becomes "free space", which can become a new partition, or provide space for expanding an existing partition.

    Gparted is about as user-friendly as it gets, as long as you understand the various partitioning schemes!
    QAnon / GOP Republicans mentally lack the necessary intelligence to even tell a decent lie (Ex: A cabal of Satanic, cannibalistic pedophiles run a global child sex trafficking ring and conspired against former President Dotard dRUMPf during his term in office... Jewish space lasers, etc.). What in the hell makes anyone believe these melon heads can actually govern?

  3. #3
    Orca Whisperer n2ize's Avatar
    Join Date
    Dec 2007
    Location
    Crestwood, New York
    Posts
    33,899
    Okay. This is exactly what I need. It will do exactly what I want. I used Gparted a long time ago when I had to re-partition a drive on a Windows machine to make room for Linux and I remember it worked fine. I'll give it go. Thanks for the help.
    I keep my 2 feet on the ground, and my head in the twilight zone.

  4. #4
    Banned
    Join Date
    May 2009
    Posts
    9,698
    Yep. Gparted is the standard, proven tool for this.

  5. #5
    Orca Whisperer n2ize's Avatar
    Join Date
    Dec 2007
    Location
    Crestwood, New York
    Posts
    33,899
    I might be able to simply shrink the /mnt/volume1 partition and then allocate the free space to the root partition which will mean there will automatically be more space for the /var directory which lies on the root partition. That will save me the trouble of having to create a new partition and move /var over to it and then change fstab.
    I keep my 2 feet on the ground, and my head in the twilight zone.

  6. #6
    Forum Addict n6hcm's Avatar
    Join Date
    Jul 2007
    Location
    FN13wb
    Posts
    2,821
    yup ... that should do the trick.
    "... and another thing about you democrats ... you all believe in science!" -- denny crane

Posting Permissions

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