LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-30-2004, 09:49 PM   #1
HadroLepton
LQ Newbie
 
Registered: Mar 2004
Location: germany
Posts: 15

Rep: Reputation: 0
mkdosfs generates invalid boot sector


(i'm n00b in linux, but not in computing in general)

using fedora core 1

SHORT VERSION:

i format a fat32 partition using mkdosfs. the partition is about 8 GB
mkdosfs -v -F 32 /dev/hda1

ranish partman (dos partition tool) will tell me that the boot sector of the partition is invalid.

is this a bug in mkdosfs or do i need to do something else to get a valid boot sector?


LONG VERSION:

summary of what i am trying to do
i want to be able to create a bootable (nt) fat32 partition from linux. the partition should be the first primary partition and is about 8 GB in size.

here is a step by step explanation of what i am doing
1. use fdisk to create the partition and set the type to fat32 (lba).
2. use mkdosfs to format the partition to fat32.
3. use ms-sys to make the boot sector bootable. (search for ms-sys in google, sorry forum wont let me post url)
4. unzip win2k to partition
this partition will not boot.

here is the mkdosfs command line i used
mkdosfs -v /dev/hda1
mkdosfs -v -F 32 /dev/hda1
with or without -F 32 the result is the same. contrary to the note in the manpage mkdosfs seems to know that it should use fat32.

and in contrast another attempt to achieve the same goal
1. use fdisk to create the partition and set the type to fat32 (lba).
2. boot to dos. format the partition using ranish partman (dos partition manager tool) (search for ranish in google)
3. back to linux. use ms-sys to make bootable
4. unzip win2k to partition
this partition will boot

it seems like mkdosfs is generating invalid boot sectors. ranish partman is reporting that the partition formatted by mkdosfs is having an invalid boot sector. it won't boot. yet files are written and read from the partition without problems.

did i miss something? help please

Last edited by HadroLepton; 03-31-2004 at 03:14 AM.
 
Old 03-31-2004, 01:40 AM   #2
iluvatar
Member
 
Registered: Jul 2003
Location: netherlands
Distribution: debian
Posts: 403

Rep: Reputation: 30
do you want a dual boot between linux/win2k? if so, just let windows installation create the partition and install on it. windows will screw up your mbr (won't let you boot anything else than windows) but with a linux rescue cd / floppy you can re-install the boot loader and configure that to boot either windows or linux

greetz,
-= iluvatar =-
 
Old 03-31-2004, 03:04 AM   #3
HadroLepton
LQ Newbie
 
Registered: Mar 2004
Location: germany
Posts: 15

Original Poster
Rep: Reputation: 0
thanks for your suggestion but that is not what i'm looking for. setting up a dual boot is no problem for me. i am quite familiar with the intricacies of the master boot record, the boot sector and boot managers.

my long term goal is to be able to create a linux boot cd with which i can save/restore windows (using zip rather than partition image tools). to do so i will have to be able to create a partition from scratch and make it bootable.

the theorie is like this:
install windows, setup settings.
boot to linux and zip the whole thing, save the zip.
*time passes by...*
windows gets screwed up (however severe, up to losing entire partition)
boot to linux, recreate the partition, unzip windows. make the partition bootable.

as i wrote above i have done this successfully almost entirely under linux. the only thing i haven't got right is the formatting using mkdosfs. as said it creates a file system which is working correct. i can copy files to the partition and read them. but the boot sector is invalid and thus i cannot boot from the partition.
 
Old 03-31-2004, 03:17 AM   #4
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
I've had a look at this ms-sys program, this is whats on their project page:
Quote:
5. Known problems
-----------------

There have been reports about unbootable FAT32 partitions created with
"mformat -F c:". One workaround is to use gnu parted to create the
partition instead. Since version 1.1.3 ms-sys has the switch -p which
is supposed to fix this problem. The problem has also been reported on
partitions formatted with mkdosfs and mkfs.vfat.
see if it helps
 
Old 03-31-2004, 03:26 AM   #5
iluvatar
Member
 
Registered: Jul 2003
Location: netherlands
Distribution: debian
Posts: 403

Rep: Reputation: 30
if you install windows (and let windows do the partition / format) and after that you copy the whole partition (with 'dd if=/dev/hda1 of=/<my file>' command), it should copy the boot sector too. but a note on windows 2000: it will store some pc specific info wich can't just be copied to other pc's. you first have to 'prepare' windows for this. this can be done (it is used with a M$ RIS "Remote Installation Server"). read this M$ howto it can be helpfull...

greetz,
-= iluvatar =-
 
Old 03-31-2004, 12:36 PM   #6
HadroLepton
LQ Newbie
 
Registered: Mar 2004
Location: germany
Posts: 15

Original Poster
Rep: Reputation: 0
w00t that worked!!

the mkfs from parted is producing valid boot sectors

will try the -p switch later on an invalid boot sector to see if ms-sys can fix it

thanks Demonbane
 
Old 10-28-2010, 12:26 PM   #7
zhaopei
LQ Newbie
 
Registered: May 2010
Posts: 2

Rep: Reputation: 0
hi, i am heading for the same goal as you, and have got the same problem, and googled this thread. It has been 6 years.... However, this post still helped me, thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MBR & boot invalid sector... emamarro Linux - Newbie 4 01-11-2005 01:18 PM
Boot Sector phoenix7 Linux - General 1 11-25-2004 10:22 AM
Boot Sector on dual boot PC. Remove Mandrake and replace with FreeBSD Phin666 *BSD 1 10-30-2004 05:02 PM
mrtg cfgmaker generates invalid file sealnose Linux - Networking 0 05-01-2004 04:47 PM
No boot sector found, error at boot areeves88 Linux - General 3 01-18-2003 08:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration