LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Dual boot: Formatting windows affects Linux? (http://www.linuxquestions.org/questions/linux-newbie-8/dual-boot-formatting-windows-affects-linux-924913/)

anjumanu321 01-21-2012 12:08 AM

Dual boot: Formatting windows affects Linux?
 
Hello All,

I have a dual boot system(windows + debian).
I want to format my Windows C partition for some reasons.
My question is will this affect the Linux partition which is on another drive?

ps:First I have installed Windows and later Debian Squeeze

thanks in advance,

Anji

towheedm 01-21-2012 12:13 AM

No, if it's on another physical drive it would not. However, if it's on another partition on the same drive with Debian it definitely would.

If you want to be absolutely sure nothing happens to the drive with Debian you can physically disconnect it first, or simply disable it from the BIOS. You can then re-connect/enable it afterwards.

anjumanu321 01-21-2012 12:18 AM

And how about if Linux is on a different partition(say G:) on the same hard disk which has Windows os(say C:\).

anjumanu321 01-21-2012 12:20 AM

Quote:

Originally Posted by anjumanu321 (Post 4580415)
And how about if Linux is on a different partition(say G:) on the same hard disk which has Windows os(say C:\).

also what care should I take while doing so.
is it advisable to do such thing?

otoomet 01-21-2012 06:18 AM

Hi,

(warning: I haven't tested the following)

if win C: is a partition, separate of linux, it shouldn't hurt at all. It is a _separate_ partition which linux simply disregards, whatever happening there. You may also format it under linux (look for 'mkntfs'). This gives you a little more security -- as your linux partitions are mounted while running linux, these cannot be easily overwritten (but you can overwrite the windows system instead).

Obviously, everything may go wrong. If you end up reinstalling your win, linux will not boot any more (you have to re-install linux bootloader). The main safety measure -- make a backup (you are doing it anyway, right ;-).



LQ Blogs

Satyaveer Arya 01-21-2012 07:38 AM

Or

there is one another option, if at present your both OSs are on same disk and the bootloader is through Debian then first you can install the windows bootloader by booting your system with Windows CD. Then by pressing R from there you can come in repair mode and then selecting C:\ drive there, type fixmbr and press enter. This will install windows bootloader, then reboot your system. Now you will be able to access only windows and then you can format your C:\ drive and prepare new C:\ with windows OS.
Then you can again install Debian bootloader with the help of Debian DVD or whatever media you have, to access Debian and Windows both.

towheedm 01-21-2012 10:17 AM

Quote:

Originally Posted by anjumanu321 (Post 4580415)
And how about if Linux is on a different partition(say G:) on the same hard disk which has Windows os(say C:\).

If windows is on a different partition on the same drive with Windows, DO NOT format with windows. You WILL lose your Linux partition.

Take it from me.....I did it !!! :mad:

If it's on the same drive as Windows, boot into Debian and format the Windows partition with:
Code:

sudo mkfs.ntfs [options] device [number-of-sectors]
For help:
Code:

sudo mkfs.ntfs --help

repo 01-21-2012 10:30 AM

You can just use gparted in Linux.

Kind regards

anjumanu321 01-21-2012 11:19 AM

ok, I am going to perform the following steps.

1. Boot into debian(this is on another partition, say G drive).
2. Format windows using sudo mkfs.ntfs [options] device [number-of-sectors]
3. Reboot the pc with the XP cd in the cd drive and install the xp in C drive.

Another method to try is:

1. Boot using a system rescue cd
2. Format the windows partition(C drive) using gparted.
3. Reboot the pc with the XP cd in the cd drive and install the xp in C drive.


Will this be ok?

otoomet 01-21-2012 11:30 AM

anjumanu321,

what exactly are we talking about?

* formatting a windows partition (out of several windows partitions)
* re-installing windows (and formatting at least windows system partition)?

towheedm 01-21-2012 11:36 AM

Hold on !!! You are going to re-install XP on the same drive with Debian. Your first post said Debian was on another drive.

Although you will be formatting the Windows partition from Debian using whichever method you choose, when you re-install XP it will overwrite the MBR. This means while your Debian partition will still be intack, you will not have access to it.

It's been a while since I've installed XP, does the installer give you the option to install/not install the Windows bootloader?

If not, have you Debian installation media handy, you will most likely have to re-write the MBR for GRUB.

anjumanu321 01-21-2012 11:37 AM

Quote:

Originally Posted by otoomet (Post 4580755)
anjumanu321,

what exactly are we talking about?

* formatting a windows partition (out of several windows partitions)
* re-installing windows (and formatting at least windows system partition)?

re-installing windows

anjumanu321 01-21-2012 11:41 AM

Quote:

Originally Posted by towheedm (Post 4580760)
Hold on !!! You are going to re-install XP on the same drive with Debian. Your first post said Debian was on another drive.

Although you will be formatting the Windows partition from Debian using whichever method you choose, when you re-install XP it will overwrite the MBR. This means while your Debian partition will still be intack, you will not have access to it.

It's been a while since I've installed XP, does the installer give you the option to install/not install the Windows bootloader?

If not, have you Debian installation media handy, you will most likely have to re-write the MBR for GRUB.

Sorry for the confusion.Both the OS are on the same drive.
No, the installer does not give the option to install/not install the Windows bootloader.

towheedm 01-21-2012 12:26 PM

If you proceed, have your Debian installation media handy, you will need to re-install the GRUB bootloader to the MBR of your HD.

anjumanu321 01-24-2012 09:31 PM

Thanks for all your suggestions.I have successfully reinstalled XP and after a few hiccups got my Debian back :)

To sum up what I have done:

First I reinstalled XP, this made the MBR to be overwritten.Result, I was not able to access my debian partition!
Moreover I did not have my debian installation media to repair the grub.
So I used a rescue cd(Rescatux available at http://www.supergrubdisk.org/) and followed the instructions at http://www.supergrubdisk.org/wiki/SuperGRUB2Disk.

Boot with the cd and select the option 'Super GRUB2 Disk'.This will take you to next page where you have to select 'Detect any GRUB2 installation(even if MBR is overwritten).
This option will search all partitions for grub2 installations (specifically for grub2 core.img files) and create a menu to choose among those that it finds.
Select the debian rescue-mode option.
Enter the root password and just give the commands: grub-install /dev/sda(or whatever your hard disk is) and then update-grub.
Reboot the system.Thats it!!

--
Anji


All times are GMT -5. The time now is 07:31 AM.