Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 08-13-2006, 12:30 PM   #1
LQ Newbie
Registered: May 2006
Distribution: Gentoo
Posts: 7

Rep: Reputation: 0
Help with partitioning hard drive

First off, ignore the username as I'm now using Gentoo. My hard drive is currently partitioned as shown below, from the fdisk printout.

Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 19428 156055378+ 7 HPFS/NTFS
/dev/hda2 19429 19437 72292+ 83 Linux
/dev/hda3 19438 19562 1004062+ 83 Linux
/dev/hda4 19563 24321 38226667+ 83 Linux

From 1 to 4 the partitions are Windows XP, boot, swap and root. The vast majority of my music and videos are stored on the NTFS Windows partition, and what I'm trying to do is reduce that partition by about 50gbs and create a FAT32 partition which I can use solely for storage, and have read and write access to from both Gentoo and Windows. Freeing up the space is easy enough, but I was wondering if its possible to create the extra partition in any way without formatting one of the existing ones, as I already have 4 primary partitions. I'm assuming that to turn the root partition into an extended partition which could also have the boot partition housed in it would mean formatting it first... so basically I'm stuck.

I'm relatively new to Linux, so any help would be greatly appreciated.
Old 08-13-2006, 01:31 PM   #2
Senior Member
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020

Rep: Reputation: 45
as far as i know there exists softwares to re-partition the existing drives without formatting (like partition magic for windows), but your case is bit different.
Since the issue is making an extended partition, so the softwares may not work in this case. In that case you will have to format that particular drive.
This can be any of the four primary one, not necessarily the last one i.e root.

Old 08-13-2006, 01:46 PM   #3
LQ Guru
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 64
Well to shrink the ntfs partition I would use partition magic to that. Just can't trust a linux tool like parted to that. Next big issue is the most you can have is 4 primary partitions. You wish to add a new 5th partition and format it as vfat. The only way to do what you want is to delete the hda4 partiton and then create an extended partition to add logical partitions to. This is where one can create the hda4 back but it will be hda5 and then hda6 for the fat32. It can be done but I would backup all data you wish to keep. Also I don't see a swap partition. all are identified as 83 where as swap is type 82.

This is one complex job you wish to do. It will take time to do. What I would do is either get a new harddrive or ext usb drive big enough or borrow one or the other from a friend. Then boot with a live CD and copy the data to the extra drive for /boot and / of the drive. Then bootup to windows and using partition magic to shrink the ntfs partition. Now reboot with live cd and using qtparted delete all partitions and then create the ones you need. hda2 and hda3 the sizes needed. Best to leave the drive mount points the same. Example if hda2 was /boot then make the new /hda2 as /boot again. Same for hda3. Now for hda4 it will be an extended parition using the remaining drive space. Now create logical partitions you need with size. Now you have hda5. format as ext2 or ext3 or what every you prefer. Now if orginal /hda4 was / then make /hda5 as /. Now was all partitions are created, formatted and data restored you will need to edit /etc/fstab to change /dev/hda* to match the new mount points.

Check this live cd
Also check out one of the other live cd like knoppix, ubuntu, gentoo

Sorry if confusing but it is easier to do it than say it. So many things to do. It would be easier if you have a second drive to work with. If you go this route then maybe I make it clearer.

Last edited by Brian1; 08-13-2006 at 01:48 PM.
Old 08-13-2006, 01:57 PM   #4
Registered: Mar 2006
Location: Edinburgh, UK
Distribution: debian
Posts: 304

Rep: Reputation: 30
Here's a possibility (but I take no responsibility):
(read and understand all of this before beginning)

- this depends on being able to resize hda1, so don't do any more if you can't do that
- use a live-cd
- resize hda1
- copy the contents of the boot partition to somewhere safe on hda4
- (use cp -R --preserve)
- delete the boot (hda2) and swap (hda3) partitions and make a new hda2 (primary partition) for your boot partition
- make a new hda3, as an EXTENDED partition, that fills all the leftover empty space
- you can put as many logical partitions into this - they will start as hda5
- copy your boot files back into hda2 (use same command)

so, after this, your hda4 (gentoo root) will still have the same name, you will still have hda2, BUT it will have moved, so the bootloader in the master boot record will not be able to find it. If you use grub you will have to set it up again.
Also your new swap (when you make one in the new extended partition) will have a different name, so you will need to change this in your gentoo /etc/fstab.

And you might have som e other issues, but I can't think what just yet.

Not simple, is it worth it?

If you do this, and it doesn't work, you'll have to re-install gentoo - emerge,emerge,emerge
Old 08-14-2006, 10:31 AM   #5
LQ Newbie
Registered: May 2006
Distribution: Gentoo
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for your help, it looks like it might something to leave for another day... as I really don't feel like risking all my data.

ps. Cheers for pointing me in the direction of that system rescue livecd, I can think of several occasions in the past where that would have come in very useful! Now I'll be better prepared next time I do something that nearly breaks my system!
Old 08-14-2006, 11:18 AM   #6
LQ Newbie
Registered: Nov 2002
Location: birmingham england
Distribution: Gentoo
Posts: 26

Rep: Reputation: 15
Instead of creating a new fat32 partition and having the problem of more that 4 partitions you could extend your linux ext2 ext3 partion and use that for storage .
If you use this in windows you can gain r+w access from windos


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
partitioning my hard drive bluemandrin Linux - Newbie 2 12-09-2005 05:18 PM
Partitioning a new hard drive soujrnr Linux - Software 2 12-09-2005 05:08 PM
Partitioning Hard Drive - Help simplyskate Slackware - Installation 13 07-04-2005 08:23 AM
Partitioning a hard drive phoenix_wolf Linux - Newbie 5 12-04-2004 02:50 AM
partitioning my hard drive stearic Linux - Newbie 1 01-07-2001 11:15 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:00 PM.

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