Jump to content











Photo
- - - - -

grubinst.exe- write failed- Vista & NTFS bootsector


  • Please log in to reply
42 replies to this topic

#1 ilko

ilko

    Frequent Member

  • Advanced user
  • 473 posts
  •  
    Bulgaria

Posted 13 June 2009 - 01:33 PM

Just got a chance to play a bit with such system, where grubinst.exe fails to write bootsector on NTFS formatted partition.
OS is Vista 32bit SP2.
Posted Image

CMD is run as administrator, writing grub4dos MBR to the same disk is successful, so is writing BS to FAT32 partition on the same disk:

C:\Users\mute\Desktop\files\grub4dos>grubinst -v -l (hd1)
Partition list
# id base leng
0 0C 3F 7AFFC1 (3936M)

C:\Users\mute\Desktop\files\grub4dos>grubinst -v (hd1,0)
Start sector: 0x3F
Image type: FAT32
Install mode

C:\Users\mute\Desktop\files\grub4dos>

Grub4dos bootsector is written indeed.

Changing "optimize for removal" / "optimize for performance" did not help.
I have never experienced such behavior on XP SP2/3.

Any help with this, please?

#2 steve6375

steve6375

    Platinum Member

  • Developer
  • 4,965 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 13 June 2009 - 05:36 PM

Run as Administrator ???

#3 ilko

ilko

    Frequent Member

  • Advanced user
  • 473 posts
  •  
    Bulgaria

Posted 13 June 2009 - 06:09 PM

Run as Administrator ???

;)

...CMD is run as administrator...



#4 steve6375

steve6375

    Platinum Member

  • Developer
  • 4,965 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 13 June 2009 - 06:42 PM

;)

Is the system BIOS option for 'Virus Protect' enabled? This prevents write to the first track?

#5 ilko

ilko

    Frequent Member

  • Advanced user
  • 473 posts
  •  
    Bulgaria

Posted 13 June 2009 - 07:06 PM

steve6375, I appreciate your replies, but I must quote myself again :

...writing grub4dos MBR to the same disk is successful, so is writing BS to FAT32 partition on the same disk:
....
Grub4dos bootsector is written indeed...

BIOS would not be relevant, it's something to do with NTFS BS and Vista/7, and grubinst failing to write the BS under those circumstances.

#6 steve6375

steve6375

    Platinum Member

  • Developer
  • 4,965 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 13 June 2009 - 07:18 PM

steve6375, I appreciate your replies, but I must quote myself again :


BIOS would not be relevant, it's something to do with NTFS BS and Vista/7, and grubinst failing to write the BS under those circumstances.


Vista locks the volume for absolute sector writes, but usually it is the FS area and not the VBR. So Vista will not let you write to any sector which has a mounted volume - but I am a sure that that the boot sectors would be writeable (at least in Vista SP1).

You could try a hard disk sector editor and read a sector and then write it back again.

??
S

#7 ilko

ilko

    Frequent Member

  • Advanced user
  • 473 posts
  •  
    Bulgaria

Posted 13 June 2009 - 08:06 PM

...You could try a hard disk sector editor and read a sector and then write it back again.

Since FAT32 works just fine on the same system I would not play with disk editor.

I use grubinst in WinSetupFromUSB to put grub4dos bootsector. Only some people report issues like this, and today I managed to get remote access to one of those installations to gather the data above.

I hope Bean123, the author of grubinst, will have a solution, and also hope it might help him in case fbinst uses similar approach when writing to USB sticks.

#8 steve6375

steve6375

    Platinum Member

  • Developer
  • 4,965 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 13 June 2009 - 08:42 PM

If you use a disk editor to read then write sector 0 under Vista it will work. If you use a disk editor to do the same to sector 50000 it will fail if that sector is part of the mounted OS volume.
If you tried sector 3f (63) and then say sector 7f, etc. you might find out just where Vista starts to deny write access. It could be that when formatted as NTFS, the sector(s) that grubinst tries to write to is protected, but when formatted as FAT32 - the same sector is writeable.

#9 tsetya

tsetya

    Member

  • Advanced user
  • 52 posts
  •  
    Indonesia

Posted 14 June 2009 - 07:58 AM

i had same experienced, using grubinst to install grub4dos to NTFS partition boot sector failed if there is vista partition on the disk.
then using grub4dos toolbox to install to the same partition with no problem.

#10 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,098 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 14 June 2009 - 12:46 PM

@ilko

Read this:
http://www.boot-land...?showtopic=7328

It seems like bootlace.com can be used now under NT based systems.

jaclaz

#11 ilko

ilko

    Frequent Member

  • Advanced user
  • 473 posts
  •  
    Bulgaria

Posted 14 June 2009 - 07:48 PM

Posted Image

At the same time:

D:\Downloads\dsfok>dsfo \\.\g: 0 8192 c:\MYPART.TMP

OK, 8192 bytes, 0.000s, MD5 = d40fe4983fb22a44cbf9b49ed6c69565



D:\Downloads\dsfok>dsfi \\.\g: 0 8192 c:\MYPART.TMP

OK, written 8192 bytes at offset 0

D:\Downloads\dsfok>


#12 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,098 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 14 June 2009 - 09:00 PM

Should none of the good grub4dos guys comes out with something ;), we can still write a small batch that uses dsfo/dsfi...;)

jaclaz

#13 ilko

ilko

    Frequent Member

  • Advanced user
  • 473 posts
  •  
    Bulgaria

Posted 24 June 2009 - 07:06 PM

Here we go:

D:\WinSetup\files\grub4dos>grubinst -v (hd1,0)
Start sector: 0x3F
Image type: NTFS
Install mode
grubinst: Write error

D:\WinSetup\files\grub4dos>fsutil volume dismount g:

D:\WinSetup\files\grub4dos>grubinst -v (hd1,0)
Start sector: 0x3F
Image type: NTFS
Install mode

D:\WinSetup\files\grub4dos>

Done under windows 7. Volume dismount is not required if partition is FAT16/32.

#14 ilko

ilko

    Frequent Member

  • Advanced user
  • 473 posts
  •  
    Bulgaria

Posted 25 June 2009 - 07:01 AM

After the success above unfortunately I fail in most of the attempts to write BS, even if volume is dismounted first.
It seems for some reason Win7 keeps locking the volume, even though no programs are using it. All explorer instances are closed, no AV program is running.

The behavior is very inconsistent, every second or third attempt to write BS fail, but some of them succeed, unplugging USB stick between every write operation and zeroing out the first 100-200 sectors before every format.

Keep digging...

#15 steve6375

steve6375

    Platinum Member

  • Developer
  • 4,965 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 25 June 2009 - 08:05 PM

You can always try my utility (RMPrepUSB in Project Forge). This can partition, format and write boot sectors to any USB drive under XP or Vista. But you will have to install grub4dos if you don't want to use a config.sys file with device=grub4dos.exe in it.

If you use RMPARTUSB instead of RMPrepUSB then you can script it all.

cheers

S

#16 ilko

ilko

    Frequent Member

  • Advanced user
  • 473 posts
  •  
    Bulgaria

Posted 25 June 2009 - 09:08 PM

Thanks steve6375, I am watching your work on these tools and appreciate it, very handy indeed.
However, I need to prepare USB disks from a script so they launch grub4dos, at the same time I'd like to avoid unnecessary chainloadings, from ms-dos or whatever, as I always prefer to keep things as simple as possible.

Having said that I am not sure how any of your tools would help with my problem.

Do you have any observations why and when Vista/7 lock volumes, making writing of BS/MBR to them impossible? How do you unlock them, if that's the case, in your application? Can this be done in similar fashion by grubinst? That's a field I am very novice in.

#17 steve6375

steve6375

    Platinum Member

  • Developer
  • 4,965 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 25 June 2009 - 10:12 PM

Thanks steve6375, I am watching your work on these tools and appreciate it, very handy indeed.
However, I need to prepare USB disks from a script so they launch grub4dos, at the same time I'd like to avoid unnecessary chainloadings, from ms-dos or whatever, as I always prefer to keep things as simple as possible.

Having said that I am not sure how any of your tools would help with my problem.

Do you have any observations why and when Vista/7 lock volumes, making writing of BS/MBR to them impossible? How do you unlock them, if that's the case, in your application? Can this be done in similar fashion by grubinst? That's a field I am very novice in.


You can prepare a USB stick using RMPARTUSB.

You can run RMPARTUSB FIND > getdrv.cmd
then call getdrv.cmd
This will get the drive number as an environment variable and drive letter (assuming one USB drive present)
Then you can run RMPARTUSB DRIVE=%DRIVE% NTFS MSDOS (see doc for syntax/parameters)
(suggest run RMPARTUSB FIND and call getdrv.cmd again here in case there was no driveletter originally)
Then you can use Grubinst to install Grub4DOS (use (hd%DRIVE% )
Then xcopy to copy files (inc grldr) to the USB drive (use %DRIVELETTER%)

If you still get problems with grubinst, then just skip the grubinst command and rename grldr to ntldr on the USB stick and use RMPARTUSB DRIVE=%DRIVE% NTFS NTLDR (or FAT32 instead of NTFS).





For your info, I try to dismount the volume letter of the USB drive as follows:
Open_Volume (Mid(strvol, 1, 2)) 'get lngHandle for volume letter
MyLock_Volume (lngHandle) 'may fail but FormatEX may work anyway !
MyDismount_Volume (lngHandle) 'may fail but still may enable FormatEX to work
MyUnlock_Volume (lngHandle)
CloseHandle (lngHandle)

HTH

#18 ilko

ilko

    Frequent Member

  • Advanced user
  • 473 posts
  •  
    Bulgaria

Posted 25 June 2009 - 11:27 PM

Then you can use Grubinst to install Grub4DOS (use (hd%DRIVE% )

This is the only issue I need to resolve- installing grub4dos' either BS or MBR under Vista/7.

If you still get problems with grubinst, then just skip the grubinst command and rename grldr to ntldr on the USB stick.

It's not universal solution as it would fail on FAT16 partitions as Tinybit explained reasons:
http://www.boot-land...?showtopic=4423

In addition I'd have to check host OS and use bootmgr or ntldr as a name, getting messy again.

The solution I hope for is a way to make grubinst work on such systems, as it provides clean and easy way of installing grub4dos MBR/BS, either by hoping for grub4dos guys attention for a possible fix, or by using another tool run before/after grubinst, which helps the write operation to succeed.

#19 Bean123

Bean123

    Member

  • Members
  • 30 posts

Posted 26 June 2009 - 03:49 AM

I also encounter this problem with fbinst. The fact is that vista doesn't permit direct write to area inside a partition, I haven't found a way to work around it yet.

#20 joakim

joakim

    Silver Member

  • Team Reboot
  • 867 posts
  • Location:Bergen
  •  
    Norway

Posted 26 June 2009 - 07:59 AM

I also encounter this problem with fbinst. The fact is that vista doesn't permit direct write to area inside a partition, I haven't found a way to work around it yet.


It may be related to the issue of vmware workstation on vista with physical disks attached to vm.

Have a look at this thread:

http://communities.v...1...=0&tstart=0

Joakim

#21 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,098 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 26 June 2009 - 08:05 AM

Wouldn't the "workaround" that I use with MBRBATCH/MKIMG (due to the limits of my approach :lol:) of creating a (sparse) image of the stick, partition/formatting it, and then clone it to \\.\PhysicalDrivven be working? ;)
http://www.boot-land...?...c=5000&st=1

;)

jaclaz

#22 rrkumar50

rrkumar50
  • Members
  • 2 posts
  •  
    India

Posted 02 August 2009 - 01:07 AM

My Earlier experience, Things are Working with my 1GB Key, [2partition]with (Vista Recovery DIsc on It & Slax & Some BootFloppy Images, some time back, ( I used Grub-Install-Win32.exe OnlY)
Now I had similar problem as mentioned, I have got a 8GB key, Tried Grub-Install-Win32.exe & am getting Write Error.
Another issue, i Tried the Grub-install-Win32.exe on my Server (RAID 5); again i got similar problem. :idea:
Any help with this, please? :P
ThanX
Ram

@ilko

Read this:
http://www.boot-land...?showtopic=7328

It seems like bootlace.com can be used now under NT based systems.

jaclaz



#23 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,098 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 02 August 2009 - 10:11 AM

I wouldn't trust this kind of utilities on a RAID system.


On the stick, try ALL the apps listed here:
http://www.msfn.org/...o...87993&st=17
until you find one that works.

jaclaz

#24 maanu

maanu

    Gold Member

  • Advanced user
  • 1,125 posts
  •  
    Pakistan

Posted 02 August 2009 - 01:20 PM

fbinsr does not work on ntfs (as of now ) .

#25 joakim

joakim

    Silver Member

  • Team Reboot
  • 867 posts
  • Location:Bergen
  •  
    Norway

Posted 03 August 2009 - 09:42 PM

I just made a tiny little tool that allows for rawdisk usage with vmware on Vista/2008/Win7; http://communities.v.../docs/DOC-10455

The trick is to make the OS believe there is no volume to lock, and you will have full access to every sector.

I just tried grubinst.exe and fbinst.exe on ntfs volumes in Server 2008. It succeeds if running my tool prior to attempt, and fails otherwise with write errors.

Choose the first dropdown box after "Vista:" and select your PhysicalDiskN, then press "Prepare Disk". It is really simple and based on dsfi.exe and dsfo.exe, just reading and writing to the mbr.

Joakim




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users