LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Partition problems: half of my hard drive turned useless (https://www.linuxquestions.org/questions/linux-newbie-8/partition-problems-half-of-my-hard-drive-turned-useless-595698/)

Executor21 10-30-2007 01:23 AM

Partition problems: half of my hard drive turned useless
 
My computer has a 160 GB hard drive, which was split halfway between Win XP and Linux.

Recently, I've started to run out of space on the Windows partition. However, I couldn't just resize it (or maybe I didn't know how), since my Linux partition was split in 3 virtual partitions (/, swap, and /home), and the part of the disk contiguous to the Windows partition was the / section and not the /home secton, which I wanted to shrink and give to Windows.

So I came up with this plan:
Delete the Linux partitions
Give the whole drive to the Windows partition
Reinstall Linux, giving it less space this time

I used GParted utility on the Ubuntu 7.04 install DVD. The partitions were deleted, and merged into the Windows partition. However, according to GParted, all the new space of the Windows partition was now used--there was no new free space. The strangest thing was that the installer itself reported the correct amount of free space.

I searched, and the space bug in GParted is known. It was suggested that rebooting Windows might help, so I tried. But when I removed the Linux partition, I started getting errors with GRUB. So I had to reinstall the Windows MBR from my recovery disk to even get into Windows.

And now... there's no change in my system. Windows still sees only the part of the hard drive it had before, so I didn't get any new space. Essentially, my computer turned from a dual-boot 160 GB drive to a Windows-only 80 GB drive.

Is there a way to recover that space without reinstalling Windows? Either from Windows or using live CDs?

{BBI}Nexus{BBI} 10-30-2007 01:35 AM

There are plenty of freeware partition managers for winblows. Just google freeware partition manager.

syg00 10-30-2007 01:48 AM

Any decent (Linux) liveCD should do - open a terminal and post the output from "/sbin/fdisk -l"

emeut 10-30-2007 02:10 AM

Partition problem:half of my hard drive turned useless
 
Hi

You could try to use your window Xp to solve the issue.
Go to control panel
then administrative tools
computer management


You should get a window showing your differents drives and partitions.
If for some reason gqarted did not worked properly you should be able to delete the linux partion and format it in fat32.

from there your windows should see your new partition.

hope this is useful to you

emeut

pixellany 10-30-2007 07:58 AM

This is not what you requested, but I would not use a 160GB drive that way. I would recommend smaller partitions (~10-15GB each) for the operating systems, maybe 60-80GB for shared data, and the rest blank (unpartitioned) for future changes.
I now use ext3 for all shared data. Windows accesses it using the ext2fsd driver.

Be sure to backup (and maybe de-fragment) before attempting to resize a Windows partition.

Nomenclature: I don't think there's any such thing as "virtual partitions" inside other partitions. The fdisk suggestion will tell us what you have.

Executor21 10-30-2007 10:57 AM

OK, thank you for your replies.

{BBI}Nexus{BBI}: I do have a partition manager. The problem is what it says about my disk (see below).

pixellany: thanks, but before I try anything, I want to have my whole drive available to me.

emeut: I did. What I got was even more confusing than I had from third-party partition managers.

Here is a screenshot. The computer management actually contradicts itself in the two parts. If I had done it correctly, it would show a 145 GB NTFS partition, with 47.7 GB used and the rest free.

Here's the output of /sbin/fdisk -l:

Code:

Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1          6      48163+  de  Dell Utility
/dev/sda2  *          7      18982  152424720    7  HPFS/NTFS
/dev/sda3          18983      19452    3775275  db  CP/M / CTOS / ...


saikee 10-30-2007 11:37 AM

It would appear to me a defective application with an old version of Gparted.

The partition has been enlarged and the boundary changed but XP has not been told of the new size.

The resizing should have been done using the current version of Gparted or Parted Magic.

I would try to back up the dat and then use the latest partition tool to see if it can correct the mistake.

farslayer 10-30-2007 01:01 PM

check to see what is eating all your disk space on the windows side.. could be you have some huge temp files out there. I found over 50 GB, yes that was 50 GB of temp data, on my Boss's 80 GB hard drive, from his home computer, when he complained the drive was full..

scdiskinfo is a good windows utility to track down where the space on your windows box is being used..

Executor21 10-30-2007 01:33 PM

I tried to resize the partition using QParted on my Knoppix live DVD. I forgot to unmount it first, so it didn't let me. When I unmounted it and launched QParted again, here's what I got:

Screenshot

This is what it's supposed to show: a 145 GB NTFS partition, with 47.7 GB used. However, when I launched Windows, nothing changed. It still shows up as a 63.4 GB partition, with 47.7 GB used.

QParted is the only partition manager that shows what's supposed to be there. Should I use it to resize the partition, and hope Windows recognizes the change this time?

pixellany 10-30-2007 01:49 PM

I am lazy....

When I get into things like this, I simply re-install everything.

Just a guess: The partition table entries have data in the old CHS format AND the more modern and rational LBA. Is it possible that Windows reads one and Linux reads the other? If I were to try and hunt this one down, I would dump out the raw data and see if it is all internally consistent. But--as I said--I am lazy.

If you want to try, you can get the raw data thusly:

dd if=/dev/sda bs=1 count=64 skip=446|hexdump -C

To analyze it: http://ata-atapi.com/hiwtab.htm

saikee 10-30-2007 01:54 PM

You can have a healthy filing system with filing index not using up the entire partition space.

It is quite dangerous to switch partitioning tools around.

As far as Linux is concerned the partition boundary as stated in the partition table is the full size. You can load another 100 distros and seek advice another partitioning tools that will not get changed. Your problem is the XP does not accept the change.

It could also be due to your XP is using a backup as it may regard the partition change unauthorized. Vista certain does that. You can do your change but a MS Windows with such feature switched on may keep restoring the previous known safe copy of itself.

hal8000b 10-30-2007 02:35 PM

There are some great links in your answers.
In addition, you must backup your personal data first, as has already been suggested.

Windows always wants the first partition.

You have a small FAT partition before your main 145G partition, this may contain drivers or other information vital to your computer, so you may need to back this partition up as well.

Primary partitions valuble, if you ever consider installing FreeBSD or Solaris then you need a spare promary partition.

It it were me, I'd backup my software and flatten the lot, create a primary ntfs partition for windows and install linux in the extended partition, this way, you will have 2 primary partitions spare.

If you dont want to go down this route, then Acronis partition manager can also resize your windows ntfs partition.
HTH

Executor21 10-30-2007 06:13 PM

Well, I managed to fix this problem.

I used QTParted on Knoppix to re-size the NTFS partition, and rebooted windows. It ran the chkdsk utility, rebooted again, and showed the correct size. Basically, my computer is now the way it was when I bought it, with the entire disk devoted to Windows.

Now I'm going to try to reinstall Linux.


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