LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   uninstalling window xp on dual boot (https://www.linuxquestions.org/questions/linux-newbie-8/uninstalling-window-xp-on-dual-boot-583153/)

mark001 09-08-2007 10:15 AM

uninstalling window xp on dual boot
 
Hi,
I have dual boot window xp and fedora 6 on my pc.
I want to uninstall window xp and keep fedora 6.
How can I do this?
many thanks.

Gethyn 09-08-2007 10:23 AM

You can get rid of it by formatting the XP partitions and editing your bootloader configuration so that it doesn't show XP as an option any more. You can then mount the partitions for use under Linux. If you'd like more detailed instructions on how to do these steps, try searching and ask if you get stuck.

It's probably also possible to delete the XP partitions, and expand some Linux partitions to take up the extra space without the need for extra mount points, but it's not something I've ever tried to do.

mark001 09-08-2007 10:41 AM

hi,Gethyn
thank you for your info.
as I am very new to linux,what steps do I need to do to format window xp parition?
regards.

Gethyn 09-08-2007 12:44 PM

Before I start, are you sure that you want to remove Windows? Even if you're determined to make the switch away from Windows, it's often useful to keep a Windows install available as a backup in case of problems while you learn your way around Linux, this helped me out a lot while I was learning. Once you have more experience then it's safer to delete the partition.

Be very careful when doing this, you don't want to wipe out important data or your Linux install while it's running!

If you're sure you want to do it now, the first thing to do is figure out which partitions Windows is using. The best way to do this is probably by looking at the partition table. Bring up a command line, and issue the command 'fdisk -l' as root. This will list all the hard drives you have connected up, and how they are partitioned. Here's some sample output from my computer.
Code:

user@localhost:~$ sudo fdisk -l
Password:

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1  *          1        4660    37431418+  83  Linux
/dev/hda2            4661        4865    1646662+  5  Extended
/dev/hda5            4661        4865    1646631  82  Linux swap / Solaris

Each hard drive will have an entry that starts "Disk", followed by information about the drive and its partitions. As you can see, I have a single hard drive which is divided into 3 partitions, which are /dev/hda1, /dev/hda2 and /dev/hda3. I don't actually have Windows, so can't show you a direct example of a Windows entry, but hopefully you get the idea. Windows partitions will be marked something like NTFS or FAT32 under the System column. Most likely you'll only have one Windows partition, and it'll be in /dev/hda1 (or possibly /dev/sda1), but without seeing your setup I wouldn't know for sure. Make a note of the Device(s) of the Windows partitions.

Next, you want to make sure that the Windows partitions aren't mounted (formatting a partition that's mounted is probably not a good idea!). To check this, use the command 'mount'. Here's another example on my system:
Code:

user@localhost:~$ mount
/dev/hda1 on / type ext3 (rw,noatime,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.20-16-generic/volatile type tmpfs (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

Most of this you can ignore, I'm not sure what all of it means, the only lines you want to look for are the ones that match the Windows partitions you identified earlier. Such a line would probably look something like:
Code:

/dev/hda1 on /media/windows type ntfs (ro,noexec,dmask=0222,nosuid)
If there are no lines matching the device name of your Windows partition, that means it isn't currently mounted, in which case all is okay. If there IS such a line, then next you need to unmount the partition. To do this, use the command (as root) 'umount <mount_point>', where <mount_point> is the directory the partition is currently mounted to. For the made up example above, you'd use the command
Code:

user@localhost:~$ sudo umount /media/windows
Once that's done, just verify that the partition umounted successfully by using the command 'mount' again.

Now that the partition is unmounted, it's safe to format it (making sure that you have already copied all the data you wanted off it first!). The command to do this varies depending on which filesystem you want to use. I recommend ext3 because it's straightforward, and I'll give you an example for that; if you want to try something more exotic you can read around. Here's a command to format the former Windows partition from the fake example as ext3:
Code:

user@localhost:~$ sudo mke2fs -j /dev/hda1
Subsitute /dev/hda1 for the correct partition location you found out earlier.

The format will probably take a minute or two and tell you some rather incomprehensible stuff about what it's doing. Once it's finished, you can check the partition using the command 'fdisk -l' as root again. This time, the line that previously said "NTFS" should now say "Linux".

All that remains now is to mount the partition under Linux and remove Windows from your boot manager. I'm a little tired of typing right now, so I'll leave it to you to have a search on how to do this and ask again if you get stuck. Here's a hint: if you want the partition to be automatically accessible every time you boot up the computer, you need to edit the file /etc/fstab. Your bootloader is probably grub, and the grub configuration is usually stored in /boot/grub/menu.lst. Be careful when editing these files, but there is plenty of information on what to do available if you search. If you have problems, please try and be specific about what the trouble is!

mark001 09-10-2007 10:48 AM

Hi,

The reason why I wanted to unintall window xp is because it
is behaving very funny, I think my pc might have been hacked
or having virus.

After I uninstall windows, I will do a fresh install,
don't know how to do that yet.

I think I should learn how to unintall windows while keeping
fedora 6. then, install a fresh copy of window xp.

I will try what you have told me.

p.s. thanks for the detail info.

Thanks.

masterclassic 09-10-2007 11:39 AM

If you re-install win xp, it will overwrite the bootloader (grub) in the MBR, so you will need to re-install and configure grub too. Did you try to "repair" windows?

noobiwan 09-10-2007 07:33 PM

Quote:

Originally Posted by mark001 (Post 2887582)
Hi,

The reason why I wanted to unintall window xp is because it
is behaving very funny, I think my pc might have been hacked
or having virus.

You might want check the Windows install for spyware as well. Spy-bot Search and Destroy is a good freebie for that.

http://www.spybot.com/en/index.html

Be careful of a spy-bot spoof site that calls their product SpyWare-bot. It's exactly that, spyware.

Uninstalling and re-installing should be considered as a last resort because it is such a PITA.

mark001 09-12-2007 11:48 AM

HI, All,

I think if everything else failed, I should just do a back up for
Window and fedora 6, then format the window partition and Linux
partition and do a fresh insall for both. It is less of a PITA
for a newbie like myself.

Thanks for all the help from linux community.

Mark001


All times are GMT -5. The time now is 11:59 AM.