LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-29-2008, 06:11 AM   #1
Steve W
Member
 
Registered: Mar 2007
Distribution: Ubuntu 12.04, XUbuntu 12.04
Posts: 504

Rep: Reputation: 44
Resize existing partitions


The root partition on my Linux install is filling up fast (I only gave it 3.78Gb on install - next time I'll do more!), but I have lots of room on other (unused) partitions. I wanted to somehow merge the space on another partition with my root partition, but without having to reformat my HDD and start again. I wondered if there was a way (using GParted, perhaps) I could manipulate the existing partitions by perhaps deleting an existing unused one and expanding my root partition to use that freed-up space.

If I knew a terminal command that would output for you the relevant information, I would use it, but since I don't, I uploaded a screenshot of GParted here: http://www.btinternet.com/~stevewy/GParted.jpg. In case this board deletes hyperlinks as Spam, a rough description is:

My root partition is on sda8 (ext3, size 3.78Gb, only 317Mb free).
sda8 is part of an "extended" sda4, which encompasses sda8, sda9 (linux-swap), sda6 (ext3, 8.59Gb, only 3% used), sda7 (439Mb) & sda5 (871Mb), both Linux-swap, possibly from earlier now-deleted distros.

sda3 is a nice unused 5.42Gb ext3 partition, sda2 is my /home, and sda1 is Windows XP.

Phew.

So basically I want to maybe delete sda7 and sda6 and merge the freed-space with sda8 (my root). Would that work?

Sorry to be so confusing, but any advice would be appreciated.

Last edited by Steve W; 10-29-2008 at 06:15 AM.
 
Old 10-29-2008, 06:35 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,997

Rep: Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219
gparted is very good - you can do it all from there. Either just "grab" the side of a partition and drag it, or highlight and use the resize button. Then apply it.
Needs some thought to arrange things properly, but reasonably straight-forward.

Do yourself a favour and download the gparted liveCD and do it all from there - playing with mounted partitions (from your active system) is asking for trouble.

After-thought: you may have to fix your boot-loader after this if that gets moved in all the re-arrangements.

Last edited by syg00; 10-29-2008 at 06:36 AM.
 
Old 10-29-2008, 06:49 AM   #3
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
If the partitions are contiguous you may be able to grow a partition. With your seriously sub-divided sda4, I would consider:

1. backup your root partition by copying contents of sda8 to sda3 - if you boot using a live CD then you can simply use "cp -a" (archive) to copy all of sda8 to sda3 (well, after mounting those partitions somewhere)

2. delete all 'logical' partitions (from your description most are unused, 1 is your swap, and 1 is your current root partition)

3. create one large root partition and one swap partition

4. copy your root partition backup to the final root partition

5. edit the fstab file to reflect the new root and swap partitions

6. reinstall (or reconfigure) the bootloader

7. decide what to do with 'sda3'

Personally I find 10GB good for the root partition of most of my installs; some installs I do use as much as 20GB, none are set up for more than 40 (and the few that have a 40GB '/' barely use half that space). Of course the amount of space actually taken depends on your own habits.
 
Old 10-29-2008, 07:05 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Posting that link is fine---the other way to do it would be to post the output of fdisk -l (ell, not one).

I think you can do what you want with GParted (use it from a liveCD), but I would recommend starting over. One potential issue is that all the moving and resizing might mess up the bootloader configuration. Assuming you have GRUB, it gets "hard-coded" to point to the partition containing its files.

What I would do is:
  1. Backup all important data
  2. Delete everything except sda1 (Windows, I assume)
  3. Resize sda1 (down)
  4. Create a new swap (1GB minimum) at the end
  5. Create a new Linux partition (~8-10GB)
  6. Create a new partition for shared data (can be FAT32 or even ext3---if ext3, then use something like ext2fsd in Windows to access the data) Make this one a logical
  7. Re-install on the new Linux partition (Use it as / and don't bother with a separate partition for /home)

Ideally, I would allocate space roughly as follows:
Windows 10-12 GB
Linux 8-10 GB
Shared data 20-30 GB (logical--inside an extended partition)
Keep the rest as spare (logical--inside an extended partition)
 
Old 10-29-2008, 07:09 AM   #5
harry2006
Member
 
Registered: Aug 2006
Location: /hawaii/honolulu/downtown
Distribution: Fedora 10[Cambridge] and Ubuntu 9.04[Jaunty]
Posts: 201

Rep: Reputation: 30
Quote:
Originally Posted by Steve W View Post
The root partition on my Linux install is filling up fast (I only gave it 3.78Gb on install - next time I'll do more!), but I have lots of room on other (unused) partitions. I wanted to somehow merge the space on another partition with my root partition, but without having to reformat my HDD and start again. I wondered if there was a way (using GParted, perhaps) I could manipulate the existing partitions by perhaps deleting an existing unused one and expanding my root partition to use that freed-up space.

If I knew a terminal command that would output for you the relevant information, I would use it, but since I don't, I uploaded a screenshot of GParted here: http://www.btinternet.com/~stevewy/GParted.jpg. In case this board deletes hyperlinks as Spam, a rough description is:

My root partition is on sda8 (ext3, size 3.78Gb, only 317Mb free).
sda8 is part of an "extended" sda4, which encompasses sda8, sda9 (linux-swap), sda6 (ext3, 8.59Gb, only 3% used), sda7 (439Mb) & sda5 (871Mb), both Linux-swap, possibly from earlier now-deleted distros.

sda3 is a nice unused 5.42Gb ext3 partition, sda2 is my /home, and sda1 is Windows XP.

Phew.

So basically I want to maybe delete sda7 and sda6 and merge the freed-space with sda8 (my root). Would that work?

Sorry to be so confusing, but any advice would be appreciated.
how far have you been? are you still facing problems? in my opinion the best option is to use Gparted as already mentioned. thanks.
 
Old 10-29-2008, 11:28 AM   #6
Steve W
Member
 
Registered: Mar 2007
Distribution: Ubuntu 12.04, XUbuntu 12.04
Posts: 504

Original Poster
Rep: Reputation: 44
Hmm. As this doesn't appear that straightforward, I might wait until I install Ubuntu 8.10 later on in the year. Especially since "starting from scratch" seems to be the preferred option. I'll use GParted on my Knoppix live DVD to remove all partitions except the Windows one and my /home, then install onto the newly merged "big" partition. In fact, Ubuntu is known for having a flexible installer, so it might help me out itself there.

Thanks for the advice.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I resize partitions? watha SUSE / openSUSE 4 09-28-2006 11:29 PM
resize existing partition w/o losing data rebelscum Slackware 8 07-21-2005 06:44 PM
Resize existing and add another partition with LVM donv2 Linux - Newbie 3 04-27-2005 05:23 AM
how do i resize my partitions?? PeO Linux - General 10 08-27-2004 05:54 AM
Resize existing windows ntfs partition in mandrake Stoic Mandriva 8 10-17-2003 12:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration