1

Topic: Newbie question

My son has a netbook with a 160 gig HD that a friend partitioned for him with Fedora on the second partition. The idea was that he'd learn Fedora, but that didn't happen and he has no use for it. He's now running out of space in Windows XP and would like to recover the disk space on the Fedora partition because he'll never use it.

I've downloaded Gparted 0.12.1-1 and burned it to DVD. What would be my next step to accomplish what we want to do? Do I just stick the disk in the drive and see if it boots to Gparted? If it doesn't boot, do I change the bios to boot from CD and then try?

Once Gparted is running, how do I proceed? Do I find the Fedora partition and just delete it and then then stretch the Windows partition to the full size of the disk? Is there anything I have to watch out for?

I'm not totally new at this stuff because I partitioned hard drives in DOS 3.3, but I've never tried Gparted and don't want to screw anything up.

2

Re: Newbie question

I've downloaded Gparted 0.12.1-1 and burned it to DVD. What would be my next step to accomplish what we want to do? Do I just stick the disk in the drive and see if it boots to Gparted? If it doesn't boot, do I change the bios to boot from CD and then try?

Exactly.  The CD/DVD drive must be before the hard drive in the boot sequence.

Once Gparted is running, how do I proceed? Do I find the Fedora partition and just delete it and then then stretch the Windows partition to the full size of the disk? Is there anything I have to watch out for?

You can either delete the fedora partition and grow the xp partition to take the disk space, either just format it in some file system that xp is able to use and use it as a data partition (it will appear in xp with a new letter).
The second method is much easier and faster. The first one offers a single disk space.

It is very probable that there are 2 partitions for fedora: one for the system it self and another one for swap (1-2 GiB). This is usual in Linux systems, although it is possible to have a setup with no swap partition or with a swap file. In this case, you have to delete both. If there is any extended partition that contains them, you have to delete it, too.

To resize the xp partition (usually ntfs) be careful to select the option Nothing or No align in the Align box. Furthermore, don't touch the start of the partition. Just, drag the end of the partition to the right, to the end of the drive space. Trying to resize with an align option other than the actual one will break the boot process (it is possible to repair it with the xp install cd, however it is better to avoid the problem).

I'm not totally new at this stuff because I partitioned hard drives in DOS 3.3, but I've never tried Gparted and don't want to screw anything up.

The DOS3.3 fdisk was quite simple. It asked just for the % of the drive to give to each partitions. The unix fdisk was quite more complex. GParted offers graphical use for the various tools, although in some special cases we need to go back to the command line.

Don't try to stop a running operation. A broken resize can be harmful foe the data integrity.

It is safer and recommended to keep backup of any important file of the hard drive. In most of the cases there is no problem, however there is always chance that something happens: hardware failure, power break, bad setors, defective connections or cables... as well as file system problems, software bugs.

In case of dubt, you can post here a screenshot of GParted and the output of the command
sudo fdisk -l -u
(l is the lowercase L) from the terminal window, for additional advice.
The GParted log stays in RAM and goes away after shut down. So, to keep the content you have to press the Save details button at the end of the operations to save it in html format and then copy it from the RAM to an external medium (USB stick, floppy disk... ).
Look for "Saving GParted details" in the GParted live manual.

*** It is highly recommended to backup any important files before doing resize/move operations. ***

3

Re: Newbie question

Okay, I got to where it boots from the CD drive and into Gparted. Before I start deleting partitions, I want to know what I can safely delete. I see seven items. Here is a screen shot (I had to take a photo because I found I couldn't easily save a real screen shot. Like I said, all I want to do is return the whole HDD to Windows.

http://i.imgur.com/nWBD3.jpg

4

Re: Newbie question

It seems that /dev/sda1 is the xp system partition.

The 2 logical partitions /dev/sda5 and /dev/sda6 are the Linux partitions, you want to delete.  /dev/sda2 is the extended partition that contains them.

/dev/sda3 and /dev/sda4 are primary partitions that are probably recovery and testing tools. This is usual for computers with pre-installed mswindows operating system. I think you have to keep them, unless you are absolutely sure that you don't need their content.

I am not sure if you can easily delete /dev/sda2, because this could alter the partition sequence and the eventual recovery and testing operations. If these operations were already broken by the creation of the extended partition, then you could delete it.
If no, you can shrink it to a minimum, say 2 cylinders, that will be very small lost disk space.

The final unallocated of 2.49 MiB is just a small fraction of cylinder, you can neglect it.

Another scenario would be to leave one logical partition only, format it as fat32 or ntfs and use it as a data partition for xp.  You could even resize them.
Just, keep in mind to use the cylinder alignment if the first partition starts on sector 63.

Another remark: although it is possible to schedule many operations, it is better and safer to go step by step, reboot into xp and check each step. It is somehow longer but you have better control this manner.

*** It is highly recommended to backup any important files before doing resize/move operations. ***

5

Re: Newbie question

So if I delete /dev/sda5 and /dev/sda6, then I'll be able to drag the end of /dev/sda1 so it's almost twice the size I've got?

6

Re: Newbie question

If you delete /dev/sda5 and /dev/sda6, you 'll have an empty /dev/sda2. Their space belongs to /dev/sda2.
So, you need either delete /dev/sda2 (the light blue frame), or shrink its start to the right, to minimize it.

After that, you will be able to drag the right border end of /dev/sda1 to the right, to take the empty space. The total will be almost 72+72=144 GiB.
For this resizing operation, it is safer to select align to Nothing. And remember, don't touch the start of the partition.

*** It is highly recommended to backup any important files before doing resize/move operations. ***

7 (edited by oldyellr 2012-04-25 19:44:51)

Re: Newbie question

Okay, so I would just delete /dev/sda2 and /dev/sda5 and /dev/sda6 would disappear because they're in the extended partition. Then, drag the end of /dev/sda1 to the right to take up the recovered space. I think I've got it.

Here is what Windows shows, which helps me understand it better:

http://i.imgur.com/ZgYet.jpg

8

Re: Newbie question

I don't see any change. Did you apply the operations?

*** It is highly recommended to backup any important files before doing resize/move operations. ***

9

Re: Newbie question

No, that's still from before.

This is what I did in GParted:

http://i.imgur.com/eqqDF.jpg

Now it won't boot Windows. All I get is this:

(see next message, looks like I can't post 2 links)

I'm sure I did everything as we discussed. What can I do now, or is Windows toast?

10

Re: Newbie question

Here is what I get when I boot:

http://i.imgur.com/M6Ctl.jpg

11

Re: Newbie question

I see that the partitions are as expected. The unallocated is just a small fraction of a cylinder.

It seems that the bootloader of the previous configuration was grub, set by fedora and installed (partially) in the deleted partition.
The bootloader usually installs a part of the code in the sector 0 of the drive, and another part + configuration files in another partition.

Now, you can fix the boot by using the xp cd (not necessarily the one that installed this system, it can be any xp install cd). Booting from that cd, you have to select the recovery mode (or recovery console). This will give you a dos prompt screen.
There are 3 commands that are used in this:
fixmbr  (it writes the boot code into the master boot sector)
The full format of the command is something like fixmbr \Device\HardDisk0. The device name is optional (so, you can ommit it, as you have only one hard drive).

fixboot  (it writes boot code to the system partition)

bootcfg  (this is mainly to configure boot-up in a system with multiple installations).

You can search with google for 'xp fixboot fixmbr' for details in the microsoft online help.


Perhaps there are other possibilities to fix boot too, using any boot option related to the partition /dev/sda3, marked 'PE'. I don't know what it could contain without some information on it.

*** It is highly recommended to backup any important files before doing resize/move operations. ***

12

Re: Newbie question

I was ready to use those commands and booted from the CD that came with the netbook. It went into a recovery mode and ended up installing Windows from scratch. No opportunity to use those commands. All his data is gone sad   I really wasn't expecting this. I guess he lost all the baby pictures.

13

Re: Newbie question

This is not a happy thing. Probably, the recovery mode for this cd was a full system recovery, not the repair mode.
I don't stop to write about the need of a backup.
However, you can try to recover  deleted files from the drive, using photorec.
The photorec application is designed to help recover many different types of lost files.
For more information about photorec, see http://www.cgsecurity.org/wiki/PhotoRec.
Try to not use the new system until you complete the recovery work.

*** It is highly recommended to backup any important files before doing resize/move operations. ***

14

Re: Newbie question

There was nothing critically important and irreplaceable in the laptop. Most of the baby pictures were spread around among the family and still exist. I suppose if I'd used an XP disk from a different computer or downloaded one, it would have worked as you outlined. The weird thing is that the new restored system has two 72 gig partitions, C: and D:.

15

Re: Newbie question

Many computers/vendors (most of them? ) don't provide a full setup cd for the operating system, just a cd to restore a default setup.
So, it is very probable that the 2-partition scheme was that of the original setup. Perhaps the friend created the 2 linux partitions for fedora (ext4 and swap) in the existing /dev/sda2. Ironically, this was the second of the propositions in the post 2!

*** It is highly recommended to backup any important files before doing resize/move operations. ***