LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-17-2013, 11:33 AM   #1
kdelover
Member
 
Registered: Aug 2009
Posts: 311

Rep: Reputation: 36
Extending an ext 4 partition


Hello folks,

I have a 1TB drive,and i have created a 40GB partition for Linux.Unfortunately,i believe i may run out of space soon.I have lot of unallocated space on my drive and i would like to extend this partition.i will have to use parted/gparted since fdisk woudln't work on a GPT drive. This is what i have currently.

Code:
Disk /dev/sda: 1953525168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start        End          Size        File system     Name                          Flags
 1      2048s        2047999s     2045952s                    Basic data partition
 2      2050048s     2582527s     532480s     fat32           EFI system partition          boot, hidden
 3      2582528s     4628479s     2045952s                    Basic data partition
 4      4630528s     4892671s     262144s                     Microsoft reserved partition  msftres
 5      4892672s     942528511s   937635840s  ntfs            Basic data partition
 6      942528512s   1020653567s  78125056s   ext4
 7      1020653568s  1024653311s  3999744s    linux-swap(v1)
 8      1024653312s  1024661503s  8192s                                                     bios_grub
 9      1873403904s  1925832703s  52428800s   ntfs            Basic data partition
10      1925832704s  1953523711s  27691008s   ntfs            Basic data partition          hidden, diag

My linux partition is numbered 6.Id like to extend it by using the unallocated 100GB space from either 1 or 3.
In the first place is it doable ?The units are in sectors.
 
Old 08-17-2013, 12:52 PM   #2
PECONET009
Member
 
Registered: Sep 2006
Location: Finland.
Distribution: kali linux.
Posts: 156

Rep: Reputation: 21
Lightbulb This might help you with your issue...

Quote:
Originally Posted by kdelover View Post
Hello folks,

I have a 1TB drive,and i have created a 40GB partition for Linux.Unfortunately,i believe i may run out of space soon.I have lot of unallocated space on my drive and i would like to extend this partition.i will have to use parted/gparted since fdisk woudln't work on a GPT drive. This is what i have currently.

Code:
Disk /dev/sda: 1953525168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start        End          Size        File system     Name                          Flags
 1      2048s        2047999s     2045952s                    Basic data partition
 2      2050048s     2582527s     532480s     fat32           EFI system partition          boot, hidden
 3      2582528s     4628479s     2045952s                    Basic data partition
 4      4630528s     4892671s     262144s                     Microsoft reserved partition  msftres
 5      4892672s     942528511s   937635840s  ntfs            Basic data partition
 6      942528512s   1020653567s  78125056s   ext4
 7      1020653568s  1024653311s  3999744s    linux-swap(v1)
 8      1024653312s  1024661503s  8192s                                                     bios_grub
 9      1873403904s  1925832703s  52428800s   ntfs            Basic data partition
10      1925832704s  1953523711s  27691008s   ntfs            Basic data partition          hidden, diag

My linux partition is numbered 6.Id like to extend it by using the unallocated 100GB space from either 1 or 3.
In the first place is it doable ?The units are in sectors.
More info here:
http://www.linuxforums.org/forum/sus...partition.html
 
Old 08-17-2013, 01:11 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
The püroblem is your partition order. Since there are several partition between the partition you want to decrease in size and the partition you want to extend there is no easy way of doing it. You would have to remove the partitions 4 and 5, resize partition 3, move partition 6 into the new free space and extend it, then re-creating partitions 4 and 5 in their new place. All these opertaions should only be done when having a good backup (as you should have anyways), since partitioning operations are dangerous to data integrity. It would be easier if you can get some free space from partition 5 instead of 1 or 3, since you then can just extend partition 6 into the free space. This would be different if you have installed your system usding LVM, which allows extending filesystems over several partitions that don't have to be next to each other.
 
Old 08-17-2013, 01:50 PM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
Quote:
Originally Posted by kdelover View Post
My linux partition is numbered 6.Id like to extend it by using the unallocated 100GB space from either 1 or 3.
In the first place is it doable ?The units are in sectors.
Assuming you're able to shrink partitions 1 or 3 to free up some space (and if they're Windows partitions with free space and not to much fragmentation, the Windows Disk Manager should be able to shrink the partitions), you'll either have to use a Live CD to move data around, like PECONET009 suggested, or migrate your data to another type of disk setup manually.

TobiSGD mentioned LVM being able to use space from a pool of different partitions and/or drives. It would be possible to create an LVM partition in the free space made available by shrinking partitions 1 and/or 3, migrate your data to that partition, and then erase the old partition and recreate it as LVM.

Whichever route you choose, remember there's always a small risk of data loss when partitions are resized or otherwise manipulated. Make sure your backups are recent before starting.
 
Old 08-17-2013, 01:55 PM   #5
kdelover
Member
 
Registered: Aug 2009
Posts: 311

Original Poster
Rep: Reputation: 36
Hi guys,

Thanks for your replies.This is a new laptop and Lenovo has fairly messed up the partitions and this laptop comes with
Windoze 8 preinstalled.The 2x100GB partitions i have is what Lenovo gave me as an OEM and a Recovery partition,which i have removed after creating the backup on an External drive. I think i may nuke everything off the drive and do a clean install of Windoze and subsequently Linux.
 
  


Reply



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
Partition Extending gurumathan Linux - Newbie 3 06-29-2011 07:33 PM
extending existing windows-partition and changing os on linux partition ungua General 8 05-05-2009 11:01 AM
Extending LVM partition?? your_shadow03 Linux - Newbie 3 01-16-2009 02:43 AM
Extending home partition pwilkie Linux - General 4 03-05-2005 07:32 AM
Extending a partition with RH Linux? xmdms Linux - Enterprise 2 11-25-2004 09:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:47 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
Open Source Consulting | Domain Registration