Discussion:
fdisk and bootable flag
stupidmail4me
2010-05-11 19:34:28 UTC
Permalink
I have a machine with / on wd0.

I'm creating a RAID 1 setup using softraid on wd1 and wd2.

The instructions are great, except I'm having a problem with fdisk. Using fdisk -iy wd1, it creates one partition, great. But it's bootable, which is causing my machine to hang on boot. Yes, I know you'd usually switch which hard drive to start up in the BIOS, but the BIOS on my machine sucks. Unlike Linux fdisk, there's no a option to toggle the bootable flag.

Anyone know how to edit the default MBR record so fdisk -iy creates one partition with no bootable flag, or how to unset the bootable flag?
Thomas Pfaff
2010-05-11 20:14:26 UTC
Permalink
On Tue, 11 May 2010 12:34:28 -0700 (PDT)
Post by stupidmail4me
Anyone know how to edit the default MBR record so fdisk -iy creates
one partition with no bootable flag, or how to unset the bootable flag?
I think the following should do it:

fdisk: 1> flag <partition> 0

I suppose the man page should mention that this operation can take on
a second operand.
Thomas Pfaff
2010-05-12 13:17:07 UTC
Permalink
On Tue, 11 May 2010 22:14:26 +0200
Post by Thomas Pfaff
On Tue, 11 May 2010 12:34:28 -0700 (PDT)
Post by stupidmail4me
Anyone know how to edit the default MBR record so fdisk -iy creates
one partition with no bootable flag, or how to unset the bootable flag?
fdisk: 1> flag <partition> 0
I suppose the man page should mention that this operation can take on
a second operand.
diff if this should be mentioned. It was in fact mentioned in the man
page but the text was commented out. Not sure why.

Index: fdisk.8
===================================================================
RCS file: /cvs/src/sbin/fdisk/fdisk.8,v
retrieving revision 1.69
diff -u -p -r1.69 fdisk.8
--- fdisk.8 27 Mar 2010 13:56:49 -0000 1.69
+++ fdisk.8 12 May 2010 13:15:04 -0000
@@ -303,14 +303,14 @@ may be appended to indicate bytes, kilob
The special size value
.Sq *
will cause the partition to be sized to use the remainder of the disk.
-.It Cm flag Ar #
+.It Cm flag Ar # Op Ar value
Make the given MBR partition table entry bootable.
Only one entry can be marked bootable.
.\" If you wish to boot from an extended
.\" MBR partition, you will need to mark the MBR partition table entry for the
.\" extended MBR partition as bootable.
-.\" If an optional value is given, the MBR partition is marked with the given
-.\" value, and other MBR partitions are not touched.
+If an optional value is given, the MBR partition is marked with the given
+value, and other MBR partitions are not touched.
.It Cm update
Update the machine MBR bootcode and 0xAA55 signature in the memory copy
of the currently selected boot block.
Jason McIntyre
2010-05-20 13:30:16 UTC
Permalink
Post by Thomas Pfaff
On Tue, 11 May 2010 22:14:26 +0200
Post by Thomas Pfaff
On Tue, 11 May 2010 12:34:28 -0700 (PDT)
Post by stupidmail4me
Anyone know how to edit the default MBR record so fdisk -iy creates
one partition with no bootable flag, or how to unset the bootable flag?
fdisk: 1> flag <partition> 0
I suppose the man page should mention that this operation can take on
a second operand.
diff if this should be mentioned. It was in fact mentioned in the man
page but the text was commented out. Not sure why.
Index: fdisk.8
===================================================================
RCS file: /cvs/src/sbin/fdisk/fdisk.8,v
retrieving revision 1.69
diff -u -p -r1.69 fdisk.8
--- fdisk.8 27 Mar 2010 13:56:49 -0000 1.69
+++ fdisk.8 12 May 2010 13:15:04 -0000
@@ -303,14 +303,14 @@ may be appended to indicate bytes, kilob
The special size value
.Sq *
will cause the partition to be sized to use the remainder of the disk.
-.It Cm flag Ar #
+.It Cm flag Ar # Op Ar value
Make the given MBR partition table entry bootable.
Only one entry can be marked bootable.
.\" If you wish to boot from an extended
.\" MBR partition, you will need to mark the MBR partition table entry for the
.\" extended MBR partition as bootable.
-.\" If an optional value is given, the MBR partition is marked with the given
-.\" value, and other MBR partitions are not touched.
+If an optional value is given, the MBR partition is marked with the given
+value, and other MBR partitions are not touched.
.It Cm update
Update the machine MBR bootcode and 0xAA55 signature in the memory copy
of the currently selected boot block.
a slightly different version of this diff now committed.
jmc

Joachim Schipper
2010-05-11 20:12:44 UTC
Permalink
Post by stupidmail4me
I have a machine with / on wd0.
I'm creating a RAID 1 setup using softraid on wd1 and wd2.
The instructions are great, except I'm having a problem with fdisk. Using fdisk -iy wd1, it creates one partition, great. But it's bootable, which is causing my machine to hang on boot. Yes, I know you'd usually switch which hard drive to start up in the BIOS, but the BIOS on my machine sucks. Unlike Linux fdisk, there's no a option to toggle the bootable flag.
Anyone know how to edit the default MBR record so fdisk -iy creates one partition with no bootable flag, or how to unset the bootable flag?
Can't you flag some other, empty, partition as bootable? ("flag 3")

Joachim
--
TFMotD: strxfrm (3) - transform a string under locale
Continue reading on narkive:
Loading...