LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Formatting and MBR Q's (https://www.linuxquestions.org/questions/linux-newbie-8/formatting-and-mbr-qs-222114/)

digitallinux 08-25-2004 03:43 AM

Formatting and MBR Q's
 
I want to reformat my Linux drive so that I can use it for a Windows drive. But I cant see it in Win XP so how can I reformat it?

Also if I do will the Master Boot Record reset to normal instead of using LiLo?

Thoreau 08-25-2004 03:48 AM

/sbin/lilo -u in linux

or

make dos/win floppy. boot to it. type fdisk /mbr.

reboot.

I was contemplating not telling you btw. That's just wrong on alot of levels. But I'll get over it.

digitallinux 08-25-2004 04:04 AM

wrong? as in getting rid of Linux?

I just need the extra drive to save my current drive before it dies.

would it work if i used a XP boot cd? and can I plz have more info on the boot disk/cd plz

myriad-zero 08-25-2004 05:33 AM

To change a Linux partition to Windows ...

Use 'fdisk' to edit the partition table of your disk. Change the partition type of the victim partition from Linux (83) to Windows FAT32 (b). Reboot the computer and boot into Windows. Now the new drive will be listed in Windows. Format it and continue.

digitallinux 08-25-2004 12:48 PM

Quote:

Originally posted by myriad-zero
Use 'fdisk' to edit the partition table of your disk.
I get the use fdisk and the rest of it, but do you mean delete the current partion then re create it as Fat32? and will fdisk see it?

How do I get to fdisk on winxp machine? i know how to on other (95 etc) but not sure on an XP machine.

Thanx for the help! it is grately appreciated.

myriad-zero 08-26-2004 01:07 AM

You should use 'fdisk' under Linux. Use the command 't' to change the type. You need not delete and recreate the partition. You can change the type of a partition without deleting it.

HTH.

Electro 08-26-2004 01:51 AM

In Windows XP and as admin, right click in the my computer and then select manage. You can then delete, create, and format partiitons. Though formatting FAT32 in Windows XP has limits with capacity. You will have to use Knoppix or use your Linux install CD to manually format the partition as FAT32 if it is larger than 32 GB. Windows 95 and Windows 98 does not have this problem.

The MBR does not change when you use linux fdisk. You have to manually fix it. If you have two hard drives, you can use dd to copy the MBR from the Windows drive to the Linux drive. To do this type "dd if=/dev/hda of=/dev/hdb bs=512 count=1" as su or root. The MS fdisk does not have an option to select a drive to fix the MBR, so you may run into a problem if you have an MBR virus. Be very careful with if and of when using dd. The /dev/hda and /dev/hdb are examples. Also dd will not fix the problem if you have an MBR virus on the Windows drive, so be careful.

You could just use CD-R to backup your documents, graphics, sound, and videos. Mandrake 10 comes with K3B to make writing to CD-R discs easier in Linux.

digitallinux 08-26-2004 05:20 AM

So as root in Linux type fdisk
Then change partition type to fat32 - problem is that its 200Gb so what could I do? but if I go into winodws would I be able to see it? If so I could then format it to NTFS which is what I need it in anyways.

Im still not clear on how to get the MBR back to normal without LiLo. What command would I need to execute in Linux.

JZL240I-U 08-26-2004 08:07 AM

There should be a rescue-console or some such in WinXP when you start it from CD. Use the command line there to start the Win-program "fixmbr", that's all...

dsegel 08-26-2004 09:11 AM

You have to fix the MBR from the Windows side; you can remove lilo in linux, but you can't put a Windows bootloader back into the MBR without booting into Windows somehow (e.g. the Windows install CD in Rescue Mode, or a DOS boot floppy.)

The DOS command is 'fdisk /mbr' the Windows install disk rescue-mode command is 'fixmbr'.

Don't worry about the partitions under linux; once you've booted into Windows you can use the native Disk Manager to delete the existing partitions and create a new one using NTFS (this is what right-clicking on My Computer and selecting Manage will get you to - go to the 'Disk Management' section.)

Electro 08-26-2004 02:19 PM

I do not want to yell but I guess I have to.

PLEASE READ MY POST AGAIN. THERE ARE INSTRUCTIONS HOW TO COPY THE MBR FROM YOUR WINDOWS DRIVE TO YOUR BACKUP DRIVE.

You do not have to use NTFS if your Windows XP drive is NTFS. You can use FAT32. Changing the type of partition will not work if the that partition is not the whole hard drive. Mandrake makes three partitions automatically not one or two.

If you do not have Norton Ghost, you can use System Rescue CD.

I'm getting tired of people ignoring my posts.

:mad: :mad: :mad: :mad: :mad: :mad: :mad: :mad: :mad: :mad:

digitallinux 08-27-2004 04:27 AM

Quote:

Originally posted by Electro
I do not want to yell but I guess I have to.

PLEASE READ MY POST AGAIN. THERE ARE INSTRUCTIONS HOW TO COPY THE MBR FROM YOUR WINDOWS DRIVE TO YOUR BACKUP DRIVE.

You do not have to use NTFS if your Windows XP drive is NTFS. You can use FAT32. Changing the type of partition will not work if the that partition is not the whole hard drive. Mandrake makes three partitions automatically not one or two.

If you do not have Norton Ghost, you can use System Rescue CD.

I'm getting tired of people ignoring my posts.

:mad: :mad: :mad: :mad: :mad: :mad: :mad: :mad: :mad: :mad:

plz calm down! im trying to get this exactly right rather than just rushing ahead and doing it then fucking it up and having no system left.

So by typing "dd if=/dev/hda of=/dev/hdb bs=512 count=1" at console while root it should copy the MBR so therefore the next time I boot I will not see the LiLo boot screen? it should in theory boot into Windows XP fine?

Also I didnt realise that windows could actually see the dirves.

Be patient becuase I really find this hard and I dont want to make mistakes.

Electro 08-27-2004 02:42 PM

Doing "dd if=/dev/hda of=/dev/hdb bs=512 count=1" will work. Though you have to plug in your windows drive for if and your Linux drive for of.

What the above does. It takes file or device /dev/hda and does a raw copy of the first 512 bytes and places it on /dev/hdb. The option count in dd only does one 512 byte of raw data. The MBR is located at the first 512 bytes. You can do search on the internet. Every site will tell the same command.

If you really want real world evidence, I did the same and it worked. Though I kinda did a stupid thing before I did dd by designated a drive letter for my second drive. Windows got screwed up. Just let Windows automatically set the drive letter or set the drive as master on the primary IDE channel. The easiest is just move the Linux drive to the master on the primary IDE channel after you done copying.

I suggest using System Rescue CD to clone your Windows drive to your second drive. You can use Norton Ghost if you have it.

Every expert makes a boot floppy just in case something bad happens, so I suggest making one in Windows.

dsegel 08-27-2004 02:50 PM

That command will copy the MBR from your primary master drive (probably C: in Windows) to your primary slave drive. If your system is booting from the primary master then it won't have any effect on what happens.

If you want to fix the MBR on your primary master you need to boot from the Windows install disk and run the fixmbr command.

Electro 08-27-2004 06:21 PM

dsegel, did you read my post or you just skimmed it because I did say moving the linux drive (primary slave) to the primary master after copying. Though some motherboard manufactures add a few features to the BIOS, so you can boot to other hard drives instead of the first hard drive that is seen. In my BIOS I can select a few hard drives like HD0, HD1, HD2, etc to boot from.

Using fixmbr may not fix the linux drive, so that is why I suggest using dd before killing the Linux partitons. Also using fixmbr can screw up the hard drive if there is a MBR virus. Using fixmbr or fdiks /mbr should not taken lightly.

If you really want to get the copy done with out messing around with MBR and partitioning, you can use Knoppix and go into run level 3. Next type "dd if=/dev/hda of=/dev/hdb bs=512 conv=sync". That command then do a byte to byte copy of the whole entire Windows drive to the other other drive. It will do everything for you like the filesystem, partition table, and MBR, but it will not check for badblocks if it is on the Linux drive.


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