Change partitions?

Rashkae ubuntu at tigershaunt.com
Tue Jul 15 20:58:57 UTC 2008


Ed Jabbour wrote:
> On Tuesday 15 July 2008  Nils Kassube wrote:
>>> Ed Jabbour wrote:
>>>> Current partition table:
>>>>
>>>> sdb1, primary .............................. empty
>>>> sdb2, primary .............................. backup files
>>>> sdb3, ........................................... extended
>>>> sdb5, logical ................................. ubuntu installation
>>>> sdb6, logical ................................. swap
>>>>
>>>> I'd like it to be:
>>>>
>>>> sdb1, primary .............................. ubuntu installation
>>>> sdb2, primary .............................. backup files
>>>> sdb3, primary ............................... swap
>>>>
>>>> If possible, I want to avoid re-installation of the OS.  Is there any
>>>> way just to change the partitions, leaving whatever is on them intact?
>>>> gparted's copy won't do it, I hear.  Any hints, pointers, etc. greatly
>>>> appreciated.
>>> Could you be a bit more specific what you want to have in the end? What
>>> is the size of the individual partitions now and what should it be after
>>> the modification?
> 
> Now:
> sdb1  77GB	
> sdb2  62GB w/ 59 GB used	
> sdb5  89 GB w/ 28 GB used 	
> sdb6  3200 MB
> 
> After:
> sdb1 140GB
> sdb2   90GB
> sdb6  3200MB
> 
> More or less - if that adds up OK.
> 
> On Tuesday 15 July 2008 Rashkae wrote:
>> No matter how you look at it, the only "sane" way to do this is to have
>> a second hard drive to use as temp storage, so you can copy data off the
>> drive, repartition, then copy back.
> 
> gparted has a copy function, but I think I read somewhere that a simple copy 
> of an OS to a partition wouldn't boot properly.  Is that right?  There is a 
> second drive - sda - but it's full.  If the copy from sdb5 to sdb1 will boot, 
> there's no problem repartitioning, I think.
> 

I would create a new ext3 filesystem on sdb1, then I would copy from
sdb5 to sdb1 (this is probably best done from a live cd.  mount both
partitions, then do something like:

cp -ax /mnt/sdb5/. /mnt/sdb1/

you then have to edit the /etc/fstab as well as the /boot/grub/menu.lst
files to replace the old UUID with the new UUID.

The fun begins when you have to move your sdb2 to make room to grow sdb1
to it's full size.





More information about the ubuntu-users mailing list