Subject: Re: can't mount msdos fs on floppy anymore
To: None <current-users@netbsd.org>
From: Christian Biere <christianbiere@gmx.de>
List: current-users
Date: 01/21/2007 03:57:13
Jukka Salmi wrote:
> I just noticed that I can't mount msdos file systems on floppy disks
> anymore. I do this about once a year, so I don't know when it stopped
> working... However, it fails on a 4.99.8 system while it still works
> fine with 3.2_STABLE (both NetBSD/i386):
> 
> $ uname -sr
> NetBSD 4.99.8
> $ sudo mount -t msdos /dev/fd0a /mnt/tmp
> mount_msdos: /dev/fd0a on /mnt/tmp: Inappropriate ioctl for device

I assume this would fix it, but I haven't tested it yet:

--- /sys/dev/isa/fd.c.orig	2006-12-26 15:46:41.000000000 +0100
+++ /sys/dev/isa/fd.c	2007-01-21 03:51:38.000000000 +0100
@@ -1339,6 +1339,12 @@ fdioctl(dev, cmd, addr, flag, l)
 		*(struct disklabel *)addr = buffer;
 		return 0;
 
+	case DIOCGPART:
+		((struct partinfo *)data)->disklab = fd->sc_dkdev.dk_label;
+		((struct partinfo *)data)->part =
+		    &fd->sc_dkdev.dk_label->d_partitions[DISKPART(dev)];
+		break;
+
 	case DIOCWLABEL:
 		if ((flag & FWRITE) == 0)
 			return EBADF;

-- 
Christian