Subject: Mounting a Windows disk with NetBSD 1.5.3
To: None <netbsd-help@netbsd.org>
From: Brandon Kuczenski <brandon@301south.net>
List: netbsd-help
Date: 12/12/2004 22:01:49
Hello; I am not sure if this is the appropriate forum to ask this
question.  It concerns the 'disklabel' command on NetBSD (but may apply to
the 'disklabel' command in general).

I am trying to use a NetBSD 1.5.3 live-filesystem CD-ROM to recover files
from a dying HDD belonging to a friend, which runs Windows XP.  The disk
lives inside an IBM T30 laptop.

I get NetBSD running -- it works great, by the way! -- obtain a DHCP
address, and mount the destination drive for the rescued files on my
server via nfs.  Fine. But I cannot mount the internal hard drive.

fdisk gives me an error "wd0: no disk label" and then prints out the
following:
NetBSD disklabel disk geometry:
cylinders: 16383 heads: 16 sectors/track: 63 (1008 sectors/cylinder)

BIOS disk geometry:
cylinders: 1023 heads: 240 sectors/track: 63 (15120 sectors/cylinder)

Partition table:
0: sysid 7 (OS/2 HPFS or NTFS or QNX2 or Advanced UNIX)
    start 63, size 75327777 (36781 MB), flag 0x80
	beg: cylinder    0, head   1, sector  1
	end: cylinder 1023, head 239, sector 63
1: sysid 28 (unknown)
    start 75327840, size 2812320 (1373 MB), flag 0x0
	beg: cylinder 1023, head   0, sector  1
	end: cylinder 1023, head 239, sector 63
2: <UNUSED>
3: <UNUSED>

Partition 0 there is the ~40-gig partition I expect to see.

'disklabel -r wd0' fails, saying there is no disk label, but I can read
the kernel's automatically-generated disklabel with 'disklabel wd0', which
gives (shortened version):

# /dev/rwd0d:
type: ESDI
disk: HITACHI_DK23DA-4
label: fictitious
<...SNIP...>

8 partitions:
#        size   offset     fstype   [fsize bsize cpg/sgs]
  d: 78140160        0     unused        0     0         # (Cyl.    0 - 77519)
  e: 75327777       63       NTFS                        # (Cyl.    0*- 74729)
  f:  2812320 75327840     unused        0     0         # (Cyl. 74730 - 77519)

If I try to mount -t ntfs /dev/wd0d /tmp/home I get the error "Invalid
Argument".

I have tried to write the disklabel a few times, but it has not succeeded,
possibly because it doesn't know the appropriate fsize and bsize.

Anyone have any clues for me?  Or, if there's a more appropriate list on
which to ask the question?

Thanks in advance,
Brandon