It's possible to write boot sector inside logical partition?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read this

It's possible to write boot sector inside logical partition?

Postby RonC on Mon May 14, 2012 8:59 pm

I installed LinuxMint Lisa (32-bit) to a logical partition inside an extended partition. I directed the installation to install the boot sector on the boot partition. But, I suspect it failed. Is this to be expected and if yes, is there a way of recovering?

I was following instructions for a triple-boot that advises placing the boot loader directly on the partition, instead of allowing it to overwrite the disk's boot sector. The idea was to preserve the Windows boot, and then be able to select the operating system that loads from Windows' boot menu.

The directions said to copy the sector's boot information to a file (using the command line) and then copy that to the Windows boot partition, where it would link into the Windows BCD's menu.

I successfully completed the copy operation from the Mint boot sector, but then became suspicious when the resulting file had a size of zero bytes. I got it to appear in the Windows boot menu, but attempts to select it required a hard system reset, to recover.

I began to suspect that /boot, in fact, has no boot data, in spite of what I specified during the Mint installation. When I set the /boot sector to 'Active' and then rebooted, I didn't get the Mint Desktop, but instead a black screen. Am I correct in suspecting that something failed, during the Mint installation?

What can I do? I think the LM installation silently skipped installing the boot sector. Note the first paragraph, as to the type of partition was set-up as /boot. Did I try to do the impossible?

I would like to recover from this. I want to have an active Linux Mint selection in the Windows 7 multi-OS boot menu. Any ideas??

P.S.: Then I tried EasyBCD, and that produced the Windows Boot Menu with a non-responsive Mint menu selection. I wonder, does the boot sector have to be in some special place, before this utility and find it?

RESULTS.TXT from BootInfo script:
Code: Select all
                  Boot Info Script 0.61      [1 April 2012]


============================= Boot Info Summary: ===============================

 => Windows is installed in the MBR of /dev/sda.
 => Windows is installed in the MBR of /dev/sdb.
 => No known boot loader is installed in the MBR of /dev/sdc.

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System: 
    Boot files:        /boot.ini /bootmgr /Boot/BCD /ntldr /NTDETECT.COM

sda2: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  Windows 7
    Boot files:        /boot.ini /bootmgr /Boot/BCD
                       /Windows/System32/winload.exe /ntldr /NTDETECT.COM

sda3: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  Unknown
    Boot sector info:

sda5: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP: NTFS
    Boot sector info:  According to the info in the boot sector, sda5 starts
                       at sector 63.
    Operating System: 
    Boot files:       

sda6: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7: NTFS
    Boot sector info:  According to the info in the boot sector, sda6 has
                       25902032 sectors, but according to the info from
                       fdisk, it has 25912781 sectors.
    Operating System: 
    Boot files:       

sda7: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System: 
    Boot files:       

sda8: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System: 
    Boot files:       

sda9: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  Grub2 (v1.99)
    Boot sector info:  Grub2 (v1.99) is installed in the boot sector of sda9
                       and looks at sector 237443574 of the same hard drive
                       for core.img. core.img is at this location and looks
                       for (,msdos9)/grub on this drive.
    Operating System: 
    Boot files:        /grub/grub.cfg /grub/core.img /boot/grub/core.img

sda10: _________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:
    Operating System:  Linux Mint 12 Lisa
    Boot files:        /etc/fstab

sda11: _________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info:

sda12: _________________________________________________________________________

    File system:       ext3
    Boot sector type:  -
    Boot sector info:
    Operating System: 
    Boot files:       

sdb1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  Unknown
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System: 
    Boot files:       

sdc1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System: 
    Boot files:       

sdc2: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info:

sdc5: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP: NTFS
    Boot sector info:  According to the info in the boot sector, sdc5 starts
                       at sector 32. But according to the info from fdisk,
                       sdc5 starts at sector 587200544.
    Operating System: 
    Boot files:        /boot.ini /ntldr /NTDETECT.COM

sdc6: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP: NTFS
    Boot sector info:  According to the info in the boot sector, sdc6 starts
                       at sector 32. But according to the info from fdisk,
                       sdc6 starts at sector 602560544.
    Operating System: 
    Boot files:       

sdc7: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP: NTFS
    Boot sector info:  According to the info in the boot sector, sdc7 starts
                       at sector 32. But according to the info from fdisk,
                       sdc7 starts at sector 603994144.
    Operating System: 
    Boot files:       

sdc8: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP: NTFS
    Boot sector info:  According to the info in the boot sector, sdc8 starts
                       at sector 32. But according to the info from fdisk,
                       sdc8 starts at sector 605427744.
    Operating System: 
    Boot files:       

sdc9: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP: NTFS
    Boot sector info:  According to the info in the boot sector, sdc9 starts
                       at sector 32. But according to the info from fdisk,
                       sdc9 starts at sector 615284768.
    Operating System: 
    Boot files:       

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders, total 390721968 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1                  63    14,779,799    14,779,737   7 NTFS / exFAT / HPFS
/dev/sda2    *     14,779,800    76,212,359    61,432,560   7 NTFS / exFAT / HPFS
/dev/sda3          76,212,483   344,562,119   268,349,637   f W95 Extended (LBA)
/dev/sda5          76,212,485   102,848,129    26,635,645   7 NTFS / exFAT / HPFS
/dev/sda6         102,848,193   128,760,974    25,912,782   7 NTFS / exFAT / HPFS
/dev/sda7         128,761,038   145,581,029    16,819,992   7 NTFS / exFAT / HPFS
/dev/sda8         145,581,093   237,328,244    91,747,152   7 NTFS / exFAT / HPFS
/dev/sda9         237,328,308   237,585,284       256,977  83 Linux
/dev/sda10        237,585,348   278,551,034    40,965,687  83 Linux
/dev/sda11        278,551,098   286,744,184     8,193,087  82 Linux swap / Solaris
/dev/sda12        286,744,248   344,562,119    57,817,872  83 Linux


Drive: sdb _____________________________________________________________________

Disk /dev/sdb: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders, total 160836480 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdb1    *             63   160,826,714   160,826,652   b W95 FAT32


Drive: sdc _____________________________________________________________________

Disk /dev/sdc: 320.1 GB, 320072933376 bytes
64 heads, 32 sectors/track, 305245 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdc1    *             32   587,200,511   587,200,480   7 NTFS / exFAT / HPFS
/dev/sdc2         587,200,512   625,141,759    37,941,248   f W95 Extended (LBA)
/dev/sdc5         587,200,544   602,560,511    15,359,968   7 NTFS / exFAT / HPFS
/dev/sdc6         602,560,544   603,994,111     1,433,568   7 NTFS / exFAT / HPFS
/dev/sdc7         603,994,144   605,427,711     1,433,568   7 NTFS / exFAT / HPFS
/dev/sdc8         605,427,744   615,284,735     9,856,992   7 NTFS / exFAT / HPFS
/dev/sdc9         615,284,768   625,141,759     9,856,992   7 NTFS / exFAT / HPFS


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/loop0                                              squashfs   
/dev/sda1        9FBC4CE0B0A0F34A                       ntfs       Win2000
/dev/sda10       ae9fff32-b38b-4ef3-a333-2a791b17436d   ext4       root
/dev/sda11       3b85bd62-3609-4516-aa2c-ea1aee25e105   swap       swap
/dev/sda12       8bca33bc-9c2f-4417-8e18-bdc8cdde8906   ext3       home
/dev/sda2        3491141700F8E204                       ntfs       Win7
/dev/sda5        5600E40E00E3F343                       ntfs       Programs
/dev/sda6        11DDE1BC79CE6DA3                       ntfs       Win7_Programs
/dev/sda7        812D5F6DBBF24667                       ntfs       Data
/dev/sda8        219506FD4CD6CA8F                       ntfs       Misc
/dev/sda9        c03ae258-b481-4af0-a4e2-2dbce435ec1a   ext4       boot
/dev/sdb1        1EE6-3B2E                              vfat       FMT_14NOV03
/dev/sdc1        01CB03E5E3BB2D00                       ntfs       FMT_04JUN10
/dev/sdc5        01CB4E985D1A95D0                       ntfs       W2k-Image
/dev/sdc6        E551CF99C5AC9156                       ntfs       CD Public
/dev/sdc7        F7BB1F5E7B5D80B5                       ntfs       CD Private
/dev/sdc8        4B640294C93D64F9                       ntfs       DVD Public
/dev/sdc9        01CB70844F8325A0                       ntfs       DVD Private

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/loop0       /rofs                    squashfs   (ro,noatime)
/dev/sdb1        /media/FMT_14NOV03       vfat       (rw,nosuid,nodev,uid=999,gid=999,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks)
/dev/sdc1        /media/FMT_04JUN10       fuseblk    (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sdc5        /media/W2k-Image         fuseblk    (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sdc6        /media/CD Public         fuseblk    (rw,nosuid,nodev,allow_other,blksize=1024,default_permissions)
/dev/sdc7        /media/CD Private        fuseblk    (rw,nosuid,nodev,allow_other,blksize=1024,default_permissions)
/dev/sdc8        /media/DVD Public        fuseblk    (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sdc9        /media/DVD Private       fuseblk    (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sr0         /cdrom                   iso9660    (ro,noatime)
/dev/sr1         /media/DVD-RAM_UDF2.01   udf        (ro,nosuid,nodev,uid=999,gid=999,iocharset=utf8,umask=0077,uhelper=udisks)


================================ sda1/boot.ini: ================================

--------------------------------------------------------------------------------
[boot loader]
timeout=25
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Professional" /fastdetect
--------------------------------------------------------------------------------

================================ sda2/boot.ini: ================================

--------------------------------------------------------------------------------
[boot loader]
timeout=25
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Professional" /fastdetect
--------------------------------------------------------------------------------

============================= sda9/grub/grub.cfg: ==============================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos10)'
search --no-floppy --fs-uuid --set=root ae9fff32-b38b-4ef3-a333-2a791b17436d
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root='(hd0,msdos9)'
  search --no-floppy --fs-uuid --set=root c03ae258-b481-4af0-a4e2-2dbce435ec1a
  set locale_dir=($root)/grub/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 0,0,0; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/06_mint_theme ###
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
### END /etc/grub.d/06_mint_theme ###

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Linux Mint 12 32-bit, 3.0.0-12-generic (/dev/sda9)' --class linuxmint --class gnu-linux --class gnu --class os {
   recordfail
   set gfxpayload=$linux_gfx_mode
   insmod gzio
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos9)'
   search --no-floppy --fs-uuid --set=root c03ae258-b481-4af0-a4e2-2dbce435ec1a
   linux   /vmlinuz-3.0.0-12-generic root=UUID=ae9fff32-b38b-4ef3-a333-2a791b17436d ro   quiet splash vt.handoff=7
   initrd   /initrd.img-3.0.0-12-generic
}
menuentry 'Linux Mint 12 32-bit, 3.0.0-12-generic (/dev/sda9) -- recovery mode' --class linuxmint --class gnu-linux --class gnu --class os {
   recordfail
   insmod gzio
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos9)'
   search --no-floppy --fs-uuid --set=root c03ae258-b481-4af0-a4e2-2dbce435ec1a
   echo   'Loading Linux 3.0.0-12-generic ...'
   linux   /vmlinuz-3.0.0-12-generic root=UUID=ae9fff32-b38b-4ef3-a333-2a791b17436d ro recovery nomodeset
   echo   'Loading initial ramdisk ...'
   initrd   /initrd.img-3.0.0-12-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos9)'
   search --no-floppy --fs-uuid --set=root c03ae258-b481-4af0-a4e2-2dbce435ec1a
   linux16   /memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos9)'
   search --no-floppy --fs-uuid --set=root c03ae258-b481-4af0-a4e2-2dbce435ec1a
   linux16   /memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
   insmod part_msdos
   insmod ntfs
   set root='(hd0,msdos1)'
   search --no-floppy --fs-uuid --set=root 9FBC4CE0B0A0F34A
   chainloader +1
}
menuentry "Windows 7 (loader) (on /dev/sda2)" --class windows --class os {
   insmod part_msdos
   insmod ntfs
   set root='(hd0,msdos2)'
   search --no-floppy --fs-uuid --set=root 3491141700F8E204
   chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------

=================== sda9: Location of files loaded by Grub: ====================

           GiB - GB             File                                 Fragment(s)

 113.180194855 = 121.526308864  boot/grub/core.img                             1
 113.221942902 = 121.571135488  grub/core.img                                  1
 113.180145264 = 121.526255616  grub/grub.cfg                                  1
 113.251913071 = 121.603315712  initrd.img-3.0.0-12-generic                    3
 113.205319405 = 121.553286144  vmlinuz-3.0.0-12-generic                       1

=============================== sda10/etc/fstab: ===============================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda10 during installation
UUID=ae9fff32-b38b-4ef3-a333-2a791b17436d /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda9 during installation
UUID=c03ae258-b481-4af0-a4e2-2dbce435ec1a /boot           ext4    defaults        0       2
# /home was on /dev/sda12 during installation
UUID=8bca33bc-9c2f-4417-8e18-bdc8cdde8906 /home           ext3    defaults        0       2
# swap was on /dev/sda11 during installation
UUID=3b85bd62-3609-4516-aa2c-ea1aee25e105 none            swap    sw              0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
/dev/scd1       /media/floppy1  auto    rw,user,noauto,exec,utf8 0       0
--------------------------------------------------------------------------------

================================ sdc5/boot.ini: ================================

--------------------------------------------------------------------------------
[boot loader]
timeout=25
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Professional" /fastdetect
--------------------------------------------------------------------------------

======================== Unknown MBRs/Boot Sectors/etc: ========================

Unknown MBR on /dev/sdc

00000000  90 e9 7d 01 fa 33 c0 8e  d0 8e c0 8e d8 bc 00 7c  |..}..3.........||
00000010  8b f4 fb bf 00 06 b9 00  01 f3 a5 bb 20 06 ff e3  |............ ...|
00000020  90 90 be 7d 07 81 3c aa  55 75 11 e8 58 00 73 0c  |...}..<.Uu..X.s.|
00000030  e8 65 00 72 07 e8 b1 00  72 3b eb 2c be 7d 07 c7  |.e.r....r;.,.}..|
00000040  04 00 00 ba 80 00 be be  07 b9 04 00 f6 04 80 75  |...............u|
00000050  07 83 c6 10 e2 f6 eb 1d  8a 74 01 8b 4c 02 bb 00  |.........t..L...|
00000060  7c b8 01 02 cd 13 72 0d  81 3e fe 7d 55 aa 75 05  ||.....r..>.}U.u.|
00000070  ea 00 7c 00 00 be 6a 07  ac 0a c0 74 fe bb 07 00  |..|...j....t....|
00000080  b4 0e cd 10 eb f2 bb 00  7e c6 07 13 c6 47 01 00  |........~....G..|
00000090  b2 80 b8 00 e0 cd 13 c3  bf 00 7e ba f0 01 b3 a0  |..........~.....|
000000a0  e8 84 00 72 0c b1 01 e8  48 00 72 05 e8 19 00 73  |...r....H.r....s|
000000b0  16 f6 c3 10 75 05 80 cb  10 eb e5 81 fa 70 01 74  |....u........p.t|
000000c0  05 ba 70 01 eb d8 f9 c3  81 bd fe 01 55 aa 75 17  |..p.........U.u.|
000000d0  8b 75 02 81 fe be 01 77  0e 03 f7 81 3c aa 55 75  |.u.....w....<.Uu|
000000e0  06 f6 44 02 01 75 01 f9  c3 bf 00 7c b1 0a e8 01  |..D..u.....|....|
000000f0  00 c3 52 57 83 c2 02 b0  01 ee 42 8a c1 ee 42 32  |..RW......B...B2|
00000100  c0 ee 42 ee 42 8a c3 ee  42 b0 20 ee e8 33 00 ec  |..B.B...B. ..3..|
00000110  24 fd 3c 58 75 0d 83 ea  07 b9 00 01 fa f3 6d fb  |$.<Xu.........m.|
00000120  f8 eb 01 f9 5f 5a c3 52  83 c2 07 ec a8 80 75 0f  |...._Z.R......u.|
00000130  4a 8a c3 ee 42 ec 24 d0  3c 50 75 03 f8 eb 01 f9  |J...B.$.<Pu.....|
00000140  5a c3 51 8b 0e 6c 04 83  c1 12 81 c2 ff 01 ec 8a  |Z.Q..l..........|
00000150  e0 80 e4 d8 80 fc 58 74  06 3b 0e 6c 04 75 ef 81  |......Xt.;.l.u..|
00000160  ea ff 01 b9 00 20 e2 fe  59 c3 0d 0a 45 72 72 6f  |..... ..Y...Erro|
00000170  72 20 4c 6f 61 64 69 6e  67 20 4f 53 00 aa 55 00  |r Loading OS..U.|
00000180  00 e9 80 fe 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000190  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001b0  00 00 00 00 00 00 00 00  e2 8a 0a 17 00 00 80 01  |................|
000001c0  01 00 07 3f e0 ff 20 00  00 00 e0 f7 ff 22 00 00  |...?.. ......"..|
000001d0  c1 ff 0f 3f e0 ff 00 f8  ff 22 00 f0 42 02 00 00  |...?....."..B...|
000001e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200

Unknown BootLoader on sda3

00000000  0c 2d 00 00 00 00 07 00  78 00 64 00 00 00 00 00  |.-......x.d.....|
00000010  42 09 00 00 00 00 05 00  80 0f 2c 72 f0 c6 c8 01  |B.........,r....|
00000020  00 5a 90 82 82 cd c8 01  d8 9e 26 86 25 89 cc 01  |.Z........&.%...|
00000030  76 c7 c7 a7 ed 22 cd 01  00 00 00 00 00 00 00 00  |v...."..........|
00000040  00 00 00 00 00 00 00 00  20 00 00 10 00 00 00 00  |........ .......|
00000050  11 01 55 00 53 00 20 00  54 00 72 00 69 00 70 00  |..U.S. .T.r.i.p.|
00000060  20 00 53 00 65 00 70 00  74 00 20 00 32 00 30 00  | .S.e.p.t. .2.0.|
00000070  30 00 38 00 00 00 00 00  0c 2d 00 00 00 00 07 00  |0.8......-......|
00000080  68 00 52 00 00 00 00 00  42 09 00 00 00 00 05 00  |h.R.....B.......|
00000090  80 0f 2c 72 f0 c6 c8 01  00 5a 90 82 82 cd c8 01  |..,r.....Z......|
000000a0  d8 9e 26 86 25 89 cc 01  76 c7 c7 a7 ed 22 cd 01  |..&.%...v...."..|
000000b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000c0  20 00 00 10 00 00 00 00  08 02 55 00 53 00 54 00  | .........U.S.T.|
000000d0  52 00 49 00 50 00 7e 00  31 00 00 00 00 00 00 00  |R.I.P.~.1.......|
000000e0  00 00 00 00 00 00 00 00  10 00 00 00 02 00 00 00  |................|
000000f0  68 00 52 00 00 00 00 00  42 09 00 00 00 00 05 00  |h.R.....B.......|
00000100  da 71 2e 72 f0 c6 c8 01  3a 2d 05 83 82 cd c8 01  |.q.r....:-......|
00000110  08 7c d1 13 4d 88 c9 01  88 0f 6e 03 62 4f cb 01  |.|..M.....n.bO..|
00000120  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000130  00 00 00 10 00 00 00 00  08 02 55 00 53 00 54 00  |..........U.S.T.|
00000140  52 00 49 00 50 00 7e 00  31 00 00 00 00 00 00 00  |R.I.P.~.1.......|
00000150  00 00 00 00 00 00 00 00  10 00 00 00 02 00 00 00  |................|
00000160  20 00 53 00 65 00 70 00  74 00 20 00 32 00 30 00  | .S.e.p.t. .2.0.|
00000170  30 00 38 00 00 00 00 00  0c 2d 00 00 00 00 07 00  |0.8......-......|
00000180  68 00 52 00 00 00 00 00  42 09 00 00 00 00 05 00  |h.R.....B.......|
00000190  da 71 2e 72 f0 c6 c8 01  3a 2d 05 83 82 cd c8 01  |.q.r....:-......|
000001a0  08 7c d1 13 4d 88 c9 01  88 0f 6e 03 62 4f cb 01  |.|..M.....n.bO..|
000001b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 01  |................|
000001c0  ff ff 07 fe ff ff 02 00  00 00 7d 6d 96 01 00 fe  |..........}m....|
000001d0  ff ff 05 fe ff ff 7f 6d  96 01 0d 66 8b 01 00 00  |.......m...f....|
000001e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200

Unknown BootLoader on sdb1

00000000  eb 5a 90 2b 34 22 29 22  49 48 43 00 02 10 26 00  |.Z.+4")"IHC...&.|
00000010  02 00 00 00 00 f8 00 00  3f 00 ff 00 3f 00 00 00  |........?...?...|
00000020  1c 05 96 09 87 32 01 00  00 00 00 00 6a 22 00 00  |.....2......j"..|
00000030  01 00 06 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  80 00 29 2e 3b e6 1e 46  4d 54 5f 31 34 4e 4f 56  |..).;..FMT_14NOV|
00000050  30 33 46 41 54 33 32 20  20 20 f1 7d fa 33 c9 8e  |03FAT32   .}.3..|
00000060  d1 bc f8 7b 8e c1 bd 78  00 c5 76 00 1e 56 16 55  |...{...x..v..V.U|
00000070  bf 22 05 89 7e 00 89 4e  02 b1 0b fc f3 a4 8e d9  |."..~..N........|
00000080  bd 00 7c c6 45 fe 0f 8b  46 18 88 45 f9 fb 38 66  |..|.E...F..E..8f|
00000090  40 7c 04 cd 13 72 4e bf  02 00 83 7e 16 00 75 71  |@|...rN....~..uq|
000000a0  66 83 7e 24 00 74 6a 8b  46 1c 8b 56 1e b9 03 00  |f.~$.tj.F..V....|
000000b0  49 40 75 01 42 bb 00 7e  e8 90 00 73 2a b0 f8 4f  |I@u.B..~...s*..O|
000000c0  74 21 8b 46 32 33 d2 b9  03 00 3b c8 77 43 8b 76  |t!.F23....;.wC.v|
000000d0  0e 3b ce 73 3c 2b f1 3b  c6 77 36 03 46 1c 13 56  |.;.s<+.;.w6.F..V|
000000e0  1e eb cd 73 2c eb 49 66  81 be 00 02 52 52 61 41  |...s,.If....RRaA|
000000f0  75 cc 66 81 be fc 03 00  00 55 aa 75 c1 66 81 be  |u.f......U.u.f..|
00000100  fc 05 00 00 55 aa 75 b6  83 7e 2a 00 77 03 e9 ef  |....U.u..~*.w...|
00000110  02 be 80 7d fb ac 98 03  f0 ac 84 c0 74 17 3c ff  |...}........t.<.|
00000120  74 09 b4 0e bb 07 00 cd  10 eb ee be 83 7d eb e4  |t............}..|
00000130  be 81 7d eb df 33 c0 cd  16 5e 1f 8f 04 8f 44 02  |..}..3...^....D.|
00000140  cd 19 00 00 00 00 00 00  00 00 00 50 52 51 91 92  |...........PRQ..|
00000150  33 d2 f7 76 18 91 f7 76  18 42 87 ca f7 76 1a 8a  |3..v...v.B...v..|
00000160  f2 8a 56 40 8a e8 d0 cc  d0 cc 0a cc b8 01 02 cd  |..V@............|
00000170  13 59 5a 58 72 09 40 75  01 42 03 5e 0b e2 cc c3  |.YZXr.@u.B.^....|
00000180  03 18 01 27 0d 0a 49 6e  76 61 6c 69 64 20 73 79  |...'..Invalid sy|
00000190  73 74 65 6d 20 64 69 73  6b ff 0d 0a 44 69 73 6b  |stem disk...Disk|
000001a0  20 49 2f 4f 20 65 72 72  6f 72 ff 0d 0a 52 65 70  | I/O error...Rep|
000001b0  6c 61 63 65 20 74 68 65  20 64 69 73 6b 2c 20 61  |lace the disk, a|
000001c0  6e 64 20 74 68 65 6e 20  70 72 65 73 73 20 61 6e  |nd then press an|
000001d0  79 20 6b 65 79 0d 0a 00  49 4f 20 20 20 20 20 20  |y key...IO      |
000001e0  53 59 53 4d 53 44 4f 53  20 20 20 53 59 53 80 01  |SYSMSDOS   SYS..|
000001f0  00 57 49 4e 42 4f 4f 54  20 53 59 53 00 00 55 aa  |.WINBOOT SYS..U.|
00000200


=============================== StdErr Messages: ===============================

xz: (stdin): Compressed data is corrupt

Notes:
Everything above sda is on external USB drives and not involved with a 'working' operating system.
[original post edited for clarity -- and addition of results.txt from BootInfo script.]
Last edited by RonC on Tue May 15, 2012 7:36 am, edited 2 times in total.
RonC
Level 1
Level 1
 
Posts: 48
Joined: Mon Mar 19, 2012 8:21 pm
Location: Funchal

Linux Mint is funded by ads and donations.
 

Re: It's possible to write boot sector inside logical partit

Postby mintybits on Tue May 15, 2012 7:17 am

Hi there.
What you are trying to do is quite possible. I think something went wrong when you copied the partition boot sector/record (or PBR) to a file for Windows to execute. The zero byte filesize is a give-away :wink: ...it should have been at least 446, usually 512.

First some checks.
It appears you created a separate boot partition sda9 for the root partition sad10.
Grub's boot sector is installed to the PBR of sda9, which is fine.
So what you need to do is have Windows run the Grub boot sector code.

The way it all works when the MBR code is the original (not replaced by Grub code) is that the bios loads the MBR code and runs it. This code looks at the partition table for the boot flag and if it finds one it will load the PBR code for the flagged partition and execute it. This works only for the 4 primary partitions. The Grub boot code is in sda9 which is not primary.

If you want to boot Grub using the boot flag you need to copy the Grub code from sda9 PBR to sda3 PBR and set the boot flag to sda3. This is fairly simple but requires care to only copy the code area of the PBR and not to overwrite the partition table of sda3. If you want to try this ask me and I'll provide the details.

If you want to boot sda9 using Windows you need to copy the sda9 PBR code to a binary file and copy that file to your Windows C: drive and then tell Windows' boot loader to use it. To make a file from sda9 do this in linux:
sudo dd if=/dev/sda9 bs=512 count=1 > grub-boot.bin
Then copy the grub-boot.bin to Windows C: drive. Follow the instructions you used before to either add it to the Windows boot loader or to use EasyBCD to add it.
(You can name the file whatever you like but it should probably have a .bin suffix for Windows compatibility)
I haven't used EasyBCD recently but I think it can be told to search for the grub code in each PBR thus saving you the trouble of making a grub-boot.bin file.

Having said all this, running Grub in a PBR is not recommended by the grub designers. It is unreliable because the ext4 filesystem (unlike NTFS) does not provide enough space for a full grub. The concise grub it uses cannot read ext4 and so uses a fixed sector address to find it's core.img file that is in the /boot/grub partition. Over time, certain filesystem operations can cause the sector address of core.img to change and this will break grub and you won't be able to boot Mint.
mintybits
Level 5
Level 5
 
Posts: 568
Joined: Fri Jan 27, 2012 5:09 pm

Re: It's possible to write boot sector inside logical partit

Postby RonC on Tue May 15, 2012 8:04 am

mintybits wrote:Having said all this, running Grub in a PBR is not recommended by the grub designers. ...
:) Thanks for the fast and complete response!

I didn't want to overly complicate the first post ... but yes, you're right. When I thought the PBR wasn't there (I guess it really is?) I tried to manually reinstall it from the command line, and not only was told that it failed (but now I guess it really succeeded) but a verbose warning was displayed, essentially saying "don't do this"!!!

But I didn't know how serious it was, and you explained that. You're giving me second thoughts about doing this, at all!

If not this, then what else? Let mint overwrite the whole drive's boot record, and then do a repair with the Windows 7 installation disk? And then use EasyBCD and get LinuxMint back -- or do something equivalent, but manually at the command line?

:?: What do you suggest to overcome the PBR problem -- given the partition set-up shown in results.txt? Can I get mint's boot record onto the disk, from the command line and without going through a re-installation of mint?

And, after that's done, should PBR now on sda9 be removed, or makes no difference?
RonC
Level 1
Level 1
 
Posts: 48
Joined: Mon Mar 19, 2012 8:21 pm
Location: Funchal

Re: It's possible to write boot sector inside logical partit

Postby mintybits on Tue May 15, 2012 8:16 am

RonC wrote: :) Thanks for the fast and complete response!

You are welcome. :) I like to explain the technicals in a little detail so you are better able to figure out your own work-around.
If not this, then what else? Let mint overwrite the whole drive's boot record, and then do a repair with the Windows 7 installation disk? And then use EasyBCD and get LinuxMint back -- or do something equivalent, but manually at the command line?

:?: What do you suggest to overcome the PBR problem -- given the partition set-up shown in results.txt? Can I get mint's boot record onto the disk, from the command line and without going through a re-installation of mint?

What I do is install Grub to a different device's MBR than the one Windows uses. On my laptop I use a tiny USB stick, one of those really tiny ones that hardly shows, and leave it plugged in permanently. I installed grub to the USB and told the bios to boot from the USB. This gives a grub menu that offers either Mint or Windows. If, for any reason, Grub fails or I remove Mint I can still boot Windows directly from the HD.

In your case you appear to have 3 HDs. Could you use one of those for Grub?

I usually recommend that if people have multiple HDs they install linux/grub to its own HD and not mix things up with Windows on a single HD.

And, after that's done, should PBR now on sda9 be removed, or makes no difference?

Makes no difference.
mintybits
Level 5
Level 5
 
Posts: 568
Joined: Fri Jan 27, 2012 5:09 pm

Re: It's possible to write boot sector inside logical partit

Postby RonC on Tue May 15, 2012 9:04 am

Thanks!
If you say you can tell the PBR is really there, then I must have done something very wrong at the command line to produce a zero byte file. That would most likely be why, so the examples you gave will be most helpful.

:) Everything has been noted, and I will now get to work. Your style of explanation is great! Any problems I can't figure out, and I will post again.
RonC
Level 1
Level 1
 
Posts: 48
Joined: Mon Mar 19, 2012 8:21 pm
Location: Funchal


Return to Installation & Boot

Who is online

Users browsing this forum: No registered users and 17 guests