Partitioning After Dual-Boot

Hey,

I have dual-booted my laptop with Windows XP and linux. However, I forgot to repartition it prior to installing linux. Now my /dev/sda5 partition is full and I cannot download any data onto linux. I was hoping to find out a good easy way to go about repartitioning linux to do this. Here is the space currently:

Filesystem Size Used Avail Use% Mounted on
/dev/sda5 2.3G 2.2G 0 100% /
tmpfs 1001M 0 1001M 0% /lib/init/rw
varrun 1001M 108K 1001M 1% /var/run
varlock 1001M 0 1001M 0% /var/lock
udev 1001M 164K 1001M 1% /dev
tmpfs 1001M 76K 1001M 1% /dev/shm
lrm 1001M 2.4M 999M 1% /lib/modules/2.6.28-11-generic/volatile

If anyone could help me out, I’d greatly appreciate it.

Thanks!

This makes no sense to me. What we really need is you to boot a live cd and from a su terminal do:

fdisk -l

Post result
Explain what you think you have and what you want.

I don’t have a live cd. When I did fdisk -l in a terminal nothing happened. The output from my last post was from when I did df -h. I had windows xp on my laptop. I created a cd to install linux. I installed linux. I use linux for research. I tried to download some data from a site called routeviews for this research but I can’t because there isn’t any space left. I believe I need to repartition things to create space. The /dev/sda partition is where I believe the problem to be. Does this make more sense?

So you can actually boot to Linux?

Then you must be able to do fdisk -l
But it must be done as su

Here’s the output:

root@chrodgers-laptop:/home/chrodgers# fdisk -l

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

Device Boot Start End Blocks Id System
/dev/sda1 1 27 216846 de Dell Utility
/dev/sda2 * 28 7860 62918572+ 7 HPFS/NTFS
/dev/sda3 7861 19131 90534307+ 7 HPFS/NTFS
/dev/sda4 19132 19457 2618595 5 Extended
/dev/sda5 19132 19435 2441848+ 83 Linux
/dev/sda6 19436 19457 176683+ 82 Linux swap / Solaris

But you only have a total
/dev/sda5 2.3G 2.2G 0 100% /

And that’s it.
You just don’t have enough space unless you get rid of sda3 or sda3, whichever is the actual windows partition I am not sure. But you’ll want to keep windows, but maybe you can grab some off the other. But you will need to reinstall Linux.

But perhaps you can explain.

I’m fine with reinstalling linux if I need to but I want to make sure this doesn’t happen again. How do I go about getting rid of linux and partitioning things correctly before reinstalling?

About getting rid of sda2 or sda3, how would I do that. Also, do I need both sda5 and sda6 to keep linux or can I get rid of one of those as well?

First you need to tell us what is on sda2 and sda3

I’m not sure how to find that out.

You should know.
Can you read the contents in linux? Are they mounted?

Mount like this if they are not already:
From su terminal:

mount -t ntfs-3g /dev/sda2 /mnt/windows
mount -t ntfs-3g /dev/sda3 /mnt/windows

Sda2 is the partition where xp was installed (often windows calls this the C: drive). Sda3 is your second windows partition (often windows calls this the D: or the E: drive).

Junking one or both of C: \ and D: \ and reinstalling Linux as suggested by caf4926 is one option. But you can keep them too if you wish like this: You could shrink the two windows drives (sda2 and sda3) and stretch the Linux partitions into the space that shrinking makes free by using the Gparted partitioner instead.

swerdna, aren’t the two windows partitions sda2 and sda3, not sda1 and sda2?

You Posted:

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

Device Boot Start End Blocks Id System
/dev/sda1 1 27 216846 de Dell Utility
/dev/sda2 * 28 7860 62918572+ 7 HPFS/NTFS
/dev/sda3 7861 19131 90534307+ 7 HPFS/NTFS

/dev/sda4 19132 19457 2618595 5 Extended
/dev/sda5 19132 19435 2441848+ 83 Linux
/dev/sda6 19436 19457 176683+ 82 Linux swap / Solaris

I should have noticed sda2 has the boot flag. So then. Don’t you recall what is on sda3 or in windows it would be D:
sda1 is your recovery partition from Dell.

Of course – I had a concentration lapse – sheesh. I’ve edited the post in case someone else gets confused.

caf4926: I tried looking at it from windows but there are just 5 partitions listed (no names). The first 3 are blank by the name slot and the last two are C: and D: This is the first time I have looked at the partitions, this is a new laptop that came with windows installed. I have no idea what is on those. Also, what does the ‘boot flag’ mean?

Now I downloaded and ran gparted. I’m not sure if this will help figure out what is on sda2 and sda3 but the ‘file system’ and ‘label’ listed for each partition is the following:
/dev/sda1 fat16 DellUtility
/dev/sda2 ntfs OS
/dev/sda3 ntfs My Documents
/dev/sda4 extended
/dev/sda5 ext3
/dev/sda6 linux-swap

I would assume that means that sda2 is my C: and sda3 is my D:, correct?

Now as for space, sda1 and sda5 are the only ones that have anything listed under used/unused. sda1 says that 8.20MiB is used and 203.56MiB is unused. sda5 says 2.22GiB is used and 115.68MiB is unused.

swerdna, if I am using Gparted to resize as you suggested, could you offer and suggestions as to what space to move where?

swerdna, if I am using Gparted to resize as you suggested, could you offer and suggestions as to what space to move where?

First boot windows and defrag both NTFS partitions. Then backup all windows data files to an external media.

Then boot up the gparted CD. If the swap file is on and has a locked key symbol, R-click and turn it off with “swapoff”
Use your mouse to:
R-click the sda2 line, select resize and use the mouse to pull the RHS edge of sda2 to the left to make it smaller
R-click the sda3 line, select resize and use mouse to drag the whole graphic of sda3 to the left to fill the space you just made shrinking sda2. Then pull The RHS edge of sda3 to the left to make it smaller
R-click the sda4 line, select resize and pull the LHS edge of the extended partition, sda4, to the left, up to the edge of the shrunken sda3
R-click the sda5 line, select resize and pull the LHS edge of sda5 to the left to take up all available space.

Click the apply button.
Cross fingers and toes.

What seems to be the case is, sda2 is windows OS. And the laptop vendor has decided to put you user files on a separate partition sda3. This unusual but not unheard of. It is of course standard practice in most Linux distro’s.

If it were me. I would delete sda3. The only complication I can see here is, the laptop vendor has likely setup your windows OS with sda3 in mind, so recreate sda3 but much smaller, say 20GB - it’s currently 90GB.
So that should give you 70GB♎

Now I’m not too sure about the next step. What I mean is, if you can just expand the extended partition to take up all the slack, then adjust all the logical partitions accordingly. Bit messy, but I can check for you if you need to keep your info in linux.
I guess you are saying…what!
The extended partition sda4 is just a container for sda5, sda6,

If you don’t need the info on sda5 - I would say delete delete all sda3 thru 6
Then create a new extended partition taking up all the free space and then inside that create 3 partitions like this
swap (2GB)
/ (that’s your root partition 15GB - 20GB)
/home (all the remaining)

Boot flag is seen by the (*) currently on sda2

Does that make sense.

EDIT!
see John replied and he already knows. You seem to be able to adjust the extended and logical partitions. I wasn’t sure.

How do I defragment the NTFS partitions? Also, I do not have Gparted on a cd, I’m simply running it from Linux. Do I need to create a cd and do this from Windows or should it be ok if I work from linux?