6839118 *newfs* fails newly formated floppy disk
authorJim Rice <Jim.Rice@Sun.COM>
Wed, 05 May 2010 08:52:13 +0100
changeset 12312 2f3e4b56b6fe
parent 12311 650b48a2bf75
child 12313 c894fe63f90f
6839118 *newfs* fails newly formated floppy disk
usr/src/cmd/fs.d/ufs/newfs/newfs.c
--- a/usr/src/cmd/fs.d/ufs/newfs/newfs.c	Wed May 05 12:10:59 2010 +0800
+++ b/usr/src/cmd/fs.d/ufs/newfs/newfs.c	Wed May 05 08:52:13 2010 +0100
@@ -713,6 +713,7 @@
 {
 	struct dk_geom g;
 	struct dk_cinfo ci;
+	struct dk_minfo info;
 	diskaddr_t actual_size;
 	int fd;
 
@@ -741,6 +742,18 @@
 			isremovable = 0;
 		}
 
+		/* If removable check if a floppy disk */
+		if (isremovable) {
+			if (ioctl(fd, DKIOCGMEDIAINFO, &info)) {
+				dprintf(("DeBuG newfs : Unable to get media"
+				    " info from %s.\n", disk));
+			} else {
+				if (info.dki_media_type == DK_FLOPPY) {
+					isremovable = 0;
+				}
+			}
+		}
+
 		if (ioctl(fd, DKIOCHOTPLUGGABLE, &ishotpluggable)) {
 			dprintf(("DeBuG newfs : Unable to determine if %s is"
 			    " Hotpluggable Media. Proceeding with system"