LinuxQuestions.org
Review your favorite Linux distribution.
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 09-14-2008, 12:42 AM   #1
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali, Ubuntu, OpenSuse
Posts: 618

Rep: Reputation: 40
Thumbs down cant resize partition


Hi Guys,

I have a 160GB hard disk(sda) which is partitioned like this:

*Primary
- sda1 4.8GB NTFS /windows/C

*Extended
- sda5 63.4GB NTFS /windows/D
- sda6 2.0GB swap
- sda7 19.4 /
- sda8 29.2 /home

(sda5 had a 93.4GB partition but I used Gparted to resize it to 63.4GB)

I have 30GB unallocated. What I am trying to accomplish is use the 30GB unallocated to resize sda8 from 29.2GB to 59.2GB but I tried using gparted, qparted and Partition Magic and they only let me resize sda1, sda5 and sda6 I can not resize sda7 or sda8.

can anyone please help me?
thanks
 
Old 09-14-2008, 01:16 AM   #2
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
You,re unallocated space is as I assume between sda6 an sda5 you give it to partitions above so to sda5 and sda1
Any how this my understanding how it works
Swap you can nearly always change it
 
Old 09-14-2008, 01:34 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
If you tried to do this on a live system, then you wouldn't be able to move the swap partition until after running "swapoff". You could run "swapoff" to turn of the swap device and then delete it. Recreate it in it's new location. Moving the root partiton down wouldn't be possible on a live system. If you were running gparted off a live distro, you may be able to move the root partition /dev/sda7 down to it's new location. If not, see if you can create a copy of the partition there. If you can create a copy, then after the copy is created, delete your old root partition. Now the 30GB hole is before the /home partition. If gparted or YaST2's disk partition doesn't move the beginning of the /home partition, there is still room to create a copy of it in the hole and then afterwords delete the original /home partition. Use the copy in its place. The 30GB hole is now after the new /home partition and there will be no problem resizing it.

You may need to perform cloning operations on there own, to completion before going to the next step.

Another Way:
If you have an external drive, consider using it as a backup device for the files in the root and /home partitions. Then delete the swap, root and /home partitions and repartition the hard drive. Copy the files back from the backups you created. Be sure to use the -a (archive) option for cp to preserve the timestamps, ownership, links, and to copy recursively (-a is the same as -dpR).

Yet Another Way:
You might even consider using dd to create exact images of each of your partitions /dev/sda7 and /dev/sda8. Then you will be able to delete the swap, sda7 & sda8 partitions and recreate them in there new locations. For /dev/sda7, you could copy it's bit image replacing your new /dev/sda7. You would need to make the new root partition (sda7) the exact same size as it was before. Next partition and format your new /dev/sda8 (/home) partition. Mount the image file of sda8 (using the loop option) and copy the files from inside your image file backup onto the new and enlarged home directory.

---
Since you are not changing the number or order of the partitions, you will not need to make corrections to /boot/grub/menu.lst or /etc/fstab. If you were running Lilo, you would need to rerun liloconf to save the new start and end locations of the kernel.

Good Luck!
 
Old 09-14-2008, 08:49 AM   #4
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali, Ubuntu, OpenSuse
Posts: 618

Original Poster
Rep: Reputation: 40
wow it sounds pretty complicated.
 
Old 09-14-2008, 10:43 AM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,266

Rep: Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368
Post the output of 'fdisk -l' so we can see your actual partition structure. What is your extended partition? sda2? You only list one primary and four logical so...? I would assume the extended is sda2? Also, you don't indicate where on the drive the unallocated space is, between partitions? end of drive? Makes a big difference.

Last edited by yancek; 09-14-2008 at 10:46 AM.
 
Old 09-14-2008, 11:05 AM   #6
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali, Ubuntu, OpenSuse
Posts: 618

Original Poster
Rep: Reputation: 40
hello,

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x8a47a88b

Device Boot Start End Blocks Id System
/dev/sda1 * 1 637 5116671 7 HPFS/NTFS
/dev/sda2 638 19457 151171650 f W95 Ext'd (LBA)
/dev/sda5 638 8923 66557263+ 7 HPFS/NTFS
/dev/sda6 12843 13104 2104483+ 82 Linux swap / Solaris
/dev/sda7 13105 15639 20362356 83 Linux
/dev/sda8 15640 19457 30668053+ 83 Linux

I have to reboot my machine to run gparted live and see where the unallocated space is. I will do it in 5m.
 
Old 09-14-2008, 11:14 AM   #7
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali, Ubuntu, OpenSuse
Posts: 618

Original Poster
Rep: Reputation: 40
the unallocated space is between /dev/sda5 (ntfs) and /dev/sda6 (swap)
thanks!!!
 
Old 09-14-2008, 01:23 PM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
If you run gparted from a live distro, and don't activate the swap partition, you may be able to move sda6, sda7 and sda8 and resize sda7. I thought you indicated that you couldn't do it with gparted.

Since you don't need to save anything on the swap partition, you could delete it and recreate it just above sda5. Then gparted may allow you to move the others.

Last edited by jschiwal; 09-14-2008 at 01:26 PM.
 
Old 09-14-2008, 01:30 PM   #9
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali, Ubuntu, OpenSuse
Posts: 618

Original Poster
Rep: Reputation: 40
the partition that I'm trying to resize is dev/sda8. can I do it as explained above?
 
Old 09-15-2008, 05:09 AM   #10
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
You have partitions between the unallocated space and the partition you want to resize. You need to move them as well.

In gparted, right click on /dev/sda6 and select "resize/move". Drag it to the left. If gparted lets you move it, great. If not, it's just a swap partition. Delete it and create a new on just after /dev/sda5. Next right click on /dev/sda6 and select "resize/move". Drag it to the left as well. Then do the same with /dev/sda7. Lastly right click on /dev/sda8 and select "resize/move". Drag it to the left and increase the size to include the unallocated space. Click on "Apply all options".

Last edited by jschiwal; 09-15-2008 at 05:15 AM.
 
Old 09-15-2008, 10:50 AM   #11
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali, Ubuntu, OpenSuse
Posts: 618

Original Poster
Rep: Reputation: 40
Thanks jschiwal. I will def give it a shot tonight!!!
 
Old 09-15-2008, 01:29 PM   #12
moshebagelfresser
Member
 
Registered: Sep 2005
Location: Rishon Le Ziyyon Israel
Posts: 173

Rep: Reputation: 19
You might be able to resize partitions using Partition Magic through Windows. But sometimes this cannot be done as you are notified this partition was not created with it.
 
Old 09-16-2008, 07:59 AM   #13
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali, Ubuntu, OpenSuse
Posts: 618

Original Poster
Rep: Reputation: 40
ok jschiwal, I was able to resize my partition!!! however now my Grub doesn't work! It was kinda late last night to try to repair the Grub I would give it a shot tonight. First issue is fixed! now I have a bigger partition!
Thanks for your help!
 
Old 09-16-2008, 09:19 AM   #14
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,266

Rep: Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368
If you've re-sized and moved partitions they may have different names (sda5, sda6??) so justrun fdisk -l again to see what your partitions for Linux are.
 
Old 09-16-2008, 09:31 AM   #15
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali, Ubuntu, OpenSuse
Posts: 618

Original Poster
Rep: Reputation: 40
yes, /dev/sda6 ext3
/dev/sda7 ext3
/dev/sda8 swap

everything else is the same. maybe I have to re-configure Grub.
 
  


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
Unable to Resize NTFS partition with 4 different partition editors Alexandrian Linux - Newbie 11 05-19-2006 06:09 PM
Disk Partition Resize Trouble and Partition Questions GNewbie Linux - Newbie 2 11-15-2005 04:15 PM
How to resize a partition and create/mount a new partition? Maarten_Holland Linux - Newbie 1 04-20-2005 08:56 AM
Partition Out Of Space? How to resize from another partition? colelinux Linux - Newbie 6 03-16-2004 08:48 AM
resize an ext3 partition with coexisting ntfs partition andy_g Linux - Newbie 1 02-03-2004 05:38 AM


All times are GMT -5. The time now is 09:57 AM.

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