Re: Help! I can't boot my Windows partition any more!

2015-10-01 Thread Ottavio Caruso
On 30 September 2015 at 23:47, Ottavio Caruso
 wrote:
> Hello,
>
> I used to dual boot Windows 7 and NetBSD.
>
> This is my fdisk:
>
>
> Disk: /dev/rwd0d
> NetBSD disklabel disk geometry:
> cylinders: 155061, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
> total sectors: 156301488, bytes/sector: 512
>
> BIOS disk geometry:
> cylinders: 1023, heads: 240, sectors/track: 63 (15120 sectors/cylinder)
> total sectors: 156301488
>
> Partitions aligned to 2048 sector boundaries, offset 2048
>
> Partition table:
> 0: NTFS, OS/2 HPFS, QNX2 or Advanced UNIX (sysid 7)
> start 2048, size 204800 (100 MB, Cyls 0-13/163/19)
> 1: NTFS, OS/2 HPFS, QNX2 or Advanced UNIX (sysid 7)
> start 206848, size 63375360 (30945 MB, Cyls 13/163/20-4205/41/25)
> 2: NetBSD (sysid 169)
> start 63582208, size 46360576 (22637 MB, Cyls 4205/41/26-7271/83/35), 
> Active
> 3: Primary DOS with 32 bit FAT (sysid 11)
> start 109942784, size 46358528 (22636 MB, Cyls 7271/83/36-10337/93/13)
> First active partition: 2
> Drive serial number: 4067601000 (0xf272aa68)
>
>
> and this is my disklabel:
>
> -- bash-4.3$ sudo disklabel wd0
> # /dev/rwd0d:
> type: unknown
> disk: HITACHI HTS5425
> label:
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 16
> sectors/cylinder: 1008
> cylinders: 155061
> total sectors: 156301488
> rpm: 3600
> interleave: 1
> trackskew: 0
> cylinderskew: 0
> headswitch: 0   # microseconds
> track-to-track seek: 0  # microseconds
> drivedata: 0
>
> 16 partitions:
> #sizeoffset fstype [fsize bsize cpg/sgs]
>  a:  17687376  63582208 4.2BSD   2048 16384 0  # (Cyl.  63077*-  
> 80624*)
>  b:204800  2048   NTFS # (Cyl.  2*-
> 205*)
>  c:  46360576  63582208 unused  0 0# (Cyl.  63077*- 
> 109070*)
>  d: 156301488 0 unused  0 0# (Cyl.  0 - 
> 155060)
>  e:  28673200  81269584 4.2BSD   2048 16384 0  # (Cyl.  80624*- 
> 109070*)
>  f:  63375360206848   NTFS # (Cyl.205*-  
> 63077*)
>  g:  46358528 109942784  MSDOS # (Cyl. 109070*- 
> 155060*)
>
>
> I marked my NetBSD partition active with SystemRescueCD, leaving me
> the only option to boot Windows from a usb drive with syslinux.
>
> Now the usb drive is unbootable, therefore I can only access NetBSD.
>
> How can I boot from Windows without recurring to an external computer?
>

At least can anybody advise if I can mark the partition active from
within NetBSD?

Would "fdisk -B wd0" give me the option to select a bootable partition?

Is it safe to use fdisk on a Windows partition?

-- 
Ottavio


Re: Help! I can't boot my Windows partition any more!

2015-10-01 Thread Robert Elz
Date:Thu, 1 Oct 2015 13:47:38 +0100
From:Ottavio Caruso 
Message-ID:  


  | At least can anybody advise if I can mark the partition active from
  | within NetBSD?

Yes, fdisk can do that.

  | Would "fdisk -B wd0" give me the option to select a bootable partition?

Yes.   Just do that and install the bootselector, and you'll be back to
dual boot.

  | Is it safe to use fdisk on a Windows partition?

Yes.   Fdisk only modifies the MBR, that can (were you to do it) alter the
position of a partition (any partition, including the windows one) which
would effectively destroy it (unless you restore the old values).  Aside
from that, fdisk and partitions are orthogonal.

kre



Re: Help! I can't boot my Windows partition any more!

2015-10-01 Thread Robert Elz
Date:Thu, 1 Oct 2015 19:38:03 +
From:Ottavio Caruso 
Message-ID:  

Re: Help! I can't boot my Windows partition any more!

2015-10-01 Thread Ottavio Caruso
On 1 October 2015 at 08:43, Robert Elz  wrote:
> Ottavio: Use the (NetBSD) fdisk, have it update the mbr boot, and install the
> boot selector, you'll know you're doing the right one when it asks for a label
> for each partition (a boot name).   Don't change geometries, or partition
> layout info or types - just the mbr boot code.   For the labels use "Windows"
> and "NetBSD" (or whatever else you like - I tend to use somewhat more
> derogatory names instead of "Windows" when I have to do this occasionally...)
> for those two partitions (no labels at all for any mbr partition you don't
> want to be able to boot).

Thanks Robert,

and apologies to everybody. I had not received any emails from the
list, now the problem is fixed.

But this is not what I'm looking for.

I don't want to install a boot selector.

I just want to mark the Windows partition active.


-- 
Ottavio


Re: Help! I can't boot my Windows partition any more!

2015-10-01 Thread Ottavio Caruso
On 1 October 2015 at 13:24, Robert Elz  wrote:
>   | Would "fdisk -B wd0" give me the option to select a bootable partition?
>
> Yes.   Just do that and install the bootselector, and you'll be back to
> dual boot.

Sorry for being pedantic Robert,

you said "just do that" and "install the bootselector".

If I "fdisk -B wd0", woukd that just mark the partition active or
would it also install the boot selector?

-- 
Ottavio


Re: Help! I can't boot my Windows partition any more!

2015-10-01 Thread Thomas Mueller
from MLH:

> I have no idea if it is related, but at least on both of my Netbsd
> 7 systems, both amd64 and i386, installboot appears to destroy the
> bootblock on at least the usb drives I have tried, rendering those
> drives unbootable. I ran out of expendible external drives and
> really don't want to try another drive. I haven't tried a usb memory
> stick as I have never tried to get one to be bootable.

I've had good luck installing NetBSD and FreeBSD to USB sticks so as to be 
bootable on their own.

For NetBSD, using gpt, I make root partition and swap partition, not sure if 
swap partition is needed.

I run newfs on root-to-be partition, build and install from source, run 
installboot.

I don't know if this works as well on NetBSD <= 6.x, worked on 6.99.x so should 
be good on 7 and 7.99.x.

Also, I had a hard-drive installation of 7.99.1 amd64, copied the installation 
to USB stick for backup (prepared with gpt and newfs), ran installboot, and it 
booted successfully.

Installing NetBSD to a USB stick is much slower than to a hard drive.

Tom



Re: Help! I can't boot my Windows partition any more!

2015-10-01 Thread Robert Elz
Date:Wed, 30 Sep 2015 17:41:51 -0700
From:Andy Ruhl 
Message-ID:  

Re: Help! I can't boot my Windows partition any more!

2015-09-30 Thread Andy Ruhl
On Wed, Sep 30, 2015 at 3:47 PM, Ottavio Caruso
 wrote:
> Hello,
>
> I used to dual boot Windows 7 and NetBSD.
>
> This is my fdisk:
>
>
> Disk: /dev/rwd0d
> NetBSD disklabel disk geometry:
> cylinders: 155061, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
> total sectors: 156301488, bytes/sector: 512
>
> BIOS disk geometry:
> cylinders: 1023, heads: 240, sectors/track: 63 (15120 sectors/cylinder)
> total sectors: 156301488
>
> Partitions aligned to 2048 sector boundaries, offset 2048
>
> Partition table:
> 0: NTFS, OS/2 HPFS, QNX2 or Advanced UNIX (sysid 7)
> start 2048, size 204800 (100 MB, Cyls 0-13/163/19)
> 1: NTFS, OS/2 HPFS, QNX2 or Advanced UNIX (sysid 7)
> start 206848, size 63375360 (30945 MB, Cyls 13/163/20-4205/41/25)
> 2: NetBSD (sysid 169)
> start 63582208, size 46360576 (22637 MB, Cyls 4205/41/26-7271/83/35), 
> Active
> 3: Primary DOS with 32 bit FAT (sysid 11)
> start 109942784, size 46358528 (22636 MB, Cyls 7271/83/36-10337/93/13)
> First active partition: 2
> Drive serial number: 4067601000 (0xf272aa68)
>
>
> and this is my disklabel:
>
> -- bash-4.3$ sudo disklabel wd0
> # /dev/rwd0d:
> type: unknown
> disk: HITACHI HTS5425
> label:
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 16
> sectors/cylinder: 1008
> cylinders: 155061
> total sectors: 156301488
> rpm: 3600
> interleave: 1
> trackskew: 0
> cylinderskew: 0
> headswitch: 0   # microseconds
> track-to-track seek: 0  # microseconds
> drivedata: 0
>
> 16 partitions:
> #sizeoffset fstype [fsize bsize cpg/sgs]
>  a:  17687376  63582208 4.2BSD   2048 16384 0  # (Cyl.  63077*-  
> 80624*)
>  b:204800  2048   NTFS # (Cyl.  2*-
> 205*)
>  c:  46360576  63582208 unused  0 0# (Cyl.  63077*- 
> 109070*)
>  d: 156301488 0 unused  0 0# (Cyl.  0 - 
> 155060)
>  e:  28673200  81269584 4.2BSD   2048 16384 0  # (Cyl.  80624*- 
> 109070*)
>  f:  63375360206848   NTFS # (Cyl.205*-  
> 63077*)
>  g:  46358528 109942784  MSDOS # (Cyl. 109070*- 
> 155060*)
>
>
> I marked my NetBSD partition active with SystemRescueCD, leaving me
> the only option to boot Windows from a usb drive with syslinux.
>
> Now the usb drive is unbootable, therefore I can only access NetBSD.
>
> How can I boot from Windows without recurring to an external computer?

It's been a while since I've messed with NetBSD on a PC, so I might
not be the best guy for this.

Sounds like your primary boot loader, the mbr loader, is missing? It
should prompt you to use an F key to load whatever primary partition
you want. Is it doing that? See the man page for mbr. You can probably
write it back to the MBR inside NetBSD and get the primary bootloader
back.

Andy


Re: Help! I can't boot my Windows partition any more!

2015-09-30 Thread MLH
> Hello,
> 
> I used to dual boot Windows 7 and NetBSD.

...

> Now the usb drive is unbootable, therefore I can only access NetBSD.

I have no idea if it is related, but at least on both of my Netbsd
7 systems, both amd64 and i386, installboot appears to destroy the
bootblock on at least the usb drives I have tried, rendering those
drives unbootable. I ran out of expendible external drives and
really don't want to try another drive. I haven't tried a usb memory
stick as I have never tried to get one to be bootable.