Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This is what GParted displays about my partitions.

Screenshot from GParted

And this is the output from df:

Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda1       61409452 4503052  53786836   8% /
udev              499168       4    499164   1% /dev
tmpfs             203192     784    202408   1% /run
none                5120       0      5120   0% /run/lock
none              507972      88    507884   1% /run/shm

How do I expand sda1 by the amount of the unallocated space so that it's size be 160 GiB? Can't find a way so far. "Resize/Move" and "Delete" items in the right-click menus appear grayed out for all the partitions.

share|improve this question
1  
Not sure I fully understand the question. Can you not right click on /dev/sda2, choose 'resize/move', and then shunt it along the disk? And then resize /dev/sda1 up to the remaining space? Or just remove and recreate /dev/sda2, after expanding /dev/sda1 (it's only swap you've got in there, after all)? –  ire_and_curses Sep 9 '12 at 18:55
    
+1 to the above; Considering your particular setup I think it's easier to: 1. remove the swap partition sda5 (unmount it prior to removing it) 2. delete the extended partition sda2 3. enlarge sda1 as you please 4. recreate the swap partition and any other additional partitions, either in an extended container or as primary ones(no more than four) –  don_crissti Sep 9 '12 at 19:16
    
@ire_and_curses "Resize/Move" is grayed out for any partition, same with "Delete". Made the edit to mention that. Would it make the difference if I boot from Live CD? (Sorry, I'm pretty much new to Linux.) –  Desmond Hume Sep 9 '12 at 19:24
    
@don_crissti Please see my comment on the ire_and_curses' comment. –  Desmond Hume Sep 9 '12 at 19:25
1  
@DesmondHume - yes, boot from the livecd, UNMOUNT your partitions then proceed to resize/remove/recreate as per your taste –  don_crissti Sep 9 '12 at 19:29
show 4 more comments

1 Answer 1

up vote 4 down vote accepted

You can use Gparted to accomplish your task.

Make sure that you do this from a live CD, to make sure that the drive(s) are unmounted.

This article shows how you can modify the partitioning of your Linux system with GParted (Gnome Partition Editor) without losing data. This includes resizing partitions (enlarging and shrinking), moving partitions on the hard drive, creating and deleting partitions, and even modifying filesystem types. GParted is a free partition editor available as a desktop program and also as a Live-CD. It supports the following filesystems: ext2, ext3, fat16, fat32, hfs, hfs+, jfs, linux-swap, reiserfs, reiser4, ufs, xfs, and even ntfs (Windows). Have alook at this

Source: howtoforge

NOTE: When dealing with partitions, always make sure that a backup is available in case something goes wrong. You may consider Clonezilla

share|improve this answer
    
Gonna give it a shot later. Thanks. –  Desmond Hume Sep 9 '12 at 19:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.